I need to be able to disable the add to cart only when a person is not loged in kinda like the way hide prices until log in works where is the code for this can i hide the add to cart button same way ?
I am using opencart version 1.5.1 also is their a relleax payment module for this version
I am using opencart version 1.5.1 also is their a relleax payment module for this version
In the template files for some of your modules (latest, featured, special) and some of the product related files (category, manufacturer, special, search, compare), you will find the following (somewhere within each file):
Replace with:
And, in the product template file, find:
and replace with:
Code: Select all
<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a>
Code: Select all
<?php if ($this->customer->isLogged()) { ?><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a><?php } ?>
Code: Select all
<a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a>
Code: Select all
<?php if ($this->customer->isLogged()) { ?><a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a><?php } ?>
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
hi guysfido-x wrote:In the template files for some of your modules (latest, featured, special) and some of the product related files (category, manufacturer, special, search, compare), you will find the following (somewhere within each file):Replace with:Code: Select all
<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a>
And, in the product template file, find:Code: Select all
<?php if ($this->customer->isLogged()) { ?><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a><?php } ?>
and replace with:Code: Select all
<a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a>
Code: Select all
<?php if ($this->customer->isLogged()) { ?><a id="button-cart" class="button"><span><?php echo $button_cart; ?></span></a><?php } ?>
thank you Fido-x, i used it and it was great
one thing more i like to add to help
because this changes used for guests of the website, which in my case (resellers only website)
another thing must be done
removing add to wishlist, because simply its not useful (guest must login to see it)
with help fido-x code above, i make add to wishlist become Request quote, that direct guest to contact form
lets start .....
first
replace:
Code: Select all
<a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a>
Code: Select all
<?php if (!$this->customer->isLogged()) { ?>
<a href="<?php echo $contact; ?>">request quote</a>
<?php } else { ?>
<a onclick="addToWishList('<?php echo $product['product_id']; ?>');"><?php echo $button_wishlist; ?></a>
<?php } ?>
Code: Select all
$this->data['contact'] = $this->url->link('information/contact');
again I'm not coder ore in IT business at all, but guys here are so great, and make it easy for people like me

Who is online
Users browsing this forum: No registered users and 19 guests