Forum

Thread tagged as: Error, Addons, Shop

Perch Shop customer addresses not being saved

Hi,

I'm having a problem setting up a Perch Shop where customer addresses aren't being saved on submission of the registration form. Customer details are being saved in perch2_members and perch2_shop_customers but perch2_shop_addresses remains empty.

Here is my checkout.php:

<?php
        if (!perch_member_logged_in()) {
            PerchSystem::redirect('/fireworks/register.php');
        }

        if (perch_shop_cart_has_property('terms_agreed')) {
            perch_shop_checkout('manual', [
                'return_url' => '/fireworks/result.php',
                'cancel_url' => '/fireworks',
            ]);
        }

        // Show the cart with a non-interactive template
        perch_shop_cart([
          'template'=>'cart/cart_static.html'
        ]);
        // Show the order addresses
        perch_shop_order_addresses();
        // Display the form with the T&Cs checkbox
        perch_shop_form('checkout/confirm.html');

        ?>

Here is register.php:

        <?php
        if (perch_member_logged_in()) {
            PerchSystem::redirect('/fireworks/checkout.php');
        }

        PerchSystem::set_var('shipping_weight', perch_shop_get_shipping_weight());
        perch_shop_registration_form();

        ?>

I've repeatedly tested with a fresh cart and then a fresh checkout with new customer details each time. This is what happens:

1) When first arriving in the checkout the registration form is presented. 2) Once I fill in the registration form I'm taken to the checkout which shows my static cart and T&C's confirmation field. But no addresses are shown. Here is the debug message at that time (no errors shown):

SELECT * FROM perch2_members_sessions WHERE sessionID='eab94f2a7a22dc46dbd20f6d088f1e9c5a48c31f' AND sessionHttpFootprint='b57a3b7c43e769ac29216f5c4ad5ba978bcb9b20' AND sessionExpires>'2016-09-12 06:05:19' LIMIT 1
User is logged in
[1] SELECT * FROM perch2_pages WHERE pagePath='/fireworks/checkout.php' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=11
[1] SELECT * FROM perch2_shop_cart WHERE cartID=11
[1] SELECT cartProperties FROM perch2_shop_cart WHERE cartID=11
Using cart from cache.
[34] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] Using template: /templates/shop/cart/cart_static.html
[1] SELECT billingAddress, shippingAddress FROM perch2_shop_cart WHERE billingAddress IS NOT NULL AND cartID=11
Using template: /templates/shop/checkout/confirm.html
[1] SELECT setID FROM perch2_category_sets WHERE setSlug='fireworks' LIMIT 1
[6] SELECT main.* FROM perch2_categories main WHERE 1=1 AND (catSlug!='best-sellers') AND setID=4 ORDER BY catTreePosition ASC
[6] Using template: /templates/categories/list.html
[1] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='_category' AND idx.indexValue LIKE 'fireworks/best-sellers%' OR idx.indexKey='_category' AND idx.indexValue='fireworks/best-sellers'))
[4] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='status' AND idx.indexValue='1')) GROUP BY idx.itemID HAVING COUNT(idx.itemID)=1
[4] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='parentID' AND idx.indexValue='')) GROUP BY idx.itemID HAVING COUNT(idx.itemID)=1
[1] SELECT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' JOIN perch2_shop_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='productID' AND idx2.indexKey='title' AND idx.itemID IN ('4') AND idx.itemID IN ('1', '2', '3', '4') AND idx.itemID IN ('1', '2', '3', '4') WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (productDeleted IS NULL) GROUP BY itemID, sortval ORDER BY sortval ASC
[1] Using template: /templates/shop/products/link_list.html
[95] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/fireworks/checkout.php' OR regionPage='*' ORDER BY regionPage DESC

3) I then check the T&Cs checkbox and press the "pay now" button. The page refreshes, the terms_agreed checkbox is now checked but nothing else has changed. Here is how the debug message now looks:

[1] SELECT * FROM perch2_members_sessions WHERE sessionID='eab94f2a7a22dc46dbd20f6d088f1e9c5a48c31f' AND sessionHttpFootprint='b57a3b7c43e769ac29216f5c4ad5ba978bcb9b20' AND sessionExpires>'2016-09-12 06:10:04' LIMIT 1
User is logged in
[1] SELECT * FROM perch2_pages WHERE pagePath='/fireworks/checkout.php' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=11
[1] SELECT * FROM perch2_shop_cart WHERE cartID=11
[34] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] SELECT cartProperties FROM perch2_shop_cart WHERE cartID=11
UPDATE perch2_shop_cart SET cartProperties='{\"terms_agreed\":\"true\"}' WHERE cartID='11'
[1] SELECT cartProperties FROM perch2_shop_cart WHERE cartID=11
Checking out with manual
Member ID: 5
[1] SELECT * FROM perch2_shop_customers WHERE memberID=5
[1] SELECT billingAddress, shippingAddress FROM perch2_shop_cart WHERE billingAddress IS NOT NULL AND cartID=11
[1] SELECT * FROM perch2_shop_addresses WHERE customerID='5' AND orderID IS NULL AND addressSlug='default'
no address
INSERT INTO perch2_shop_addresses(addressDynamicFields,addressTitle,addressSlug,addressCreated) VALUES('{\"first_name\":\"Laura\",\"last_name\":\"Spurling\",\"address_1\":false,\"address_2\":false,\"postcode\":false,\"country\":false,\"company\":false,\"city\":false,\"customer\":\"5\",\"phone\":false,\"county\":false,\"instructions\":false}','default','default','2016-09-12 05:10:04')
Invalid query: SQLSTATE[HY000]: General error: 1364 Field 'countryID' doesn't have a default value
[1] SELECT * FROM perch2_shop_addresses WHERE customerID='5' AND orderID IS NULL AND addressSlug='shipping'
no address
INSERT INTO perch2_shop_addresses(addressDynamicFields,addressTitle,addressSlug,addressCreated) VALUES('{\"first_name\":\"Laura\",\"last_name\":\"Spurling\",\"address_1\":false,\"address_2\":false,\"postcode\":false,\"country\":false,\"company\":false,\"city\":false,\"customer\":\"5\",\"phone\":false,\"county\":false,\"instructions\":false}','shipping','shipping','2016-09-12 05:10:04')
Invalid query: SQLSTATE[HY000]: General error: 1364 Field 'countryID' doesn't have a default value
Customer or Address or Shipping missing
Using cart from cache.
[1] Using template: /templates/shop/cart/cart_static.html
[1] SELECT billingAddress, shippingAddress FROM perch2_shop_cart WHERE billingAddress IS NOT NULL AND cartID=11
Using template: /templates/shop/checkout/confirm.html
[1] SELECT setID FROM perch2_category_sets WHERE setSlug='fireworks' LIMIT 1
[6] SELECT main.* FROM perch2_categories main WHERE 1=1 AND (catSlug!='best-sellers') AND setID=4 ORDER BY catTreePosition ASC
[6] Using template: /templates/categories/list.html
[1] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='_category' AND idx.indexValue LIKE 'fireworks/best-sellers%' OR idx.indexKey='_category' AND idx.indexValue='fireworks/best-sellers'))
[4] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='status' AND idx.indexValue='1')) GROUP BY idx.itemID HAVING COUNT(idx.itemID)=1
[4] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='parentID' AND idx.indexValue='')) GROUP BY idx.itemID HAVING COUNT(idx.itemID)=1
[1] SELECT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' JOIN perch2_shop_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='productID' AND idx2.indexKey='title' AND idx.itemID IN ('4') AND idx.itemID IN ('1', '2', '3', '4') AND idx.itemID IN ('1', '2', '3', '4') WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (productDeleted IS NULL) GROUP BY itemID, sortval ORDER BY sortval ASC
[1] Using template: /templates/shop/products/link_list.html
[95] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/fireworks/checkout.php' OR regionPage='*' ORDER BY regionPage DESC

The errors that catches my attention is: Invalid query: SQLSTATE[HY000]: General error: 1364 Field 'countryID' doesn't have a default value Customer or Address or Shipping missing

Checking my DB the customer/member data made it's way fine into perch2_members, perch2_member_sessions, perch2_shop_customers but nothing appears in perch2_shop_addresses

After being stuck on this for quite a while I attempted a reinstallation but got the exact same error in the end.

Here's my diagnostics report:

Perch: 2.8.31, PHP: 7.0.5-2+deb.sury.org~trusty+1, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: fd3bfdab644600c96b25beaf69d021447b7b4ec5 $, with PDO
Server OS: Linux, fpm-fcgi
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_forms (1.8.3), perch_shop_orders (1.0.8), perch_shop_products (1.0.8), perch_shop (1.0.8), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_blog', 'perch_members', 'perch_shop', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/vagrant/Code/lockstock/perch
PERCH_CORE: /home/vagrant/Code/lockstock/perch/core
PERCH_RESFILEPATH: /home/vagrant/Code/lockstock/perch/resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 100M, Memory: 512M, Total max file upload: 100M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: lockstock.dev
DOCUMENT_ROOT: /home/vagrant/Code/lockstock
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

There are no errors showing in my PHP error log.

One more thing, here's my customer_create.html template:

<perch:form id="register" method="post" app="perch_shop" type="shop" data-address-duplicate="true">

    <fieldset>
        <legend>About you</legend>
        <div class="cols">
            <div class="col-a">
                <perch:label for="first_name">First name</perch:label>
                <perch:input type="text" id="first_name" required="true" label="First name" />
                <perch:error for="first_name" type="required">Please add your name</perch:error>
            </div>

            <div class="col-b">
                <perch:label for="last_name">Last name</perch:label>
                <perch:input type="text" id="last_name" required="true" label="Last name" />
                <perch:error for="last_name" type="required">Please add your name</perch:error>
            </div>
        </div>

        <div class="col-a">
            <perch:label for="email">Email</perch:label>
            <perch:input type="email" id="email" required="true" placeholder="you@company.com" helper="PerchMembers_Members::check_email" />
            <perch:error for="email" type="required">Please add your email address</perch:error>
            <perch:error for="email" type="helper">That email address is already in use</perch:error>
        </div>

        <perch:input type="hidden" id="password" value="__auto__" />

        <div class="col-b">
            <perch:label for="telephone">Telephone</perch:label>
            <perch:input type="text" id="telephone" label="Telephone" />
        </div>

        <div class="col-a">
            <perch:label for="address_1">Address 1</perch:label>
            <perch:input type="text" id="address_1" required="true" label="Address 1" />
            <perch:error for="address_1" type="required">Please add the first line of your address</perch:error>
        </div>

        <div class="col-b">
            <perch:label for="address_2">Address 2</perch:label>
            <perch:input type="text" id="address_2" label="Address 2" />
        </div>


        <div class="col-a">
            <perch:label for="city">City</perch:label>
            <perch:input type="text" id="city" label="City" />
        </div>

        <div class="col-b">
            <perch:label for="county">County</perch:label>
            <perch:input type="text" id="county" label="County" />
        </div>

        <div class="col-a">
            <perch:label for="postcode">Postal code</perch:label>
            <perch:input type="text" id="postcode" label="Postal code" />
        </div>

        <div  class="col-b">
            <perch:label for="country">Country</perch:label>
            <perch:input type="select" options="<perch:shop id="country_list" />" value="236" id="country" label="Country" />
        </div>

    </fieldset>

<perch:if id="shipping_weight" match="gt" value="0.00">
    <fieldset>
        <legend>Shipping address</legend>

        <div class="col-a">
            <perch:label for="shipping_first_name">First name</perch:label>
            <perch:input type="text" id="shipping_first_name" label="First name" />
            <perch:error for="shipping_first_name" type="required">Please add your name</perch:error>
        </div>

        <div  class="col-b">
            <perch:label for="shipping_last_name">Last name</perch:label>
            <perch:input type="text" id="shipping_last_name" label="Last name" />
            <perch:error for="shipping_last_name" type="required">Please add your name</perch:error>
        </div>

        <div>
            <perch:label for="company">Company</perch:label>
            <perch:input type="text" id="shipping_company" label="Company" />
        </div>

        <div class="col-a">
            <perch:label for="shipping_address_1">Address 1</perch:label>
            <perch:input type="text" id="shipping_address_1" label="Address 1" />
            <perch:error for="shipping_address_1" type="required">Please add the first line of your address</perch:error>
        </div>

        <div class="col-b">
            <perch:label for="shipping_address_2">Address 2</perch:label>
            <perch:input type="text" id="shipping_address_2" label="Address 2" />
        </div>

        <div class="col-a">
            <perch:label for="shipping_city">City</perch:label>
            <perch:input type="text" id="shipping_city" label="City" />
        </div>

        <div class="col-b">
            <perch:label for="shipping_county">State or County</perch:label>
            <perch:input type="text" id="shipping_county" label="County" />
        </div>


        <div class="col-a">
            <perch:label for="shipping_postcode">Postal code</perch:label>
            <perch:input type="text" id="shipping_postcode" label="Postal code" />
        </div>

        <div class="col-b">
            <perch:label for="shipping_country">Country</perch:label>
            <perch:input type="select" options="<perch:shop id="country_list" />" value="236" id="shipping_country" label="Country" />
        </div>

    </fieldset>
</perch:if>

        <div>
            <perch:input type="submit" value="Continue" class="btn" />
        </div>


    <perch:success>
        <p>Thanks!</p>
    </perch:success>

</perch:form>
Joseph Spurling

Joseph Spurling 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are the countries displaying correctly on the registration form?

Yes. Populating fine for both country fields.

Sorry to hassle - but does anybody have any further ideas of where I could look for the problem? Totally stuck on this.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm looking into it as a priority.

Thank you

Sorry to nag... but I'm just wondering if there's perhaps a temporary workaround to this that I can use while you look into the root cause of the problem?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have a step in your checkout process where an address is selected?

No. First step is checkout.php (template in original post)... which detects if the user is logged in. If not, they are redirected to register.php (template for that in my original post). Submission of that registration form then loads the checkout after the redirect code but perch_shop_order_addresses(); has no output.

The problem is nothing gets saved in perch2_shop_addresses so I wouldn't be able to offer a choice of addresses if I wanted to.

Am I following you correctly?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'll try again to reproduce it.

Hi Drew. Is there anything I can do to help you with reproducing/diagnosing the issue? I'm very keen to get this sorted.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Not yet - but I'll let you know if that's the case.

Hi,

I believe I have seen this, but only on my 'localhost' machine. I'm still in the early stages of playing with the Shop but

                if (!perch_shop_addresses_set()) {
                    perch_shop_order_address_form();
                }

is returning just the two <h4> headings for billing and shipping address without any details or radio buttons on the default template. The user was created with the shop user creation form and both addresses set. The other difference between the localhost dev machine and the staging environment where the user addresses were stored is that the redirection to paypal at the checkout didn't work (I didn't have PHP cUrl installed).

Drew McLellan

Drew McLellan 2638 points
Perch Support

Could you run this query and let me know what it outputs?

DESCRIBE perch2_shop_addresses;

Here is my output for DESCRIBE perch2_shop_addresses;

Field Type Null Key Default Extra addressID int(10) unsigned NO PRI NULL auto_increment

addressTitle char(128) YES Default

addressSlug char(128) YES default

addressFirstName char(128) NO

addressLastName char(128) NO

addressCompany char(128) NO

addressLine1 char(255) NO

addressDynamicFields mediumtext YES NULL

addressCreated datetime NO 2015­01­01 00:00:00

addressUpdated datetime NO 2015­01­01 00:00:00

addressDeleted datetime YES NULL

customerID int(10) unsigned NO MUL 0

countryID int(10) NO NULL

regionID int(10) YES NULL

orderID int(10) unsigned YES NULL

Mine too, in case it helps:

Field   Type    Null    Key Default Extra
addressID   int(10) unsigned    NO  PRI NULL    auto_increment
addressTitle    char(128)   YES     Default 
addressSlug char(128)   YES     default 
addressFirstName    char(128)   NO          
addressLastName char(128)   NO          
addressCompany  char(128)   NO          
addressLine1    char(255)   NO          
addressDynamicFields    mediumtext  YES     NULL    
addressCreated  datetime    NO      01/01/2015 00:00    
addressUpdated  datetime    NO      01/01/2015 00:00    
addressDeleted  datetime    YES     NULL    
customerID  int(10) unsigned    NO  MUL 0   
countryID   int(10) NO      NULL    
regionID    int(10) YES     NULL    
orderID int(10) unsigned    YES     NULL    
Drew McLellan

Drew McLellan 2638 points
Perch Support

Thanks Joseph. Can you run this and try the problem again?

ALTER TABLE `perch2_shop_addresses` CHANGE `countryID` `countryID` INT(10)  NULL  DEFAULT NULL;

Hi Drew,

Sorry to jump on the thread but I was seeing the same errors. I ran the ALTER table query above and that seems to have solved my issue (the countryID error message has gone and I was successfully redirected to my success url after a Stripe checkout)

Works for me too

The good news: that worked, in that it fixed the issue with creating customers.

The bad news: I have a new (possibly related?) problem now. Although customer details are created fine (and displayed fine in the checkout), I am getting redirected to a blank results page (here's the template:)

<?php
// Has the order been succcessfully placed?
if (perch_shop_order_successful()) {

// Yes! Show a success message
perch_content('Order successful');

// Redisplay the details of the order
perch_shop_order_items(
perch_shop_successful_order_id()
);

perch_shop_empty_cart();

} else {
// Payment problem! Show instructions to the customer
perch_content('Payment not successful');
}
?>

Here's the debug output on the cart page:

Debug Message
[1] SELECT * FROM perch2_members_sessions WHERE sessionID='d2883f3f656db78f1f22682cf85855efc44f7a1b' AND sessionHttpFootprint='316c23625758ad96219b5e71f2a652e15ad5a3bc' AND sessionExpires>'2016-10-04 14:11:01' LIMIT 1
User is logged in
[1] SELECT * FROM perch2_pages WHERE pagePath='/fireworks/result.php' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=6512
[1] SELECT * FROM perch2_shop_cart WHERE cartID=6512
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
[1] SELECT * FROM perch2_shop_orders WHERE orderID=9 AND orderDeleted IS NULL LIMIT 1
Is paid?
[98] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/fireworks/result.php' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT * FROM perch2_shop_orders WHERE orderID=9 AND orderDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_customers WHERE memberID=15
[0] SELECT statusKey FROM perch2_shop_order_statuses WHERE statusDeleted IS NULL ORDER BY statusIndex ASC
SELECT * FROM perch2_shop_orders WHERE customerID=15 AND orderID=9 AND orderStatus IN ()
Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 4
DELETE FROM perch2_shop_cart WHERE cartID='6512'
------------------------------ Calculating cart ------------------------------
[1] SELECT * FROM perch2_shop_cart WHERE cartID=0
[1] SELECT * FROM perch2_shop_cart WHERE cartID=0
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=0 AND locationDeleted IS NULL LIMIT 1
[1] SELECT locationID FROM perch2_shop_tax_locations WHERE locationIsHome=1 LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID=0 LIMIT 1
[34] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 AND currencyID=47
[1] SELECT COUNT(productID) AS product_count, SUM(itemQty) AS item_count FROM perch2_shop_cart_items WHERE cartID=0
Tax mode: inc
[nil] SELECT * FROM perch2_shop_cart_items WHERE cartID=0 ORDER BY itemID ASC
[1] SELECT locationID FROM perch2_shop_tax_locations WHERE locationIsHome=1 LIMIT 1
INSERT INTO perch2_shop_cart(memberID,locationID,currencyID,cartPricing,cartProperties) VALUES('15','1',47,'standard','[]')
[1] SELECT * FROM perch2_shop_cart WHERE cartID=6514
------------------------------ Calculating cart ------------------------------
[1] SELECT * FROM perch2_shop_cart WHERE cartID=6514
[1] SELECT * FROM perch2_shop_cart WHERE cartID=6514
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1
[1] SELECT locationID FROM perch2_shop_tax_locations WHERE locationIsHome=1 LIMIT 1
[1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1
[1] SELECT * FROM perch2_shop_customers WHERE memberID=15
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID=47 LIMIT 1
[1] SELECT COUNT(productID) AS product_count, SUM(itemQty) AS item_count FROM perch2_shop_cart_items WHERE cartID=6514
Tax mode: inc
[nil] SELECT * FROM perch2_shop_cart_items WHERE cartID=6514 ORDER BY itemID ASC
Using template: /templates/shop/cart/mini.html
[1] SELECT setID FROM perch2_category_sets WHERE setSlug='fireworks' LIMIT 1
[9] SELECT main.* FROM perch2_categories main WHERE 1=1 AND (catSlug!='best-sellers') AND setID=4 ORDER BY catTreePosition ASC
[9] Using template: /templates/categories/list.html
[3] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='_category' AND idx.indexValue LIKE 'fireworks/best-sellers%' OR idx.indexKey='_category' AND idx.indexValue='fireworks/best-sellers'))
[26] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='status' AND idx.indexValue='1')) GROUP BY idx.itemID HAVING COUNT(idx.itemID)=1
[26] SELECT DISTINCT idx.itemID FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' AND ((idx.indexKey='parentID' AND idx.indexValue='')) GROUP BY idx.itemID HAVING COUNT(idx.itemID)=1
[3] SELECT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' JOIN perch2_shop_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='productID' AND idx2.indexKey='title' AND idx.itemID IN ('12', '4', '18') AND idx.itemID IN ('1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '3', '4', '5', '6', '7', '8', '9') AND idx.itemID IN ('1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '3', '4', '5', '6', '7', '8', '9') WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (productDeleted IS NULL) GROUP BY itemID, sortval ORDER BY sortval ASC
[3] Using template: /templates/shop/products/link_list.html

And here's the debug output when looking at the "manage orders" page in the Perch admin:


Debug Message [1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='3b8356ca320c576bca6b985126153b18' LIMIT 1 UPDATE perch2_users SET userHash='868c1a86d0894463cfccb9efec235db7' WHERE userID='1' [77] SELECT p.privKey FROM perch2_user_privileges p [34] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID [0] SELECT statusKey FROM perch2_shop_order_statuses WHERE statusDeleted IS NULL ORDER BY statusIndex ASC SELECT SQL_CALC_FOUND_ROWS DISTINCT o.*, c.*, CONCAT(customerFirstName, " ", customerLastName) AS customerName FROM perch2_shop_orders o, perch2_shop_customers c WHERE o.customerID=c.customerID AND o.orderDeleted IS NULL AND o.orderStatus IN () ORDER BY o.orderCreated DESC LIMIT 0, 24 Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ORDER BY o.orderCreated DESC LIMIT 0, 24' at line 5 [0] SELECT FOUND_ROWS() AS `count` Queries: 7 Memory: 3.6526 Array ( [type] => 8 [message] => Use of undefined constant PERCH_SHOP_VERSION - assumed 'PERCH_SHOP_VERSION' [file] => /var/www/vhosts/lockstock.biz/httpdocs/perch/addons/apps/perch_shop_products/admin.php [line] => 3 )
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you go to the Shop app, and then Statuses and let me know what you see?

There should be a list of about 9 statuses from Created to Refunded.