Zen Follower
- Join Date:
- Aug 2005
- Posts:
- 314
- Plugin Contributions:
- 0
Correct syntax for Add to Wishlist link
We're using the previous order page (tpl_account_history_info_default.php) a bit differently, and are trying to put Add to Cart and Add to Wishlist buttons next to each previously ordered product of the customer's.
A programmer made the following code for us to add an Add to Cart button. This works fine:
<?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($order->products[$i]['id']), zen_get_all_get_params(array('action')) . 'action=add_product&zenid=' . session_id()), 'post', 'enctype="multipart/form-data"'); ?>
<?php echo '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', $order->products[$i]['id']) . zen_image_submit(BUTTON_IMAGE_ADD_TO_CART_SMALL, BUTTON_IN_CART_ALT);//$template->get_template_dir(BUTTON_IMAGE_IN_CART, DIR_WS_TEMPLATE, $current_page_base, 'buttons/' . $_SESSION['language'] . '/' . BUTTON_IMAGE_IN_CART); ?>
</form>
I'm trying to figure out how to add an Add to Wishlist button just like it and so far, I can't get it to work. The latest I have is this:
<?php echo '<a href="' . zen_href_link(UN_FILENAME_WISHLIST, 'products_id=' . $listing->fields['products_id'] . '&action=un_add_wishlist') . '">' . zen_image_button(BUTTON_IMAGE_ADD_WISHLIST_SMALL, BUTTON_ADD_WISHLIST_ALT) . '</a>'; ?>
It's almost working, I think. But, the product_id isn't getting included in the link. I'm not sure what to write in the above code to make it grab the correct product id. You can see here what's actually being generated right now:
http://myshop.com/catalog/index.php?main_page=un_wishlist&products_id=&action=un_add_wishlist
Any help would be greatly appreciated!