VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: norgan on September 18, 2011, 01:29:48 AM

Title: Product Details not showing add to cart
Post by: norgan on September 18, 2011, 01:29:48 AM
Use as catalogue in config not set, tried ticking, applying then unticking and applying. no change.

Tried other templates, no change.

There is a product price, quantity and manufacturer. Still no products show as being able to add to cart.

Add to cart text not found anywhere, only ask a question about this product.

I must be missing something but i cannot for the life of me find out what.

site is http://threewhiterabbits.com.au/shop

Any assistance would be greatly appreciated as we are going live with this.
Title: Re: Product Details not showing add to cart
Post by: Milbo on September 18, 2011, 13:04:17 PM
Maybe you have the catalogue mode or simular activated. Take a look on the shopconfig please
Title: Re: Product Details not showing add to cart
Post by: norgan on September 20, 2011, 06:37:23 AM
"Use as catalogue in config not set" could it be in a config file when it is showing as off in the gui?
Title: Re: Product Details not showing add to cart
Post by: Milbo on September 20, 2011, 15:52:20 PM
The config file is only read one time to create the database entry. After that time, it uses only the db.
Title: Re: Product Details not showing add to cart
Post by: norgan on September 21, 2011, 01:12:05 AM
So any idea why this is not working? it's time critical and i have tried everything i know and can find on the forums. Is there a db table dump i could provide that may help?
Title: Re: Product Details not showing add to cart
Post by: PRO on September 21, 2011, 16:39:35 PM
norgan, open the default.php file in the productdetails folder and see if the add to card code is there

Title: Re: Product Details not showing add to cart
Post by: norgan on September 22, 2011, 04:37:51 AM
Quote from: BanquetTables.pro on September 21, 2011, 16:39:35 PM
norgan, open the default.php file in the productdetails folder and see if the add to card code is there


This is the add to cart code i have:


<?php // Add To Cart Button
if (!VmConfig::get('use_as_catalog',0)) { ?>

<div class="addtocart-area">

<form method="post" class="product" action="index.php" id="addtocartproduct<?php echo $this->product->virtuemart_product_id ?>">
<?php // Product custom_fields
if (!empty($this->product->customfieldsCart)) {  ?>

<div class="product-fields">
<?php foreach ($this->product->customfieldsCart as $field)
?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
<span class="product-fields-title" ><b><?php echo  JText::_($field->custom_title?></b></span>
<?php echo JHTML::tooltip($field->custom_tip,  JText::_($field->custom_title), 'tooltip.png'); ?>
<span class="product-field-display"><?php echo $field->display ?></span>

<span class="product-field-desc"><?php echo $field->custom_field_desc ?></span>
</div><br/ >
<?php
}
?>

</div>
<?php }
 /* Product custom Childs
  * to display a simple link use $field->virtuemart_product_id as link to child product_id
  * custom_value is relation value to child
  */

if (!empty($this->product->customsChilds)) {  ?>

<div class="product-fields">
<?php foreach ($this->product->customsChilds as $field) {  ?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field->field_type ?>">
<span class="product-fields-title" ><b><?php echo JText::_($field->field->custom_title?></b></span>
<span class="product-field-desc"><?php echo JText::_($field->field->custom_value?></span>
<span class="product-field-display"><?php echo $field->display ?></span>

</div><br/ >
<?php
?>

</div>
<?php ?>

<div class="addtocart-bar">

<?php // Display the quantity box ?>
<label for="quantity<?php echo $this->product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label>
<span class="quantity-box">
<input type="text" class="quantity-input" name="quantity[]" value="1" />
</span>
<span class="quantity-controls">
<input type="button" class="quantity-controls quantity-plus" />
<input type="button" class="quantity-controls quantity-minus" />
</span>
<?php // Display the quantity box END ?>

<?php // Add the button
$button_lbl JText::_('COM_VIRTUEMART_CART_ADD_TO');
$button_cls ''//$button_cls = 'addtocart_button';
if (VmConfig::get('check_stock') == '1' && !$this->product->product_in_stock) {
$button_lbl JText::_('COM_VIRTUEMART_CART_NOTIFY');
$button_cls 'notify-button';
?>


<?php // Display the add to cart button ?>
<span class="addtocart-button">
<input type="submit" name="addtocart"  class="addtocart-button" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
</span>

<div class="clear"></div>
</div>

<?php // Display the add to cart button END ?>
<input type="hidden" class="pname" value="<?php echo $this->product->product_name ?>">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="cart" />
<noscript><input type="hidden" name="task" value="add" /></noscript>
<input type="hidden" name="virtuemart_product_id[]" value="<?php echo $this->product->virtuemart_product_id ?>" />
<?php /** @todo Handle the manufacturer view */ ?>
<input type="hidden" name="virtuemart_manufacturer_id" value="<?php echo $this->product->virtuemart_manufacturer_id ?>" />
<input type="hidden" name="virtuemart_category_id[]" value="<?php echo $this->product->virtuemart_category_id ?>" />
</form>

<div class="clear"></div>
</div>
<?php }  // Add To Cart Button END ?>
Title: Re: Product Details not showing add to cart
Post by: jjk on September 22, 2011, 09:09:12 AM
Probably this info won't help either, but what I see at your provided link is this:


Line 429 Piwik is not defined (probably not related to your problem)
Title: Re: Product Details not showing add to cart
Post by: norgan on September 23, 2011, 08:25:08 AM
Quote from: jjk on September 22, 2011, 09:09:12 AM
Probably this info won't help either, but what I see at your provided link is this:


  • The "Add to cart" css stuff is there (I can see the buttons with firebug)
  • The "Add to cart" script is not being loaded
  • You are using the Beez template including "Hide js" (perhaps this is hiding the buttons too?)

Line 429 Piwik is not defined (probably not related to your problem)

Piwik is the tracking code for Piwik web stats.

Where is the Hide JS defined? I did try another template i'm sure that it also didn't work on.

Is there somewhere else i need to look for js being disabled?
Title: Re: Product Details not showing add to cart
Post by: norgan on September 23, 2011, 08:34:30 AM
This is pretty frustrating, i get one reply per day lol

I don't mind compensating someone for thier time if they think they could fix it.
Title: Re: Product Details not showing add to cart
Post by: jjk on September 23, 2011, 11:27:15 AM
Just in case you encounter a js conflict with other extensions, did you try to disable other extensions already?

BTW - did you notice this already: http://threewhiterabbits.com.au/component/virtuemart/hand_tools/Hand-Shovel (http://threewhiterabbits.com.au/component/virtuemart/hand_tools/Hand-Shovel)
See srcreenshot taken 5 minutes before posting this below.  ;D

[attachment cleanup by admin]
Title: Re: Product Details not showing add to cart
Post by: norgan on September 23, 2011, 12:21:07 PM
Quote from: jjk on September 23, 2011, 11:27:15 AM
Just in case you encounter a js conflict with other extensions, did you try to disable other extensions already?

BTW - did you notice this already: http://threewhiterabbits.com.au/component/virtuemart/hand_tools/Hand-Shovel (http://threewhiterabbits.com.au/component/virtuemart/hand_tools/Hand-Shovel)
See srcreenshot taken 5 minutes before posting this below.  ;D

lol yeah that is because if i reset the vm tables back to default with sample data, all products show with add to cart.
if i then remove all but one (the hand trowel) it still shows as add to cart BUT

if i then add a new category, then move the trowel to that category, BANG add to cart gone!

If i move trowel back to default category, still no add to cart!

Interesting no?
Title: Re: Product Details not showing add to cart
Post by: norgan on September 23, 2011, 12:25:27 PM
So i managed to be able to do the following:

Reset all vm tables, with sample data.

verify all sample products can be added to cart

remove all but one product and category

rename manufacturer

all still works when adding to cart

then add new category

move item to new category

no more add to cart

There must be something with the categories playing up but i cannot figure what. or why for that matter on a fresh install!
Title: Re: Product Details not showing add to cart
Post by: norgan on September 23, 2011, 12:31:03 PM
ok verified on two seperate sites running same jm and vm versions
Title: Re: Product Details not showing add to cart
Post by: Milbo on September 23, 2011, 12:51:59 PM
oha, interesting. We will take a look on that
Title: Re: Product Details not showing add to cart
Post by: jjk on September 23, 2011, 12:59:37 PM
another idea  :) ...did you check if you accidentially have selected 'Default Product Details Page' "pdf" instead of "default" somewhere in your new categories? If you select "pdf" the "Add to Cart" button will not be shown.
Title: Re: Product Details not showing add to cart
Post by: Studio 42 on September 23, 2011, 13:15:11 PM
Its very strange
the "FORM" code is not rendered.
But the first line >>
<div class="addtocart-area">

and the end >>
<div class="clear"></div>
</div>


is added by php
It's not a javascript error because the code is not in the original document !
BUt strange is how PHP can delete it ???

As jjk Say, i think, it's the problem ,
YOu have do a false setting in the BE templating settings ;)


Title: Re: Product Details not showing add to cart
Post by: norgan on September 24, 2011, 14:36:48 PM
Quote from: jjk on September 23, 2011, 12:59:37 PM
another idea  :) ...did you check if you accidentially have selected 'Default Product Details Page' "pdf" instead of "default" somewhere in your new categories? If you select "pdf" the "Add to Cart" button will not be shown.

Thanks JJK that may be my problem, thanks. will do some further testing and see if that was the problem all along :) still a bug though if that defaults to pdf nto default?
Title: Re: Product Details not showing add to cart
Post by: jjk on September 24, 2011, 16:00:47 PM
"default" has always been the default setting  upon installation if you downloaded your version from Virtuemart.net :)
When I create new categories, they are also set to "default" by default.
Title: Re: Product Details not showing add to cart
Post by: Mattlab on October 06, 2011, 05:39:55 AM
I was actually having, I think, the same problem. No add to cart button was showing up and when I clicked on product details all it did was refresh the page. I think i fixed it by changing the alias. Before I had no alias and it just used the default joomla one but when I changed it to something I made up it started to work. Ideas?
Title: Re: Product Details not showing add to cart
Post by: Ken Lyle on October 22, 2011, 06:44:31 AM
I have a similar situation, very odd, with  Add to Cart (AtC).  I have two sites running the RC-J.  One has been hacked on a bit, , and was upgraded from 1.5, I believe, but I see that when I scroll the "neighbors" at the top of the product area, the AtC is there, EXCEPT for the first and last items in the series, which lose the AtC and the neighbors arrows...But only for one category not another, corporate/gifts does not have the issue, but healthcare/hospitals with about 5 products does, and drinkware/travel-mugs with one product.

On the FRESH RC-J install, there are no such issues and both 2-product categories and multi-product categories shot the AtC.

I haven't tried what the OP has, but can empathize, as this has plagued me for a few hours now.

Title: Re: Product Details not showing add to cart
Post by: wozza on November 04, 2011, 07:11:27 AM
I disabled SEO in the configuration and the add to cart button showed up. Appears to not like the alias
Title: Re: Product Details not showing add to cart
Post by: Milbo on November 26, 2011, 10:40:03 AM
? The category browse pages dont have an atc. please look in the template subboard, there is a post describing how you can add an atc to the browsepage