Displaying Dimensions
When importing from a .csv file, using xcarts standard column headings.
It has column headings for the dimensions eg. dim_x, dim_y, dim_x. How can I get the dimensions entered in under these columns to be displayed with my product details....rather than adding an extra product field (param00). |
Yes, curious myself!
But I am about to spend some support points to find out. Version 4.0.12 I did I did! 8) ----------------------------------------------------------------------- > I'm going to import my client's products into the dB, and I notice these product fields > available for import: dim_x, dim_y, dim_z. > They also appear in the Importing Products section of the manual, but I don't see them > displayed on any pages for a standard install? Unfortunately, these fields are not used in X-Cart, they remained from previous versions of X-Cart. > Is that intentional? They are not international. The values of these fields are stored in the 'xcart_products' table in the 'dim_x', 'dim_y', 'dim_z' fields accordingly. > How should I refer to these variables to display them? > > Are they in any .tpl files? If so, which ones? To display these fields, for example at the product details page, you can edit 'skin1/customer/main/product.tpl' (customers zone) and 'skin1/main/product.tpl' (admins/providers zone) templates and use the following code there: {$product.dim_x} -- Sincerely yours, Sergey Fomin, Technical Support Engineer |
Additionally, I persued the following to edit my Admin/modify_product.php page. I edited the code for dim_x for starters (btw $lng.lbl_dim_x must be added in the Languages section of admin tool):
Code:
<TR> It displays properly. However, it does NOT save any numbers entered into the dim_x input field. Do you know why? And what do I need to do to save the entry? The field already exists in the xcart_products table. Using the GET method I confirmed the value is being passed to the page, but it did not save it in the xcart_products table. It just returns "0" in the dim_x field. Hmmmm.....? What next? Version 4.0.12 |
Per excellent tech support... I relay the info here for all users:
This field is not used by default x-cart, thus you need to modify /xcart/include/product_modify.php and replace # # Update product data # Code:
db_query("UPDATE $sql_tbl[products] SET product='$product', descr='$descr', fulldescr='$fulldescr', avail='$avail', list_price='$list_price', weight='$weight', productcode='$productcode', forsale='$forsale', distribution='$distribution', free_shipping='$free_shipping', shipping_freight='$shipping_freight', discount_avail='$discount_avail', min_amount='$min_amount', return_time = '$return_time', low_avail_limit='$low_avail_limit', free_tax='$free_tax' WHERE productid='$productid'"); with # # Update product data # Code:
db_query("UPDATE $sql_tbl[products] SET product='$product', descr='$descr', fulldescr='$fulldescr', avail='$avail', list_price='$list_price', weight='$weight', productcode='$productcode', forsale='$forsale', distribution='$distribution', free_shipping='$free_shipping', shipping_freight='$shipping_freight', discount_avail='$discount_avail', min_amount='$min_amount', return_time = '$return_time', low_avail_limit='$low_avail_limit', free_tax='$free_tax', dim_x='$dim_x' WHERE productid='$productid'"); As you can see I've just added , dim_x='$dim_x' to the list of saved attributes. |
Quote:
You sure that's the file name - I keep looking for it in admin but not there. Was it a tpl file instead? Update: It may have been a version thing... For version 4.014 you have to change the file: skin1/main/product_details.tpl add the following code to the table: Code:
<TR> I ended up adding three new rows, changing dim_x to dim_y abd dim_z respectively for each. Also added a language variable for each one as specified by cubefree. Then, I edited /include/product_modify.php as specified by cubefree but added a couple of values to my query to accomodate dim_y and dim_z: Code:
db_query("UPDATE $sql_tbl[products] SET product='$product', descr='$descr', fulldescr='$fulldescr', avail='$avail', list_price='$list_price', weight='$weight', productcode='$productcode', forsale='$forsale', distribution='$distribution', free_shipping='$free_shipping', shipping_freight='$shipping_freight', discount_avail='$discount_avail', min_amount='$min_amount', return_time = '$return_time', low_avail_limit='$low_avail_limit', free_tax='$free_tax', dim_x='$dim_x', dim_y='$dim_y', dim_z='$dim_z' WHERE productid='$productid'"); Finally I edited my product_details file /skin1/customer/main/product.tpl and /skin1/customer/main/products.tpl to display the new values. Thanks for doing the leg work cubefree :) |
moved over to custom mods
|
can you show the compeleted code?
Can you show the code completed to accuratly show in both areas needing editing?
|
well i was thinking to play with that variables.
well here is a challange, i will try to do, help will be welcome :oops: my shipping company takes the weight like this: dim_x * dim_y * dim_z ___________________ = weight of the product 3000 in other words : (dim_x*dim_y*dim_z)/3000=weight of the product this is the formula of the "desi" in turkish and i can not find the english term sorry :( so when we enter the values x,y,z in the product modify field it is automaticly will be calculated with formula and will be entered in the weight field with javascript. i hope i am clear :( willing to hear help from you mates. cheers |
any1? :(
|
All times are GMT -8. The time now is 05:25 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.