Posts by Mxkert

    First 10.000 char of debug:

    Here you go:

    I beautified the most important part:

    orderItemsTotal and orderSubtotal do have decimals in place, but are not strings.

    I think for some reason some of the values should be strings, for example: 109,04 should be '109,04'. I see two values like this, so then the total values would be 30.

    After some checking, I saw that orderItemsTotal and orderSubtotal are not written as strings in the values. How could I change this so they will be sent to the database as strings?


    I imported data into my database, from another webshop that I have. Since importing this data, when checking out I get the following message in the debug:

    1. 0,1035 0,0003 INSERT INTO perch3_shop_orders(orderStatus,orderGateway,orderTotal,currencyID,orderItemsSubtotal,orderItemsTax,orderItemsTotal,orderShippingSubtotal,orderShippingDiscounts,orderShippingTax,orderShippingTaxDiscounts,orderShippingTotal,orderDiscountsTotal,orderTaxDiscountsTotal,orderSubtotal,orderTaxTotal,orderItemsRefunded,orderTaxRefunded,orderShippingRefunded,orderTotalRefunded,orderTaxID,orderShippingWeight,orderCreated,orderPricing,orderDynamicFields,customerID,shippingID,orderShippingTaxRate,orderBillingAddress,orderShippingAddress) VALUES('created','mollie','118.85','44','109.04','9.81',118,85,'0.00','0.00','0.00','0.00','0.00','0.00','0.00',109,04,'9.81',0,0,0,0,NULL,'0.00','2019-10-13 11:54:23','standard','{\"terms_agreed\":\"true\"}','93','4',9,'659','660')
    2. 0,1037 0,0002 Invalid query: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1

    What does this mean?


    I use ProductImporter to get products from an API. I would like to change the price of the products.

    Currently there is no way to update products by using the ProductImporter. So to keep my products updated, I want to delete all products and import all products again from the API on a regular basis, so if a product is deleted or added in the API, it also gets deleted or added on my website.

    If I would just edit the price of a product, I would lose this value when deleting and importing back.

    So my idea was to create collections and connect them to products, by giving them the same slug for example. Use this collection to overwrite fields from the product.

    I hope this is not too vague of an explanation.


    I am using Perch Shop and I have imported a lot of products. Now I would like to make a collection which I attach to a certain product, by using the same slug for the product and the collection item for example. I want to create a field in the collection which will be used as the price of the product, so this collection item field will overwrite the price of the product.

    What would be the best solution to achieve this?



    I tried overwriting the product price by setting the price variable, but no luck.

    1. $plantPrijs = perch_collection('Planten', [
    2. 'filter' => 'slug',
    3. 'match' => 'eq',
    4. 'value' => perch_get('s'),
    5. 'skip-template' => true,
    6. ]);
    7. $plantPrijs = $plantPrijs[0]['prijs'];
    8. PerchSystem::set_var('price', $plantPrijs);

    On the product page I am outputting the collection with the same slug. Retrieving the price field from the collection and trying to overwrite the original product price field with this value.

    This is the result from the API call (only the first few products):

    1. {"data":[{"timestamp":"2019-02-03T14:46:45+01:00","productcode":"FO1","potsize":"21","height":"100","dutchname":"Areca \/ Dypsis Palm","linnaeusname":"Areca","numberperorder":"1","purchaseprice":"18.26","promotionaltext":"Groot en groen, maar niet t\u00e9 ruig. Een stijvolle plant.","description":"Goudpalm uit Madagaskar. Daar een bedreigde soort, maar onder andere op de Cara\u00efben zijn ze verwilderd en veel voorkomend. In de volle zon verkleuren de bladeren en de plant heeft gele bloemetjes: vandaar Goudpalm.\r\n\r\nDe Areca is niet makkelijk, maar wel populair in interieurs. Onder gunstige omstandigheden groeit hij tot aan het plafond. In de natuur kan hij 10 meter hoog worden.","specifications":"goudpalm; areca; pot 21 cm; hoogte 100 cm; groene plant; lichte plek in huis","caretips":"Zet de plant op een lichte plek, maar niet in de volle zon. De Goudpalm heeft ook een hekel aan tocht, en je moet er niet tegenaan lopen. Vermijd tenslotte radiatoren.\r\n\r\nGeef de palm in de zomer 2 \u00e0 3 keer per week lauwwarm water, 's winters 1 keer per week. Af en toe sproeien vindt ze fijn.\r\nDe plant groeit traag, geef haar hooguit in de groeiperiode 1 keer per maand voeding.","aboutgrower":"Fondieplant is \u00e9\u00e9n van de grootste Areca-palm kwekerijen in Europa.","branches":"","images":["https:\/\/\/uploads\/products\/FO1\/FO1.jpg","https:\/\/\/uploads\/products\/FO1\/FO1.3.jpg","https:\/\/\/uploads\/products\/FO1\/FO1.2.jpg","https:\/\/\/uploads\/products\/FO1\/FO1.4.jpg","https:\/\/\/uploads\/products\/FO1\/FO1.5.jpg","https:\/\/\/uploads\/products\/FO1\/FO1.6.jpg"],"grower":"Fondieplant","category":"Groene Plant"},
    2. ...