Guest Posted April 27, 2005 Share Posted April 27, 2005 (edited) 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 April 27, 2005 by WendyLady Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 27, 2005 Share Posted April 27, 2005 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 28, 2005 Share Posted April 28, 2005 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. <{POST_SNAPBACK}> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.