X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Global Variable (https://forum.x-cart.com/showthread.php?t=57861)

thygtd 02-01-2011 09:16 PM

Global Variable
 
Hi, Everyone

I need to create the Global Variable to access in all over the xcart pages. This values can be control from Admin side, because the values can be changed dynamically by administrator. Please suggest how to implement this.

Thanks

qualiteam 02-04-2011 06:08 AM

Re: Global Variable
 
You can add a new option to the "xcart_config" table.

It will automatically appear in the X-Cart admin backend and will be available in both PHP code and templates (e.g. $config['General']['your_option_name'] & {$config.General.your_option}).

Check the "<xcart_dir>/sql/xcart_data.sql" file for sample INSERT SQL commands.

thygtd 02-04-2011 12:04 PM

Re: Global Variable
 
Alex,

My customer asked me to add common extra amount to all products. So i asked this global variable. I have added this extra values to the product which are displaying. But i have getting problem with mini cart and cart page. I cannot able to identify where i need to add this common values to calculate the price. can u please suggest me how to get this calculated values from beginning to end.

Thanks

thygtd 02-07-2011 08:34 AM

Re: Global Variable
 
Hi,
Anyhelp? The xcart is for a jewelery shop. The client will be changing the products' price according to silver's market price. The price will be updated twice a day. So he needs to input the market price & makeover charges in one place at admin and the prices should change accordingly. Can somebody help with this? we need to finish this fast. Very urgent. Any help would be appreciated and Thanks in advance.

geckoday 02-08-2011 06:43 AM

Re: Global Variable
 
It sounds like you might be better off setting this up as a tax with the tax set to be displayed in the product price. See the manual on setting up taxes.

thygtd 02-08-2011 10:52 AM

Re: Global Variable
 
Quote:

Originally Posted by qualiteam
You can add a new option to the "xcart_config" table.

It will automatically appear in the X-Cart admin backend and will be available in both PHP code and templates (e.g. $config['General']['your_option_name'] & {$config.General.your_option}).

Check the "<xcart_dir>/sql/xcart_data.sql" file for sample INSERT SQL commands.


Hi,
We followed your idea. Currently its working fine. But a problem occurs on mini cart and cart pages. The values added are not multiplied with no. of products added to cart. Can u shed some light on that? It would be great if u point us where the calculation(taxed price X quantity) is made. Thanks in advance.

geckoday 02-09-2011 06:54 AM

Re: Global Variable
 
I don't run 4.4.1 so I can't test it on my setup but I did try it out on the X-Cart demo site and taxes are properly multiplied by the number of items and show properly in the extended product price mini-cart and cart pages (e.g. quantity of 3 shows 3 times the tax added into the total product price). Note that you must have "Presume that a not logged in customer is from the default country" checked in your general settings for the tax to show before someone logs in.

qualiteam 02-10-2011 01:16 AM

Re: Global Variable
 
You should alter the "include/func/func.cart.php" script -> function "func_calculate".

thygtd 02-10-2011 04:42 AM

Re: Global Variable
 
Quote:

Originally Posted by geckoday
I don't run 4.4.1 so I can't test it on my setup but I did try it out on the X-Cart demo site and taxes are properly multiplied by the number of items and show properly in the extended product price mini-cart and cart pages (e.g. quantity of 3 shows 3 times the tax added into the total product price). Note that you must have "Presume that a not logged in customer is from the default country" checked in your general settings for the tax to show before someone logs in.

Thanks for the message geckoday! it helped, but unfortunately client doesn't wants to add it as tax and now implemented the concept suggested Alex. Thanks a lot for your time and help!

thygtd 02-10-2011 04:43 AM

Re: Global Variable
 
Quote:

Originally Posted by qualiteam
You should alter the "include/func/func.cart.php" script -> function "func_calculate".

Going to try tht, will post an update asap. Thanks a bunch for helping.


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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.