Posts by Mxkert

    Ah ofcourse. I just edited that part but now it is giving me the following PHP errors:


    Code
    1. [Wed Sep 18 15:56:19.133775 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: PHP Warning: filesize(): stat failed for https://www.[DOMAIN].nl/uploads/products/FO1/FO1.jpg in /[ROOT]/[SITENAME]/perch/core/apps/assets/PerchAssets_Importer.class.php on line 47, referer: http://[DOMAIN]/perch/addons/apps/my_sample/
    2. [Wed Sep 18 15:56:19.133855 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to a member function find_all_tags_and_repeaters() on null in /[ROOT]/[SITENAME]/perch/core/lib/PerchBase.class.php:185, referer: http://[DOMAIN]/perch/addons/apps/my_sample/
    3. [Wed Sep 18 15:56:19.133866 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: Stack trace:, referer: http://[DOMAIN]/perch/addons/apps/my_sample/
    4. [Wed Sep 18 15:56:19.133873 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: #0 /[ROOT]/[SITENAME]/perch/templates/pages/shop/importeren.php(76): PerchBase->index(), referer: http://[DOMAIN]/perch/addons/apps/my_sample/
    5. [Wed Sep 18 15:56:19.133881 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: #1 /[ROOT]/[SITENAME]/perch/core/runway/start.php(43): include('/home/kndrxwbst...'), referer: http://[DOMAIN]/perch/addons/apps/my_sample/
    6. [Wed Sep 18 15:56:19.133888 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: #2 /[ROOT]/[SITENAME]/perch/core/runway/start.php(47): perch_runway_dispatch_page(Object(PerchRoutedPage)), referer: http://[DOMAIN]/perch/addons/apps/my_sample/
    7. [Wed Sep 18 15:56:19.133896 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: #3 {main}, referer: http://[DOMAIN]/perch/addons/apps/my_sample/
    8. [Wed Sep 18 15:56:19.133902 2019] [fcgid:warn] [pid 14238:tid 140618059556608] [client 31.160.4.226:56902] mod_fcgid: stderr: thrown in /[ROOT]/[SITENAME]/perch/core/lib/PerchBase.class.php on line 185, referer: http://[DOMAIN]/perch/addons/apps/my_sample/

    Hello Byron, thank you for the response. I tried it, but I get a PHP error:

    Code
    1. PHP Fatal error: Uncaught Error: Call to a member function index() on boolean in ......

    While using the following import code:

    Hello,


    I am using the product importer to import products, but they are not indexed after import. I have to save them manually to make them show up in the webshop.
    A piece of my code:


    Well a lot of assets do get imported correctly. I ran the importer 5 times, and all the images that are imported correct, show up 5 times (imported correctly) and the assets that are imported as blank/broken images, show up 5 times as broken images, so I think it has something to do with the size or something else related to the asset.


    I am using the following code to import the assets, coming from an API:


    One supported way of doing this is to write an app with an event listener to listen to the event Perch Shop fires when an order is complete. Hopefully the event returns all the data you need.


    Thank you for this, I think I can use this very well.


    Regarding the product SKU's, I found a solution by looking for the productID in the database and getting the SKU from that productID:

    SQL
    1. SELECT sku FROM perch3_shop_products WHERE productID = $productID

    Hello,


    When importing assets I am getting the following errors on some of the assets:

    Code
    1. [message] => filesize(): stat failed for https://www.[DOMAIN].nl/[IMAGE].jpg

    Does this mean that the file size is too big? Approx 50% of the images get uploaded just fine, but the rest are broken images displayed in the assets app.

    Byron, thank you for this example, it helped me a lot!


    Yes I had a repeater field for the product images, because not all products have the same amount of images. But I could make individual image fields in my template, like image1, image2 etc. to work around it.

    Well I am extending the PerchShop_Order.class.php to send the order through an external API. For that I am using the following code:



    Now I hardcoded the productcode (SKU) and the quantity and it is working fine. But now I have to get the productcode (SKU) and quantity for each product sold. Is there a way in which I could get those variables?

    Hello,


    Is it possible to import the images from a product with PerchShopProductImporter instead of the AssetImporter?

    The JSON data is as follows (with multiple images in the array per product):


    Code
    1. {
    2. "data": [
    3. {
    4. "images": [
    5. "http://www.domain.nl/uploads/product/image.jpg"
    6. ],
    7. }
    8. ]
    9. }

    Hello,


    I am importing a lot of assets, but after some time I get a maximum execution time error. The error:

    Code
    1. mod_fcgid: stderr: PHP Fatal error: Maximum execution time of 30 seconds exceeded in MYDOMAIN/perch/core/lib/PerchImage.class.php on line 644

    How can I increase this maximum execution time?


    Thanks,

    Mike

    Hello,


    I am trying to get the sku from a product, using the product id which I am getting from a shop order.

    Could anyone tell me how I can get the sku from the following product:


    Code
    1. $Products = new PerchShop_Products($this->api);
    2. $Product = $Products->find((int)1);

    You could use something like this:


    PHP
    1. <?php
    2. perch_blog_custom(array(
    3. 'count' => 1,
    4. 'template' => 'post_in_list.html',
    5. 'sort' => 'postDateTime',
    6. 'sort-order' => 'DESC',
    7. ));
    8. ?>

    I am using Google Recaptcha for a lot of clients, but some clients keep getting empty spam mails, daily. Also since this week a chinese e-mailadres (*@qq.com) sends 1000+ spam mails to a couple of clients in the course of an hour or so, which recaptcha does not prevent.