Prestashop add to cart button doesn't work - prestashop

I have disabled price displays for visitors on my shop. So, they have to log in/register to see the prices.
To checkout, they have to register/log in too. Guess checkout being disabled.
However, I want to allow them to add the products to their cart even if they are not logged in and don't see the prices. They will only need to log in if they want to purchase/checkout.
If i enable price displays for visitors on my site, everything works fine. However, when I disable it, the add to cart button no longer works.
Suggestions on making it work for visitors too?

In prestashop/themes/yourtheme:
Edit product-list.tpl and products.tpl by adjusting the Smarty {if} statements surrounding the 'Add to cart' button/link so that the link shows even when prices are disabled.
Edit shopping-cart.tpl and shopping-cart-product-line.tpl by adding Smarty {if} statements to hide prices when users are not logged in.
There might be a few other places to edit, but that should get you started.

Related

BigCommerce 404 error when I try to access product that is "not visible" on the Storefront

I currently have a few products that are "not visible" on the storefront. I don't want the products to be showcased (appear on the landing page or in the "see all products" page, but I would like to have it be visible when users try to access it directly, for example if a friend shares a link of that product.
But currently when I try to share the link to a product that is "not visible" to my friend, he gets a 404 page not found error, I would like for him to see the product, even though it is not publicly visible, any idea how I achieve this?
When a product is set to be not visible, it will not show for anyone (except for those logged in to the admin panel) on the front end. You can try appending the query string "?showHidden=true" to the end of the URL you are sending your friends. This may allow them to view the product.
Otherwise, you would need to make the product visible and write some custom code to hide it from the general users, or use customer group visibility settings.
Edit to describe the process of using customer groups:
The simplest approach here might be the following:
Have your friend create a customer account on your store.
Assign them to a new customer group (see documentation here).
Add your hidden product to a new category.
Make sure the custom customer group has visibility to all categories, while the default customer group has access to select categories (check all except the new category with the hidden product)
As long as your friend is logged in to their customer account, they should be able to see the product, while your normal shoppers cannot! The one major downside to this is if you make any new categories, they will not automatically be visible to your default customer group, and you will have to manually add the visibility.

OroCommerce: Configurable Product display in storefront and backoffice

I've created configurable product (internet connection with different speed) following docs, in storefront I see dropdown with product vairants, all is ok.
But in backoffice (when editing shoppingList or creating order) there is always only one variant of product with no ability to quickly select another option (eg change speed to another one) - is this how oro backoffice works and nothing could be changed to make backoffice user quickly navigate between product variants (eg change speed from 1M to 2M by clients phone request)?
Cant even edit product in shopping list
UPD:
If there's no way to see user-friendly configurable product in backoffice than I need to implement smth like button near each product in LineItem which will show popup with product variants. When user will select another option request will be sent to some route and it will run smth like $lineItem->setProduct($newProduct); , grid reloaded and new product variant selected. Is it ok or it will break something in oro?
Where to start for adding that button and popup? Eg I cant edit oro shopping list template, how to properly extend it?
On the line item editing form you cannot change the product, no matter it's configurable or simple. It's done intentionally.
If you want to change the product, you always can remove a line item and add the new one with updated options manually:

PrestaShop Add To Cart button not working from single product page

Whenever the client clicks on the "Add To Cart" button from single product page, it simply goes to cart but cart items are not updated. It redirects to this URL /?controller=cart where all items added either from category view or grid view are there but not the one added from single product page.
I just need a hint on what might be the issue. I'm using Prestashop version 1.7.
Thanks!
It is most likely a JS error; open the browser's dev tools -> console and check the errors, you will notice them they're red.

Check condition when Add to car Button is clicked Prestashop

In my Prestashop web there are 3 types of products (In stock, On demand and Coming soon). When a user clicks on Add to cart button in product page, it should shows an alert saying the products cannot be mixed (you cannot buy a product in stock and a product on demand). I use BlockCart module but I cant find the file which I have to edit. Also, I have looked in CartController or ProductController but nothing.
Can you help me?
You Can check in controllers/front/CartController.php for processChangeProductInCart Function.

Make user stay on product view after clicking on "Add to Cart"

I'm using Hotcakes Commerce DNN modules and I'd like to know how I can allow the user to stay on the product page after the "Add to Cart" button is clicked. The default behaviour is to redirect the user to the cart page whenever the a product is added to the cart.
The easiest way to make this happen is to modify your viewset to change how the add to cart buttons work. Here's a summary of the required steps:
Add and begin modifying your viewset if you haven't started already.
Modify your \VIEWSETNAME\Views\Products_ProductDetails.cshtml file to change the add to cart action from a post, to an AJAX link. This will allow you to add products to cart directly using a link, but keep you on the page.
If you're using the Mini Cart, refresh the page using JS so that it updates appropriately.
Please note that this option won't work well if your products have choices. If this is the case, you should instead allow your customers to be directed to the cart page, and use a parameter there to determine whether or not you redirect back to the product page.