[Skip to main content](#vessel-content)

#   Help with persistent anonymous cart

##

- **[tonytaylor](/forum/user/35734-tonytaylor "View tonytaylor's Profile")**
- [![tonytaylor's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35734-tonytaylor "View tonytaylor's Profile") Topic Author
- [ Offline](/forum/user/35734-tonytaylor)

Less More

- Posts: 6
- Thank you received: 0
-
-

11 years 9 months ago [\#190658](#190658) by [tonytaylor](/forum/user/35734-tonytaylor "View tonytaylor's Profile")  *[Help with persistent anonymous cart](/forum/31-development/874973-help-with-persistent-anonymous-cart#190658 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Chrome 40.0.2214.111  I should probably provide a bit of context.  One of our requirements is to store a comment per cart and per product item. Our client has expressed that THEY DO NOT WANT USERS TO LOGIN (If so, we could have made use of the wishlist). With that requirement and constraint, we decided to augment the cart itself since guest carts were available and I began to build a plugin that would, at least for product items, fulfill that requirement (called a 'wishcart'). I created a hikashop 'view' to be added to the checkout workflow. I also set the $go&#95;back to true in onAfterCheckoutStep - this essentially created an anonymous persistent cart which is what our client desired. I also overrode the checkout/cart.php to:  1. add a textarea for note capture 2. perform a query that would set the value of the textarea to the note previously entered - of course, only if our custom table exists and there was a note found for the cart product item. 3. 'repurposed' the quantity update icon to submit the form (I just removed the condition where the input value had to be different from the last known product quantity)  I got the plugin to a stable working state in a local sandbox and of course, when installing on a live server, things got a bit strange. So now when the form submits, the checkout process appears to be completed (we receive a message saying &quot;Thanks for your purchase&quot;), but there is a sidebar cart module as well and that remains, so I know the cart hasn't been removed and the checkout process hasn't completed. This was a strange requirement to begin and I think I'm more confused than I ever was. I can provide back-end / ftp info is that will help you diagnose things.  Thanks in advance,  Tony")* was created by *[tonytaylor](/forum/user/35734-tonytaylor "View tonytaylor's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Chrome 40.0.2214.111

I should probably provide a bit of context.

One of our requirements is to store a comment per cart and per product item. Our client has expressed that THEY DO NOT WANT USERS TO LOGIN (If so, we could have made use of the wishlist). With that requirement and constraint, we decided to augment the cart itself since guest carts were available and I began to build a plugin that would, at least for product items, fulfill that requirement (called a 'wishcart'). I created a hikashop 'view' to be added to the checkout workflow. I also set the $go_back to true in onAfterCheckoutStep - this essentially created an anonymous persistent cart which is what our client desired. I also overrode the checkout/cart.php to:

1. add a textarea for note capture
2. perform a query that would set the value of the textarea to the note previously entered - of course, only if our custom table exists and there was a note found for the cart product item.
3. 'repurposed' the quantity update icon to submit the form (I just removed the condition where the input value had to be different from the last known product quantity)

I got the plugin to a stable working state in a local sandbox and of course, when installing on a live server, things got a bit strange. So now when the form submits, the checkout process appears to be completed (we receive a message saying "Thanks for your purchase"), but there is a sidebar cart module as well and that remains, so I know the cart hasn't been removed and the checkout process hasn't completed. This was a strange requirement to begin and I think I'm more confused than I ever was. I can provide back-end / ftp info is that will help you diagnose things.

Thanks in advance,

Tony

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NDk3My1oZWxwLXdpdGgtcGVyc2lzdGVudC1hbm9ueW1vdXMtY2FydD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[tonytaylor](/forum/user/35734-tonytaylor "View tonytaylor's Profile")**
- [![tonytaylor's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35734-tonytaylor "View tonytaylor's Profile") Topic Author
- [ Offline](/forum/user/35734-tonytaylor)

Less More

- Posts: 6
- Thank you received: 0
-
-

11 years 9 months ago [\#190666](#190666) by [tonytaylor](/forum/user/35734-tonytaylor "View tonytaylor's Profile")  Replied by *[tonytaylor](/forum/user/35734-tonytaylor "View tonytaylor's Profile")* on topic *[Help with persistent anonymous cart](/forum/31-development/874973-help-with-persistent-anonymous-cart#190666 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Chrome 40.0.2214.111  I should probably provide a bit of context.  One of our requirements is to store a comment per cart and per product item. Our client has expressed that THEY DO NOT WANT USERS TO LOGIN (If so, we could have made use of the wishlist). With that requirement and constraint, we decided to augment the cart itself since guest carts were available and I began to build a plugin that would, at least for product items, fulfill that requirement (called a 'wishcart'). I created a hikashop 'view' to be added to the checkout workflow. I also set the $go&#95;back to true in onAfterCheckoutStep - this essentially created an anonymous persistent cart which is what our client desired. I also overrode the checkout/cart.php to:  1. add a textarea for note capture 2. perform a query that would set the value of the textarea to the note previously entered - of course, only if our custom table exists and there was a note found for the cart product item. 3. 'repurposed' the quantity update icon to submit the form (I just removed the condition where the input value had to be different from the last known product quantity)  I got the plugin to a stable working state in a local sandbox and of course, when installing on a live server, things got a bit strange. So now when the form submits, the checkout process appears to be completed (we receive a message saying &quot;Thanks for your purchase&quot;), but there is a sidebar cart module as well and that remains, so I know the cart hasn't been removed and the checkout process hasn't completed. This was a strange requirement to begin and I think I'm more confused than I ever was. I can provide back-end / ftp info is that will help you diagnose things.  Thanks in advance,  Tony")*

Nevermind ![B)](/media/kunena/emoticons/9.png "B)")

Found the error - it was in the template.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NDk3My1oZWxwLXdpdGgtcGVyc2lzdGVudC1hbm9ueW1vdXMtY2FydD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.056 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
