Re: Trying to understand the coding
I used webmaster mode and confirmed the correct name for the freight variable used on a catalog page is $product.shipping_freight. Use this instead of xcart_products.shipping_freight seen in your prototype example.
Please keep in mind that the table names in the xcart database (like xcart_products) are rarely the same names that are assigned after the data is retrieved from the database. The xcart_products data is read into an array and the name used for the array variable can be anything (in this case it is $product[]). There are many member elements (fields) in the $product array (weight, color, price, etc.) and in xcart these usually retain the same name used in the database (but not always!). Webmaster mode will help you hunt down the variable names that need to be used.
There's three layers to xcart. (1) Data is stored in SQL tables. (2) To get to the data you need a programming language that can perform the I/O task (read/write data to the database) and do the major logic and math. The HTML language cannot do this on its own. But php is perfect for this job since it is made for database based web applications. (3) The tpl and css files are used to make it look pretty to the human observer. Of course the dirty business inside these three things is where the fun begins.
__________________
Thomas / USA
XCart V4.4.5 Gold
XCart Mobile V1.4.12
XCart X-PDF
XCart X-HotProducts
AlteredCart Checkout One (One Page Checkout)
BCSE Back In Stock
CFL Holiday Message
CFL System Message
Smack Digital (WebsiteCM) Remember Anon Carts
xcartmods Testimonials
xcartmods reCAPTCHA for X-Cart Classic
Unix, PHP 7.0 (patched 5.4).
MySQL 5.6
|