Re: Creating an add-on "product type book" for ZC 1.5
Hi
I've send you a testing link.
But , If I turn this featured off, it works nice in a zc behaviour .... so, it's listed as a new product, the button isn't replaced.
When On , button is replaced and nothing is added to the shopping cart.....
Thanks
Re: Creating an add-on "product type book" for ZC 1.5
Okay, i have seen it in your shop, you can delete the test product.
I will make a note and fix it in next release.
p.
Re: Creating an add-on "product type book" for ZC 1.5
hum... I just remember that this template as some issues with bookx new products.... could that be the case ?
In fact I disable the tabs for the new modules in the front page.... but the sideboxes for new products are working, the new products page is working.... but possible in this featured is one of the cases that doesn't work ?...
if you can't reproduce, that it's this template anda not a issue.
Thanks
Re: Creating an add-on "product type book" for ZC 1.5
Indeed, here it works as expected.
I have seen that on your test page the SUBMIT form is missing two hidden INPUT fields in the HTML.
Your HTML:
HTML Code:
<!--bof Add to Cart Box -->
<div id="cartAdd">
<input class="cssButton button_bookx_new" onmouseover="this.className='cssButtonHover button_bookx_new button_bookx_newHover'" onmouseout="this.className='cssButton button_bookx_new'" type="submit" value="Novo" style="width: 80px;" />
</div>
<!--eof Add to Cart Box-->
HTML I have here:
HTML Code:
<!-- bof Add to Cart Box -->
<div id="cartAdd">
<input type="hidden" value="1" name="cart_quantity"></input>
<input type="hidden" value="469" name="products_id"></input>
<input class="cssButton submit_button button button_bookx_new" type="submit" value="Neu! Bestellen" onmouseout="this.className='cssButton submit_button button button_bookx_new'" onmouseover="this.className='cssButtonHover button_bookx_new button_bookx_newHover'"></input>
</div>
<!-- eof Add to Cart Box -->
Below is the part where file tpl_product_bookx_info_display.php is creating the form (around line 532 here), so I can't see at the moment, how your template cannot have the INPUT "quantity" and "product_id" since the template always outputs that… ?
PHP Code:
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$hidden_quantity = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']);
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
Re: Creating an add-on "product type book" for ZC 1.5
Hi
I made some diff to the original files, but or I'm missing something, but everything is looks equal....
PHP Code:
<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
} else {
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
$hidden_quantity = '';
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$hidden_quantity = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']);
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
$display_button = bookx_get_buy_now_button($_GET['products_id'], $the_button);
?>
<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
echo $display_qty . $hidden_quantity;
echo $display_button;
?>
</div>
<?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
Re: Creating an add-on "product type book" for ZC 1.5
Not sure how that is possibly, are you sure this is the file being used? do you have an override file somewhere?
In the above code this HTML "<input type="hidden" name="cart_quantity" value="1" />'" must be in your source code HTML, but it is not there…
do you agree?
p.
Re: Creating an add-on "product type book" for ZC 1.5
Could this rely on some specific zencart configuration that I don't have ?
Re: Creating an add-on "product type book" for ZC 1.5
Hm, very mysterious.
Try to set the "SHOW CART QUANTITY BOX" to "0" in Admin, maybe that helps?
p.
Re: Creating an add-on "product type book" for ZC 1.5
Hi
I was checking things, and it's reading the file, and turn on the featured and from the same file the output is different....
Well, you wanted a hidden input right ?There it is ! :D
Anyway, from a "not new" bookx date
HTML Code:
<div id="cartAdd">
<div><!-- I'm suppose to be here --></div>Adicionar ao Carrinho: <div>----------</div><input type="text" name="cart_quantity" value="1" maxlength="6" size="4"><br><br><input type="hidden" name="products_id" value="1291"><input class="cssButton button_in_cart" onmouseover="this.className='cssButtonHover button_in_cart button_in_cartHover'" onmouseout="this.className='cssButton button_in_cart'" type="submit" value="Adicionar" style="width: 80px;"> </div>
A new one :
HTML Code:
<div id="cartAdd">
<div><!-- I'm suppose to be here --></div><input class="cssButton button_bookx_new" onmouseover="this.className='cssButtonHover button_bookx_new button_bookx_newHover'" onmouseout="this.className='cssButton button_bookx_new'" type="submit" value="Novo" style="width: 80px;"> </div>
I'll try now your suggestion.
Thanks
Re: Creating an add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Hm, very mysterious.
Try to set the "SHOW CART QUANTITY BOX" to "0" in Admin, maybe that helps?
p.
Hi
Nop... I actually had that config... I've turned to 1 , but same results....
I'll have to figured this out later.
ok
Thanks