Viewing 15 replies - 16 through 30 (of 37 total)
  • Thread Starter amoric69

    (@amoric69)

    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

    Thread Starter amoric69

    (@amoric69)

    Non รงa ne fonctionne pas

    Thread Starter amoric69

    (@amoric69)

    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.

    Thread Starter amoric69

    (@amoric69)

    Thanks ! I’ll try it. Also, do you how I can disable the wordpress backend for simple users who subscribe from the site ?

    Thread Starter amoric69

    (@amoric69)

    It does’nt help me

    Thread Starter amoric69

    (@amoric69)

    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;

    Thread Starter amoric69

    (@amoric69)

    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 ๐Ÿ˜‰

    Thread Starter amoric69

    (@amoric69)

    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;?>
    Thread Starter amoric69

    (@amoric69)

    If I delete the last line too :
    “… .$widthunit. ; ?>”

    Try with my last code ๐Ÿ˜‰

Viewing 15 replies - 16 through 30 (of 37 total)
  • The topic ‘WP e-commerce – Display the weight and the sizes in the product page’ is closed to new replies.