Add to wishlist function for coming soon products

  • Posts: 15
  • Thank you received: 0
11 years 7 months ago #65128

We have a products group called "coming soon"
All products from this group are without selling price.
We like to have "add to wishlist" function for these products but without "add to cart" function.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #65776

Hi shiva,

I think that you can edit the view "product / quantity" and add a control for the "add to cart" display conditions, like:

$this->element->category_id != 13
Example:
if($this->params->get('add_to_cart') && $this->element->category_id != 13){
	echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
	$btnType = 'wish';
}

You can replace the number "13" by the id of your category.

Hope this will help you.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
11 years 7 months ago #65813

Yes, after I edit codes, It's display "Add to Wishlist" button.
But, when click "Show the wishlist" still display price "0.00" and still can process "Add to cart" function.
Of course, we don't allow showing "zero" price and we don't allow process "add to cart" function for this product group.
We only allow users can add products to their wishlist.
When product and price ready, we will move this product to selling products group, then users can process add to cart function.


Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #65825

Hi again,

Maybe you can add a if/else in the "cart / showcart" view to hide the checkboxes when the price value is "0" ?

You can replace the line:

<input type="checkbox" name="data[products][<?php echo $cart->product_id;?>][checked]" value="1"/>
By:
<?php if((int)$cart->prices[0]->price_value != 0){ ?>
<input type="checkbox" name="data[products][<?php echo $cart->product_id;?>][checked]" value="1"/>
<?php } ?>

The following user(s) said Thank You: shiva

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum