samedi 21 mai 2016

WooCommerce up-sells as checkboxes + thumbnail

First post here! I found this code by alev to be super useful for creating a simple up-sell check box add to cart. One thing I have been trying to add onto it is including the up-sell thumbnail. I found that including:

<?php the_post_thumbnail( 'shop_thumbnail' ); ?>

This snippet grabs a thumbnail - but only the current product thumbnail and not the up-sell thumbnail. I'm looking for a way to accomplish this but can't seem to get this to work.

I added this code right after the string of code:

 // get the product up-sells
$upsells = $product->get_upsells();

// store the number of up-sells and pass it on to the add-to-cart hook
?>
<input type="hidden" name="upsells_size" value="<?php echo(sizeof($upsells)); ?>">
<div id="wb-upsell-div">

The full string of code can be found here: http://ift.tt/1TmcgcI

What it currently looks like on staging and what I am trying to change: http://ift.tt/1TNG5Nx

I will compensate for the help, if wanted, via paypal!




Aucun commentaire:

Enregistrer un commentaire