Jump to content
Sign in to follow this  
WendyLady

Hide Price if $0 + MyWishList 1.0

Recommended Posts

Here is a little snippet of code, for posterity. I have both of these contribs & found a little back-door by which a non-purchasable item (with price of zero) could be added to the cart & purchased when it was added to the cart from the Wishlist.

 

Just one question - now it is not showing "Add to Cart" for any of the items. I'm working on this. Can any PHP-whizzes see where I've gone wrong right away?

 

 

In includes/modules/wishlistdetails.php: From changed code to end of file:

echo '    </td>' . "\n";
 ?> <td valign="top" class="main"><a href="<?php echo tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products[$i]['id'], 'NONSSL'); ?>"><?php (($product_info['products_price'] > 0) ? BOX_TEXT_MOVE_TO_CART : ''); ?>
 </a> <br><a href="<?php echo tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products[$i]['id'], 'NONSSL'); ?>"><?php echo BOX_TEXT_DELETE; ?></a><br>
 <?

 echo '    </td>' . "\n";
 echo '  </tr>' . "\n";
}
?>
<!-- order_details_eof -->

 

In includes/boxes/wishlist.php: only the code near "BOX_MOVE_TO_CART" has been changed, but code around it is listed, so it is easier to find:

      $wishlist_contents_string .= $products[$i]['name'] . "<br>".

      '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' .  $products[$i]['id'] . '&rfw=1', 'NONSSL') . '">' .  tep_draw_hidden_field('products_id', $product_info['products_id']) .
   (($product_info['products_price'] > 0) ? ('  -' . BOX_TEXT_MOVE_TO_CART) : '') . '</a>' . "\n" .
      '    <a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products[$i]['id'], 'NONSSL') . '">' . '  -' . BOX_TEXT_DELETE . '</a>' . "\n" .'</span></a></td></tr>';

 

 

 

 

Wendy

Edited by WendyLady

Share this post


Link to post
Share on other sites
now it is not showing "Add to Cart" for any of the items.
So that means that product_info['products_price'] is an empty variable which makes perfect sense since the id of the product is called with $products[$i]['id']. My suggestion is that you include products_price in the query for the wishlist and use $products[$i]['products_price'] instead.

Share this post


Link to post
Share on other sites

Thank you, Jan. I will work on this after I get some sleep (was up all night working on it last night) & will post here when I get it working. Thanks!

 

Wendy

 

 

So that means that product_info['products_price'] is an empty  variable which makes perfect sense since the id of the product is called with $products[$i]['id']. My suggestion is that you include products_price in the query for the wishlist and use $products[$i]['products_price'] instead.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×