Just updated to 1.4.8 on my test box, if I check System Settings, Login Display prices = yes (like I do)
The prices disappear on the home page, (as they should) but the little + signs stay, If I click the +(Add to Cart)
the customer is taken to the cart screen and the prices are displayed.
Can we get the + sign removed along with the price if the customer is not logged in??
Thanks, and Great Work!
bob
The prices disappear on the home page, (as they should) but the little + signs stay, If I click the +(Add to Cart)
the customer is taken to the cart screen and the prices are displayed.
Can we get the + sign removed along with the price if the customer is not logged in??
Thanks, and Great Work!
bob
Last edited by i2Paq on Fri Jun 11, 2010 2:38 pm, edited 1 time in total.
Reason: Split from 1.4.8 Bug topic + title change + moved
Reason: Split from 1.4.8 Bug topic + title change + moved
Sure
1. EDIT:
catalog/view/theme/default/template/module/latest_home.tpl
catalog/view/theme/default/template/module/featured_home.tpl
catalog/view/theme/default/template/module/special_home.tpl
catalog/view/theme/default/template/module/bestseller_home.tpl
catalog/view/theme/default/template/product/special.tpl
catalog/view/theme/default/template/product/category.tpl
catalog/view/theme/default/template/product/manufacturer.tpl
catalog/view/theme/default/template/product/search.tpl
catalog/view/theme/default/template/product/product.tpl
2. IN ALL FILES CHANGE:
3. TO:
1. EDIT:
catalog/view/theme/default/template/module/latest_home.tpl
catalog/view/theme/default/template/module/featured_home.tpl
catalog/view/theme/default/template/module/special_home.tpl
catalog/view/theme/default/template/module/bestseller_home.tpl
catalog/view/theme/default/template/product/special.tpl
catalog/view/theme/default/template/product/category.tpl
catalog/view/theme/default/template/product/manufacturer.tpl
catalog/view/theme/default/template/product/search.tpl
catalog/view/theme/default/template/product/product.tpl
2. IN ALL FILES CHANGE:
Code: Select all
<?php } ?>
<?php } ?>
<a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a>
Code: Select all
<?php } ?>
<a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a>
<?php } ?>
After i did, i still can see the small cross icon in the related product section.Qphoria wrote:Sure
1. EDIT:
catalog/view/theme/default/template/module/latest_home.tpl
catalog/view/theme/default/template/module/featured_home.tpl
catalog/view/theme/default/template/module/special_home.tpl
catalog/view/theme/default/template/module/bestseller_home.tpl
catalog/view/theme/default/template/product/special.tpl
catalog/view/theme/default/template/product/category.tpl
catalog/view/theme/default/template/product/manufacturer.tpl
catalog/view/theme/default/template/product/search.tpl
2. IN ALL FILES CHANGE:3. TO:Code: Select all
<?php } ?> <?php } ?> <a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a>
Code: Select all
<?php } ?> <a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a> <?php } ?>
MAy i know which file can i edit it?
Thanks
Hi,
I've just come across this in the 1.4.8b install, and moving the add to cart button obviously fixes the
problem of stopping people from adding things to the cart and seeing prices when 'display prices to logged in users only' is set however. The actual cart controller and template do not seem to check for this setting at all.
What this means is that people that know open cart, or have ever seen an openCart site can easily modify the url
and find out pricing that is supposed to be hidden from them if they're not logged in.
If you're not logged in and prices are set to be hidden from guest users, simply going to
http://<my_site>/index.php?route=checkout/cart&product_id=30
http://<my_site>/index.php?route=checkout/cart&product_id=42
etc ...
or another product ID will add an item to the cart and show you the item pricing and total on the cart page.
To fix this issue for my current project I've added taken the following code from the category controller:
I added that code to the very beginning of the index() method and wrapped a conditional around $_GET and $_POST incoming product check like so :
It is pretty plain, but I think if you're locking your store down to registered users only (like in my case) and want to hide pricing from everyone else, the cart really shouldn't be handling any incoming product actions either.
In addition to that I've wrapped the form on the cart.tpl in a conditional too:
So the fix is quite simple (in my case) I'm sure the check for the display price setting will be added to the cart and other areas of openCart in future versions. If it has been fixed in a patch already, I do apologise for the double post.
If not maybe this will help someone else out there in the meantime.
I've just come across this in the 1.4.8b install, and moving the add to cart button obviously fixes the
problem of stopping people from adding things to the cart and seeing prices when 'display prices to logged in users only' is set however. The actual cart controller and template do not seem to check for this setting at all.
What this means is that people that know open cart, or have ever seen an openCart site can easily modify the url
and find out pricing that is supposed to be hidden from them if they're not logged in.
If you're not logged in and prices are set to be hidden from guest users, simply going to
http://<my_site>/index.php?route=checkout/cart&product_id=30
http://<my_site>/index.php?route=checkout/cart&product_id=42
etc ...
or another product ID will add an item to the cart and show you the item pricing and total on the cart page.
To fix this issue for my current project I've added taken the following code from the category controller:
Code: Select all
if (!$this->config->get('config_customer_price')) {
$this->data['display_price'] = TRUE;
} elseif ($this->customer->isLogged()) {
$this->data['display_price'] = TRUE;
} else {
$this->data['display_price'] = FALSE;
}
Code: Select all
if ( $this->data['display_price'] )
{
if ($this->request->server['REQUEST_METHOD'] == 'GET' && isset($this->request->get['product_id'])) {
...
} elseif ($this->request->server['REQUEST_METHOD'] == 'POST') {
...
}
} // END 'display price' fix
In addition to that I've wrapped the form on the cart.tpl in a conditional too:
Code: Select all
<?php if ($display_price) { ?>
<form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="cart">
...
</form>
<?php } ?>
If not maybe this will help someone else out there in the meantime.
Good find!. fixed in 1.4.9 RC2krollster wrote: What this means is that people that know open cart, or have ever seen an openCart site can easily modify the url
and find out pricing that is supposed to be hidden from them if they're not logged in.
If you're not logged in and prices are set to be hidden from guest users, simply going to
http://<my_site>/index.php?route=checkout/cart&product_id=30
http://<my_site>/index.php?route=checkout/cart&product_id=42
etc ...
@krollster
I have done the fix originally described in this post but I agree with your observations about adding items to cart if you know your way around an OpenCart site.
However I am not sure which file or files I should make your suggested changes to - can you give more information please?
Thank you
robster
I have done the fix originally described in this post but I agree with your observations about adding items to cart if you know your way around an OpenCart site.
However I am not sure which file or files I should make your suggested changes to - can you give more information please?
Thank you
robster
I know my place...!
OK so I have removed every + sign so that they don't show when not logged in. However when the customer logs in they are ALL there again. Now I am sure that this is how the script is meant to function, however the annoying thing is that adding items to cart using the + sign works completely differently to adding items to cart using the 'add to cart' button.
Clicking the + sign adds items to the cart and shows the cart page (very slow method for shopping), whilst clicking the 'add to cart' button uses the nice ajax feature but remains on the same page. Why offer two add to cart methods that do different things??
How do I either, a) remove all + signs EVEN when logged in OR, b) get them to add the items to cart the same ajax way.
Sorry about the perhaps longwinded way of explaining but hopefully somebody will have the solution.
Cheers
Rob
Clicking the + sign adds items to the cart and shows the cart page (very slow method for shopping), whilst clicking the 'add to cart' button uses the nice ajax feature but remains on the same page. Why offer two add to cart methods that do different things??
How do I either, a) remove all + signs EVEN when logged in OR, b) get them to add the items to cart the same ajax way.
Sorry about the perhaps longwinded way of explaining but hopefully somebody will have the solution.
Cheers
Rob
I know my place...!
Also I notice that despite the fix posted here for not showing the + sign when not logged in - they still show when viewing 'related products'. Can somebody show me where to remove these + signs please also.
Q, did you update 1.4.9.2 to fix krollster's points?
Cheers
robster
Q, did you update 1.4.9.2 to fix krollster's points?
Cheers
robster
I know my place...!
Hmm weird as I am using fresh install of 1.4.9.1 just installed today and they are there.....
Any way I would still be grateful if you could tell me which file i edit to remove them - everywhere else is indeed fine.
robster
Any way I would still be grateful if you could tell me which file i edit to remove them - everywhere else is indeed fine.
robster
I know my place...!
Who is online
Users browsing this forum: Bing [Bot] and 30 guests