Forums / Setting Up Categories, Products, Attributes / customizing: Empty cart and redirect back to products listing page

customizing: Empty cart and redirect back to products listing page

Views: 1,325

Results 1 to 6 of 6
1 Jun 2012, 7:26 PM
#1
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

customizing: Empty cart and redirect back to products listing page

Hi I saw this http://www.zen-cart.com/showthread.php?72509-Redirect-if-Shopping-Cart-is-Empty which give SOME information on how to empty the shopping cart and put a redirect in place once empty.

I would like to do a similar thing to this only redirect back to the product listings page. It says in the post I've put a link to use if the $_SESSION['cart']->count_contents() is 0 in modules/pages/shopping_cart/header_php.php

However how would I write this and have it link back to the product listing url?

Thanks

Nick

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

2 Jun 2012, 3:05 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: customizing: Empty cart and redirect back to products listing page

What is the sequence to get to the shopping_cart that the content is 0 and what product listing are you wanting to get back to?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

3 Jun 2012, 12:07 PM
#3
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: customizing: Empty cart and redirect back to products listing page

Hi Linda thanks for replying. I'll fill you in on what I'm trying to achieve.

Basically I have set up my cart to show attributes on the product listing. Please see the attached document.

There's two listings set up, 'Primary Domestic Listing' and 'Primary Commercial listing'.

If somebody selects an attribute from 'Primary Domestic Listing' then they can't be allowed to select and attribute from 'Primary Commercial listing' and the same the other way round. Also the first attribute dropdown needs to be selected before they can select anything from the attribute dropdowns below them. So you will see on my image the first dropdowns are 'PLEASE SELECT YOUR DOMESTIC LISTING' and 'PLEASE SELECT YOUR PRIMARY COMMERCIAL LISTING', these must be selected before anything else and once one of these is selected then the user cannot select from the listing opposite.

Also because the product listings have attributes on them then the quantity is always one. This also means that the product can be added to the cart without any attributes selected, which I don't want to happen. I figured that one way around this would be to show up an error message over the top of the cart something like 'You have not made a selection, please go back and amend your order' with a button for them to click going back to the previous page and emptying the cart at the same time. Otherwise when they add another item to the cart, the product which was previously added with no attributes selected would stay in the cart. I also need to show which attributes have been selected in the shopping cart page.

Another way around this would be to allow each attribute to have a quantity value of one, rather than having a quantity box. Not sure if this can be achieved though.

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

3 Jun 2012, 1:54 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: customizing: Empty cart and redirect back to products listing page

Sorry, but you are doing quite a bit of custom code that is not part of Zen Cart and that makes figuring this out a lot more difficult trying to envision the code changes and the effects of them ...

Perhaps someone else can get a handle on this or a peek at your site to see it in action so far might help someone work out what you are trying to do ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

3 Jun 2012, 3:02 PM
#5
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: customizing: Empty cart and redirect back to products listing page

I think I've worked it out, see what you think to this?

I can use the older addons for v1.3.9 by downgrading to v1.3.9 from v1.5.0

Then install (the 1.3.9 version of) Options on Product Listing v2.0 to display attributes on the product listing.

And install (the v1.3.9 version of) Stock by attributes so I can apply stock values to each attribute and apply zero stock values to options that I don't want selectable forcing the user to select from each dropdown.

And install (the v1.3.9 version of) Dynamic DropDowns for Stock by attributes to make attributes only selectable when the main attribute is selected.

Do you think this would this work?

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

20 Jun 2012, 5:13 PM
#6
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: customizing: Empty cart and redirect back to products listing page

Please can somebody tell me if query strings are used to pass a value to the shopping cart? And also what value pairs are used?

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk