Forum

Thread tagged as: Question, Shop

Product Tags not saving with Perch Shop

I'm adding a few products to a test site running Perch shop. When I add Product Tags, they are seemingly not being saved. I was expecting to see Tags listed for each product after I ‘add’ a Tag using the repeater region in the Tags tab. Instead, I get the green 'success' message but no Tags listed. Should I be seeing Tags listed?

This is a local site using MAMP Pro.

My short diagnostics report

Perch Runway: 2.8.29, PHP: 5.4.42, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
Server OS: Darwin, cgi-fcgi
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), dh_ga (1), perch_blog (5.0), perch_forms (1.8.3), perch_gallery (2.8.6), perch_shop_orders (1.0.3), collection_3 (2.8.29), perch_shop_products (1.0.3), perch_shop (1.0.3), collection_2 (2.8.29), collection_1 (2.8.29), perch_members (1.5), perch_mailchimp (3.0.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_gallery', 'perch_forms', 'perch_mailchimp', 'perch_members', 'perch_shop', ); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/clivewalker/Documents/OneDrive/Documents/Websites/Websites A-D/CVW Web Design 2016/perch
PERCH_CORE: /Users/clivewalker/Documents/OneDrive/Documents/Websites/Websites A-D/CVW Web Design 2016/perch/core
PERCH_RESFILEPATH: /Users/clivewalker/Documents/OneDrive/Documents/Websites/Websites A-D/CVW Web Design 2016/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /Users/clivewalker/Documents/OneDrive/Documents/Websites/Websites A-D/CVW Web Design 2016
HTTP_HOST: cvwoutline.local
Clive Walker

Clive Walker 22 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You should.

Do you get any errors in debug? Was this a clean install of 1.0 or higher and not an update from a beta?

It's a clean install of Shop 1.0.3

Debug output after entering a tag:

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='bebc4691a46968a5d24017d9a75164d1' LIMIT 1
UPDATE perch2_users SET userHash='8f3577d1d497537bbd219fd63d8806f7' WHERE userID='1'
[52] SELECT p.privKey FROM perch2_user_privileges p
[102] 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
[3] SELECT collectionID, collectionKey, collectionEditRoles FROM perch2_collections WHERE collectionInAppMenu=1 ORDER BY collectionOrder ASC
[1] SELECT * FROM perch2_shop_products WHERE productID='1' AND productDeleted IS NULL LIMIT 1
Using template: /templates/shop/products/tags.html
Array
(
    [productDynamicFields] => {"tags":[{"tag":"downloads","expiry":{"_default":"+1 MONTHS","count":"1","unit":"MONTHS"},"id":null}]}
)
[0] SELECT prodtagID FROM perch2_shop_product_tags WHERE productID=1 AND tagDeleted IS NULL
Array
(
    [tag] => downloads
    [expiry] => Array
        (
            [_default] => +1 MONTHS
            [count] => 1
            [unit] => MONTHS
        )

    [id] => 
)
[1] SELECT * FROM perch2_members_tags WHERE tag='downloads' LIMIT 1
INSERT INTO perch2_members_tags(tag,tagDisplay) VALUES('downloads','downloads')
[1] SELECT * FROM perch2_members_tags WHERE tagID='1' LIMIT 1
No ids to log.
INSERT INTO perch2_shop_product_tags(productID,tagID,tagExpiry,tagOrder,tagDynamicFields) VALUES('1','1','+1 MONTHS',1,'{\"tag\":\"downloads\",\"expiry\":{\"_default\":\"+1 MONTHS\",\"count\":\"1\",\"unit\":\"MONTHS\"},\"id\":null}')
[1] SELECT * FROM perch2_shop_product_tags WHERE prodtagID='1' LIMIT 1
No ids to log.
[1] SELECT * FROM perch2_shop_product_tags WHERE productID=1 AND tagDeleted IS NULL ORDER BY tagOrder ASC
Queries: 14
Memory: 4.8181
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you edited the template at all?

No. I've copied the templates into /perch/templates/shop but have not edited any templates. Here is my /shop/products/tag.html template:

<!--* Don't change this repeater - it's needed for editing tags. *-->
<perch:repeater id="tags" label="Tags" divider-before="Apply these tags on purchase">
    <perch:shop id="tag" type="text" label="Tag" />
    <perch:shop id="expiry" type="period" label="Expiry" default-unit="months" />
    <perch:shop id="id" type="editcontrol" edit-control="true" />
</perch:repeater>
<!--* / don't change *-->
Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't get this to fail in development - it's all working nicely. Is there anything else you can tell me?

I'm at a loss. But I can change a few things in the dev site. This isn't a PHP version issue is it?

The site is a copy of my live Runway site at https://www.cvwdesign.co.uk (which doesn't have Shop installed). I copied the database to the dev site. Then, installed Shop. So, it was a clean Shop install but not a clean Perch install...but that shouldn't be a problem should it?

My live site was originally a Perch site which I upgraded to Runway some time ago.

Is that any help?

Otherwise, I will install latest Shop update, test again. Failing that, I will set up another site with a completely clean install of everything.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That should be fine. Are repeaters working elsewhere?

I don't actually have any repeaters on the site. But, I do have a template with a repeater (not currently used) so I can set-up a new region with that. Do you know of a bug that would cause repeaters to fail? I can test for that if Yes.

I have tested a repeater on a different content section of the site and it works fine.

I have updated the shop to 1.0.4 and my product tag is listed! Was something changed in 1.0.4 that would affect this?

Regardless, have added another tag and it is working.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, there's nothing that should have affected that.

Not really sure why it's working now tbh but please mark this thread solved. Thanks for looking into this.

I had this issue last night

But once I added a member using the members app the tags then saved in the shop

Odd but it now works