eshop plugin – How to create a custon add to cart button?
-
I have a custom template for selling books.
I add this code in my index.php for each post to add custom “add to cart button”:<?php $eshop_product=get_post_meta( $post->ID, '_eshop_product',true ); ?> <input type="hidden" name="option" value="Option 1" /> <input type="hidden" name="qty" value="1" /> <input type="hidden" name="pclas" value="<?php echo $eshop_product['shiprate'] ?>" /> <input type="hidden" name="pname" value="<?php echo stripslashes(esc_attr($eshop_product['description'])) ?>" /> <input type="hidden" name="pid" value="<?php echo $eshop_product['sku'] ?>" /> <input type="hidden" name="purl" value="<?php echo get_permalink($post->ID) ?>" /> <input type="hidden" name="postid" value="<?php echo $post->ID ?>" />'; <input class="Boton_Comprar" value="Comprar" title="Agregar el producto seleccionado a la orden de compra" type="submit" />
But this code not work, because the $eshop_product variable is empty, then the cart not show anything.
I think i need aditional lines to fix it.
Someboy can help?
Thanks.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘eshop plugin – How to create a custon add to cart button?’ is closed to new replies.