That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Hi
I need help. I've tried but obviously don't know what I'm doing. I'm using CSS Buttons and want the Save For Later button on the Product Info page to display the same as the other CSS buttons i.e., same appearance as the 'Add to cart' button.
By following and manipulating the code for a 'submit' button, I've got it looking right but it is not functioning correctly i.e., it is 'adding to cart' and not adding to 'save for later'.
Save for later button code:
My non-working code attempt:Code:<!-- bof save for later --> <?php if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] != '') { echo "<br /><br />"; echo '<input type="submit" value="' . BUTTON_SAVE_FOR_LATER_ALT . '" name="sfl" />'; } ?> <!-- eof save for later -->
I'm assuming that there is a value that needs to be specified to get the 'save for later' function instead of the 'add to cart' function, but I don't how or where this might be specified.Code:<!-- bof save for later --> <?php if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] != '') { echo " "; echo zen_image_submit(BUTTON_IMAGE_SAVE_FOR_LATER, BUTTON_SAVE_FOR_LATER_ALT); } ?> <!-- eof save for later -->
Appreciate any assistance.
Cheers
GAM
I got it working and iirc it was something stupid that I was or wasn't doing. I'll review the code and css and let you know what I have, which is working!
Cheers
GAM
Okay, this is what I did, which works for me ;-) I realized after seeing your post that I never actually got back to this as looking at it again now it is not quite right... but does still work.
tpl_product_info_display.php:
stylesheet_css_buttons.css:PHP Code:<!-- bof save for later -->
<?php
if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] != '') {
echo " ";
echo '<input class="cssButton submit_button button_save_for_later" onmouseover class="cssButtonHover submit_button button_save_for_later" onmouseout class="cssButton button_save_for_later" type="submit" value="' . BUTTON_SAVE_FOR_LATER_PRODUCT_ALT . '" name="sfl" />' ;
}
?>
<!-- eof save for later -->
I added these to my existing 'button_in_cart' CSS as/where appropriate. I use a 'button_in_cart_lg' version for the Add to Cart button on the product info page and have the 'save for later' button looking the same as 'add to cart'.
input.button_save_for_later
input.button_save_for_later:hover
input.button_save_for_later:active
Hope this helps.
Cheers
GAM
For anyone wanting to use the same hard-coded workaround, to avoid conflicts, probably best to use...
BUTTON_SAVE_FOR_LATER_PRODUCT
which is in sfl_defines.php too and, I believe, intended for use on Product_Info pages.
In tpl_product_info_display.php
Replace:
With:PHP Code:echo '<input type="submit" value="' . BUTTON_SAVE_FOR_LATER_PRODUCT_ALT . '" name="sfl" />';
In stylesheet_css_buttons.css, add the following with your own formatting to suit:PHP Code:echo '<input class="cssButton submit_button button_save_for_later_product" onmouseover class="cssButtonHover submit_button button_save_for_later_product" onmouseout class="cssButton submit_button button_save_for_later_product" type="submit" value="' . BUTTON_SAVE_FOR_LATER_PRODUCT_ALT . '" name="sfl" />' ;
CheersCode:input.button_save_for_later_product{} input.button_save_for_later_product:hover{} input.button_save_for_later_product:active{}
GAM