| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How to change the look of Add to cart section in X-Cart Next | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
How to change the look of Add to cart section in X-Cart Next
Hi guys!
One of our clients asked to give an example of how to change the appearance of Add to cart section in X-Cart Next front-end and I decided to write publicly about how it can be done. I am sure, it will be useful for someone else. More precisely the task was to:
1. Choose your identifiers Before you start you need to choose your identifier as a company/developer (Tony in my case) and identifier of your module (CartCorrections in my case) 2. Create basic module file After the identifiers are chose, you should create Main.php file in the following folder: <XCN>/classes/XLite/Module/<DEVELOPER-ID>/<MODULE-ID>/ So, I am creating the following file: <XCN>/classes/XLite/Module/Tony/CartCorrections/Main.php with the following content: Code:
After that, this module will appear in your Installed Modules section in Admin area after you rebuild the cache. 3. Change Add to bag button In order to apply this change we will replace the existing implementation of Add to bag button with the one we want. For that we are adding the following function into the Main.php file: Code:
This function removes the current implementation of Add to bag button. To add new implementation of Add to bag button, we are creating the following template: <XCN>/skins/default/en/modules/Tony/CartCorrections/product/details/parts/ with the content: PHP Code:
Specifying @ListChild tells X-Cart Next to assign this template to the certain part of product page and product quicklook, so even this assignment is in comments, this is a mandatory part. 4. Change Buy more button and link it to Checkout page. It's quite similar to the task above. We are adding couple of function calls into the runBuildCacheHandler method: PHP Code:
and adding new template <XCN>/skins/default/en/modules/Tony/CartCorrections/product/details/parts/common.button-buymore.tpl with the following content: PHP Code:
The most interesting part here is how checkout URL is built. 5. Change This product has been added to your bag text It's really simple, since it almost copies the points above. We are adding new function calls to runBuildCacheHandler method. PHP Code:
and adding new template <XCN>/skins/default/en/modules/Tony/CartCorrections/product/details/parts/common.product-added.tpl with the following content: PHP Code:
Conclusion Now, we are all done. Just in case, I've uploaded the mod to dropbox: https://dl.dropboxusercontent.com/u/23858825/Tony-CartCorrections-v1_2_0.tar If you have any questions, feel free to pm me or ask in the thread. Tony. Last edited by tony_sologubov : 08-02-2013 at 04:22 AM. |
|||||||||
|
#2
|
|||||||||
|
|||||||||
Re: How to change the look of Add to cart section in X-Cart Next
Thank you Tony. XCN is so different that we all need a lesson of the code QT is writing and the way to implement changes....
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#3
|
|||||||||
|
|||||||||
Re: How to change the look of Add to cart section in X-Cart Next
Happy to be helpful, Steve.
I am planning to add more examples over time. If you want to see some particular examples, leave the requests here or pm me. In fact, I want to give the most examples community need, so you can at least assess how to work with X-Cart Next. |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: How to change the look of Add to cart section in X-Cart Next
Do we have a download version for 1.2 to implement by ourselves these examples?
__________________
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 |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: How to change the look of Add to cart section in X-Cart Next
@ADDISON
Dev version of X-Cart Next is available to all partners via partner area. If you don't have one, email me at developers@x-cart.com and I'll create it for you. |
|||||||||
#6
|
|||||||
|
|||||||
Re: How to change the look of Add to cart section in X-Cart Next
Tony,
Thank you so much for the above information! Its greatly helpful! I ran into a quark when rebuilding the cache, its still stuck and has been for 30 mins now. Not sure what to do . It says: Re-building cache [step 4 of 5], please wait... Run the "Doctrine_Plugin_UpdateSchema" plugin... [2.14sec, 48.8MB (28.3MB)] Run the "Doctrine_Plugin_UpdateModules" plugin... thanks!
__________________
by LiteCommerce 3 integrated with Drupal. LC Core version 1.0.24 |
|||||||
#8
|
|||||||
|
|||||||
Re: How to change the look of Add to cart section in X-Cart Next
Thank you again, restoring the Main.php file worked fine. thanks!
__________________
by LiteCommerce 3 integrated with Drupal. LC Core version 1.0.24 |
|||||||
|
|||
X-Cart forums © 2001-2020
|