Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Continue Shopping -> Redirect to product

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-24-2011, 12:13 PM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Continue Shopping -> Redirect to product

Let's enable in General Settings -> Redirect customer to cart after adding a product.

If you want to come back to the product you just added to cart, after pressing Continue Shopping, do the following modifications:

In XC 4.4.2 root find product.php. At the end of the file, before:

Code:
func_display('customer/home.tpl', $smarty);

add the following code lines:

Code:
define('STORE_NAVIGATION_SCRIPT', 'Y'); $smarty->assign('navigation_script', 'product.php?productid=' . $productid);

We can go further adding in General Settings a check box: Redirect to product page.

if (redirect to cart enabled && redirect to productpage enabled)
pressing Continue Shopping go back to product page

Lots of information about Continue Shopping button here: http://www.getelastic.com/4-ways-continue-shopping
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote

The following user thanks ADDISON for this useful post:
chamberinternet (01-24-2011)
  #2  
Old 03-15-2012, 02:28 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Continue Shopping -> Redirect to product

Hi,
Thanks for your codes.

If I want to go to the current page suppose in category or in manufacturer page what will be the code for x cart pro 4.4.2 Pro?
__________________
4.6.1 Platinum


Reply With Quote
  #3  
Old 03-15-2012, 02:45 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: Continue Shopping -> Redirect to product

This is the place you should make the changes:

$smarty->assign('navigation_script', 'product.php?productid=' . $productid);

that productid has associated a categoryid and a manufacturerid. Change product.php with category.php ...

I don't see it relevant to go in Manufacture page after pushing continue shopping button.

Quote:
Originally Posted by Learner
Hi,
Thanks for your codes.

If I want to go to the current page suppose in category or in manufacturer page what will be the code for x cart pro 4.4.2 Pro?
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #4  
Old 03-15-2012, 04:15 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

Default Re: Continue Shopping -> Redirect to product

Hi,
It will not work for me...
__________________
4.6.1 Platinum


Reply With Quote
  #5  
Old 03-15-2012, 04:18 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: Continue Shopping -> Redirect to product

What did you use for replacing this 'product.php?productid=' . $productid"?

Here is what QT replied inside the bugtracker (http://bugtracker.qtmsoft.com/view.php?id=38084)

*****************
As a result of discussion it was decided to implement this as follows:

- customer adds a product from the home page -> it redirects him to home page
- customer adds a product from the search results page -> it redirects him to the same search results (with page number and search conditions as it was before)
- customer adds a product from the category page -> it redirects him to that category (page number is kept)
- customer adds a product from the product details page -> it redirects him to home, category, or search results page the customer was browsing last time

We do not see any reason to forward a customer to the same product page when click on the Continue shopping button. That product is already in cart.
*****************

My personal opinion is X-Cart should let the administrator to decide from a few options where to redirect the customer.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #6  
Old 03-23-2012, 12:43 PM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: Continue Shopping -> Redirect to product

Wouldn't just replacing the onclick javascript code from

Code:
onclick="javascript: self.location = '/DEVELOPMENT/xcart/home.php?cat=7&sort=orderby&sort_direction=0'; if (event) event.cancelBubble = true;">
to
Code:
onclick="javascript:history.back()"
for the continue shopping button?

I'm sure sure what your button code is exactly in the version you are using but it worked great in 4.1.8 and I was going to edit it in my 4.4.5 test version as well to see if it works.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #7  
Old 03-23-2012, 12:54 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Continue Shopping -> Redirect to product

Quote:
onclick="javascript:history.back()"

This actually is not good as in some cases will not work as intended. For example - customer adds to cart and then logs out or session expires. Customer logs in again and XC will redirect him/her to the cart because cart is not empty (default XC behaviour). Customer hits the "continue shopping" button - using the js history function customer will be redirected back to the login screen - not good at all.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #8  
Old 03-26-2012, 04:35 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: Continue Shopping -> Redirect to product

That is a very good point. Didn't think of that at all.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #9  
Old 11-20-2012, 06:54 AM
 
modibaba modibaba is offline
 

Senior Member
  
Join Date: Mar 2008
Location: UK
Posts: 108
 

Default Re: Continue Shopping -> Redirect to product

I am on 4.1.9 and I tried the way ADDISON mentioned here but did not work, can you please help... thanks
__________________
X-Cart DB Version: 4.1.9 GOLD

Addons:
Amazon skin;
Fancy Categories;
Magnifier (enabled);
Survey (enabled);
CDSEO Pro;
Category SEO Map;
One Page Checkout;
Greet Visitor;
On_Sale;
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:59 AM.

   

 
X-Cart forums © 2001-2020