Post by alexts » Sat Feb 13, 2010 1:09 am

I would like to display "Product already in cart"message next to "add to cart" button if product is already in cart.
I know that I have to edit product.php and pass the variable to product.tpl
I just have no idea how to check cart content from product.php file.
I was wondering if anybody can help me out.

I hope I make sense.
Last edited by i2Paq on Sun Feb 14, 2010 9:29 pm, edited 1 time in total.
Reason: Topic moved]

New member

Posts

Joined
Wed Jan 13, 2010 12:45 am

Post by Qphoria » Sat Feb 13, 2010 1:17 am

Here you go. vQmod attached
When visiting the product page, if the item is already in the cart, it will show a popup saying that it is already in the cart

Attachments

Works for 1.5.x and 2.x


OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by alexts » Sat Feb 13, 2010 1:28 am

Thank you very much

New member

Posts

Joined
Wed Jan 13, 2010 12:45 am

Post by arqueologomusical » Fri Jan 22, 2016 9:14 am

Can this be used in Opencart 2.0.1 ??

I need this also as i would be selling unique products, and sometimes people don't realize they have added the product already and error would occur when checking out.


Posts

Joined
Fri Jan 22, 2016 9:13 am

Post by Qphoria » Sat Jan 23, 2016 4:23 am

arqueologomusical wrote:Can this be used in Opencart 2.0.1 ??

I need this also as i would be selling unique products, and sometimes people don't realize they have added the product already and error would occur when checking out.
I've updated code to work on 1.5.x and 2.x and created as vQmod

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by arqueologomusical » Sat Jan 23, 2016 6:59 am

Qphoria wrote:
arqueologomusical wrote:Can this be used in Opencart 2.0.1 ??

I need this also as i would be selling unique products, and sometimes people don't realize they have added the product already and error would occur when checking out.
I've updated code to work on 1.5.x and 2.x and created as vQmod

I downloaded and uploaded the code to my xml folder. do i need to do something else? tried it but dosn't work.

just wondering, in your xml file, the theme its marked as

theme/*/template

do i need to edit that or that is for the currenty theme set?

thank you in advance


Posts

Joined
Fri Jan 22, 2016 9:13 am

Post by Qphoria » Sun Jan 24, 2016 12:49 am

No need to edit. It uses wildcards. Any errors in the vqmod/logs folder?

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by arqueologomusical » Mon Jan 25, 2016 1:44 pm

Qphoria wrote:No need to edit. It uses wildcards. Any errors in the vqmod/logs folder?
I just re-checked, and it partially works but not as desired.

If i enter directly to the product page, and ALERT will say "Product already in cart" if i had in the cart already, but i can still click on the button to add to cart and it keeps adding more.

Also, if i click on the "add to cart" button , whether if its from the catalog view, latest, specials, manufacturers,.. all the pages where the product shows up i can "add to cart" as many times as i want, and keeps going on.

Any ideas how could i

- have this checked from every page where the product displays (catalog, latest, specials, by manufacturer, related)-
- avoid "adding the product" to cart, once its in cart, perhaps "disabling" the button ?


Posts

Joined
Fri Jan 22, 2016 9:13 am

Post by Bastians » Mon Oct 02, 2017 9:53 pm

Hi,
First off Qphoria thanks for the vqmod system!
I would like to change the "add to cart" button to "in cart" for each individual product on the catagory page.
I've tried editing the supplied vqmod, but when i refresh the category page it's showing "in cart" for all products when a single product is in cart, while the catalog/view/theme/*/template/product/category.tpl has a foreach ($products as $product) and it should validate each cart item per product in the catalog.
Is the code in the catalog/controller/product/category.php causing this problem?
I was wondering if anybody can provide advice or a working edited vqmod, how to implement this for the category view.
Thanks in advance!

Attachments


Newbie

Posts

Joined
Sun Oct 01, 2017 2:14 am

Post by Bastians » Tue Oct 10, 2017 6:49 pm

Bastians wrote:
Mon Oct 02, 2017 9:53 pm
I've finally figured how to acquire my goal.
VQmod attached.

Attachments


Newbie

Posts

Joined
Sun Oct 01, 2017 2:14 am
Who is online

Users browsing this forum: No registered users and 8 guests