Hi,
I try to display the personalized meta of a product in the sight out of grid of the products (wpsc-grid_view.php)
Thanks for your answers
Non รงa ne fonctionne pas
Hi,
I try to display the tags products in single product page and in the grid view.
Can you help me ?
Thanks
Hi guys, my Store Toolkit Plugin includes a template tag that you can use on the Products Page and Single Product screen.
Just install the Plugin and add the following template tag to wpsc-products_page.php and wpsc-single_product.php
<?php wpsc_the_product_weight( $product_id ); ?>
<?php wpsc_the_product_weight(); ?>
I’ll look at the core code and add support for dimensions too if it hasn’t been done so already.
Thanks ! I’ll try it. Also, do you how I can disable the wordpress backend for simple users who subscribe from the site ?
Hi Couincouin007,
I’ve put your code in the wpsc-single_product.php – before the close single_product_display div
<?php
$metadata=get_product_meta($id_product,'product_metadata', true);
$dimension=$metadata['dimensions'];
$height=$dimension['height'];
$heightunit=$dimension['height_unit'];
$width=$dimension['width'];
$widthunit=$dimension['width_unit'];
$metadata=get_product_meta($id_product, 'product_metadata', true);
$weight=$metadata['weight'];
?>
</div><!--close single_product_display-->
and nothing happens.
Do you know why?
Thanks
Haha ! Of course man, you don’t ask to PHP to show your variables ! To show variables in PHP, you need to use “echo”, i gave you an example :
echo 'La hauteur est de : ' .$height. ' '.$heightunit;
Ok, thanks. I copied it stupidly. Now I got :
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘,’ or ‘;’ in /homepages/9/d442537627/htdocs/wp-content/plugins/wp-e-commerce/wpsc-theme/wpsc-single_product.php on line 386
with this code :
<?php $metadata=get_product_meta($id_product,'product_metadata', true);$dimension=$metadata['dimensions']; $height=$dimension['height']; $heightunit=$dimension['height_unit']; $width=$dimension['width']; $widthunit=$dimension['width_unit'];//$metadata=get_product_meta($id_product, 'product_metadata', true);
$weight=$metadata['weight']; $weightunit=$metadata['weight_unit'];
echo 'Hauteur : ' .$height. ' '.$heightunit.'<br/>'
'Largeur : ' .$width. ' '.$widthunit.'<br/>'
'Poids : ' .$weight. ' '.$weightunit.; ?>
I don’t see where is the problem.
On your last line, you have written “.$weightunit.; ?>”, but you should delete the last “.”, so you should just let in your code at the end : “.$weightunit; ?>”.
Tell me if it works ๐
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘,’ or ‘;’ in /homepages/9/d442537627/htdocs/wp-content/plugins/wp-e-commerce/wpsc-theme/wpsc-single_product.php on line 394
<?php
$metadata=get_product_meta($id_product,'product_metadata', true);
$dimension=$metadata['dimensions'];
$height=$dimension['height'];
$heightunit=$dimension['height_unit'];
$width=$dimension['width'];
$widthunit=$dimension['width_unit'];
//$metadata=get_product_meta($id_product, 'product_metadata', true);
$weight=$metadata['weight'];
$weightunit=$metadata['weight_unit'];
echo 'Hauteur : ' .$height. ' '.$heightunit.'<br/>'
'Largeur : ' .$width. ' '.$widthunit.'<br/>'
'Poids : ' .$weight. ' '.$weightunit; ?>
The line 394 is :
'Largeur : ' .$width. ' '.$widthunit.'<br/>'
Ah yes, it’s because you don’t write well to separate the variables and your text using “.”, “,” and “;”.
Try with this code :
echo 'Hauteur : '.$height.' '.$heightunit.'<br/>
Largeur : '.$width.' '.$widthunit.'<br/>
Poids : '.$weight.' '.weightunit;?>
If I delete the last line too :
“… .$widthunit. ; ?>”
Try with my last code ๐