Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Displaying Dimensions

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-20-2005, 04:06 PM
 
brightway brightway is offline
 

Member
  
Join Date: Jan 2005
Posts: 27
 

Default 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).
__________________
4.0.11gold
Reply With Quote
  #2  
Old 03-28-2005, 06:22 PM
 
cubefree cubefree is offline
 

Member
  
Join Date: Mar 2005
Posts: 18
 

Default

Yes, curious myself!
But I am about to spend some support points to find out.

Version 4.0.12

I did I did!

-----------------------------------------------------------------------

> 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
__________________
~cubist
v 4.0.17
Reply With Quote
  #3  
Old 03-29-2005, 03:50 PM
 
cubefree cubefree is offline
 

Member
  
Join Date: Mar 2005
Posts: 18
 

Default

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> {if $productids ne ''}<TD width="15" class="TableSubHead"><INPUT type="checkbox" value="Y" name="fields[dim_x]"></TD>{/if} <TD class="FormButton" nowrap>{$lng.lbl_dim_x}</TD> <TD class="ProductDetails"> <INPUT type="text" name="dim_x" size="18" value="{$product.dim_x}"> </TD> </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
__________________
~cubist
v 4.0.17
Reply With Quote
  #4  
Old 03-30-2005, 10:43 AM
 
cubefree cubefree is offline
 

Member
  
Join Date: Mar 2005
Posts: 18
 

Default

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.
__________________
~cubist
v 4.0.17
Reply With Quote
  #5  
Old 08-17-2005, 02:24 PM
 
maniac maniac is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 97
 

Default

Quote:
Originally Posted by cubefree
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):

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> {if $productids ne ''}<TD width="15" class="TableSubHead"><INPUT type="checkbox" value="Y" name="fields[dim_x]"></TD>{/if} <TD class="FormButton" nowrap>{$lng.lbl_dim_x}</TD> <TD class="ProductDetails"> <INPUT type="text" name="dim_x" size="18" value="{$product.dim_x}"> </TD> </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
Reply With Quote
  #6  
Old 08-18-2005, 03:41 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

moved over to custom mods
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 08-22-2005, 04:46 AM
 
gfmedia gfmedia is offline
 

Member
  
Join Date: Jun 2005
Posts: 11
 

Default can you show the compeleted code?

Can you show the code completed to accuratly show in both areas needing editing?
__________________
4.0.13 /windows xp
Reply With Quote
  #8  
Old 08-23-2005, 03:39 AM
  2019's Avatar 
2019 2019 is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 76
 

Default

well i was thinking to play with that variables.
well here is a challange, i will try to do, help will be welcome

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
__________________
// x-cart 4.1.9

X-CART CSS SKIN
XC SEO
IP Addresses in Users Online for all users
Color coded order status
Reply With Quote
  #9  
Old 09-25-2005, 12:12 PM
  2019's Avatar 
2019 2019 is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 76
 

Default

any1?
__________________
// x-cart 4.1.9

X-CART CSS SKIN
XC SEO
IP Addresses in Users Online for all users
Color coded order status
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:34 AM.

   

 
X-Cart forums © 2001-2020