Forums / Templates, Stylesheets, Page Layout / adding add to cart button in cvv popup

adding add to cart button in cvv popup

Views: 589

Results 1 to 4 of 4
30 Dec 2025, 12:31 AM
#1
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

adding add to cart button in cvv popup

zen 2.10
php 8.3
trying to repurpose the cvv help popup
i have reworded what i want it to say.
i put this in tpl product info display to test it. ```

<?php echo '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_CVV_HELP) . '\')">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>'; ?>
 iwould like to replace existing add to cart button with this popup.
it would like it display when customer chooses more quantity than in stock.
this is in tpl_main_page in popup cvv page ```
<?php
/**
 * tpl_main_page.php
 *
 * @copyright Copyright 2003-2022 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: DrByte 2020 Jul 10 Modified in v1.5.8-alpha $
 */
?>
<body id="popupCVVHelp">
<h3><?php echo HEADING_CVV ?></h3>
  <div><?php echo TEXT_CVV_HELP1 ?></div>
  <h3><?php echo HEADING_CVV2 ?></h3>
  <div><?php echo TEXT_CVV_HELP2 ?></div>
  <div><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_CVV_WINDOW . '</a>'; ?></div>
  
  <div><?php echo '<a class="button btn tt-btn-addtocart thumbprod-button-bg btn-opt" href="' . zen_href_link($zen_get_info_page, 'cPath=' . $cPath . '&products_id=' . $listing->fields['products_id']) . '" '.wtExtraBtnLink($listing).'><span class="qck-text">' . TITLE_SELECT_OPTIONS . '</span></a>'; ?></div>
  
</body>

how do i go about making the add to cart button add the items to cart from the popup.
similar to this site jnsflooringandsupplies.com/images/uploads/Screenshot%202025-12-29%20192614.jpg

30 Dec 2025, 5:55 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,864
Plugin Contributions:
18

Re: adding add to cart button in cvv popup

You don't say what template you are using or what your stock settings are in your admin.

If your stock settings in admin are set to check stock and not allow checkout if the quantity is over what is in stock, and your quantity in your stock is accurate, the system should automatically adjust the amount in the cart to the current quantity on hand and notify the customer with a pop-up stating "Quantity has been adjusted to what is in stock".

Trying to make this happen on the product's page when the add to cart button is pushed is gonna take a lot mored than just adding an action to the button.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

30 Dec 2025, 7:27 PM
#3
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: adding add to cart button in cvv popup

products not in stock will ship from manufacturer, so i have to allow checkout,
i need away to send the quantity chosen by customer to the popup and then send the quantity to the shopping cart from the popup, or if buying more than in stock when they hit add to cart that popup will popup and not disappear without a close

30 Dec 2025, 8:00 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,864
Plugin Contributions:
18

Re: adding add to cart button in cvv popup

What about setting the quantity in stock for items that drop ship to an absurdly high number, no one will ever order? Then, set items not drop-shipped to their actual inventory?

Set allow checkout to no.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com