![]() |
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 |
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. |
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 |
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. |
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.
|
Re: Global Variable
Quote:
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. |
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.
|
Re: Global Variable
You should alter the "include/func/func.cart.php" script -> function "func_calculate".
|
Re: Global Variable
Quote:
|
Re: Global Variable
Quote:
|
Re: Global Variable
Quote:
We tried this, but we are unable to find the exact location to add the global variable. Can u please give some sample code or exact line in the code. |
Re: Global Variable
You should alter "include/func/func.cart.php" -> "function func_calculate_single", add extra code inside the products loop (near line 2013 or so).
|
All times are GMT -8. The time now is 05:24 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.