Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hide Price if $0 + MyWishList 1.0


Guest

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
Link to comment
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.
Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...