Showing different price on category page and single product page in variable product in bigcommerce - bigcommerce

Showing different price on category page and single product page in variable product in bigcommerce. I just want to show the lowest price on category page.
This is the category page: https://hilineelectronics.com/portable-audio/. In the first product price is showing $112.99 and after checking it quick view and single product page it is showing $83.99. I want $83.99 (varibale amount) amount there.
How can we do this? Any variable or code for this?
Thanks in advance.

Go to your CategoryProductsItem.html check the code
<em class="p-price">%%GLOBAL_ProductPrice%%</em>
Is there %%GLOBAL_ProductPrice%% call same or different with product details page.
ProductDetails.html
<span class="ProductPrice VariationProductPrice">%%GLOBAL_ProductPrice%%</span>
Compare both files global varriable.
The second way makes the backup and of the files and then revert it to the original.

Related

Prestashop add custom radio button on shipping carriers on front end checkout

I have created one custom module in Prestashop 1.7.8.7 which will add multiple shipping methods (Carrier) and will show shipping cost based on product dimensions and delivery address. So shipping carrier will look something like this on front-end checkout page. https://prnt.sc/E1avDASyJYYW
Now if someone select SameDay Courier Shipping then i need to show two radio button to select which service they want.
It will have two radio options like
Delivery pickup (by default this option will be selected)
Locker pickup
So if someone select Delivery pickup then it will have different shipping cost and if someone select Locker pickup then it will have different shipping cost.
Can anybody help me how can i achieve this functionality.
While digging, i found that we have file called DeliveryOptionsFinder.php and in that file we have one public function called getDeliveryOptions() where we have this line of code
if ($moduleId = Module::getModuleIdByName($carrier['external_module_name'])) {
$carrier['extraContent'] = Hook::exec('displayCarrierExtraContent', ['carrier' => $carrier], $moduleId);
}
}
So if i set is_module to 1 to all my carriers directly from DB then on frontend checkout page, no carriers is being displayed.
Thanks in advance.
I've already done something like this in the last 2 year as prestashop developer.
The truth is that you can't achieve what you want by "respecting" prestashop processes.
Maybe you can hook using a module the hookDisplayCarrierExtraContent($data) and then return the 2 radios if carrier is certain one (use $data).
But you can't handle a form submit or something else, or include it to prestashop checkout data.
But what you can do as workaround, for example, is the following.
In your module, as I said, hook the extra content, render a template with the 2 radios. Hook displayHeader too and use $this->context->controller->addJS() to add your own js if the current controller is the checkout one.
Then in this JS code you can handle the "change" event of the radios and send an ajax request to your module.
You can create inside {your_module}/controllers/front/ a controller called, for example, radio-choose and handle the js ajax request by saving inside your own table the choosen one.
Obviously you can disable the "next" button in checkout untill one of the two radios are selected, or maybe you can just set a radio button as default one to simplify.
For example your table "ps_cart_choosen_radio" could look like this |id_cart|choosen_radio|.
Then you have all the data you needed. When a cart is converted into an order you will have inside Order object (and ps_orders table as well) the id_cart.
Just select / join choosen radio from your own table by using order's id_cart.
"SELECT choosen_radio FROM ps_cart_choosen_radio WHERE id_cart = {$order.id_cart}"
If you need to show data depending on choosen_radio in frontend you can hook everywhere an order is present and select these data. Or maybe you can edit carrier name in ps_orders table by adding a piece of string. Let' say carrier is "express" and customer choosed "24h". You can update that column with carrier name by changing it to "express-24h" so around the whole prestashop ecosystem everybody will see that's a 24h choice.
Remember that the carrier name related to an order is not the carrier name inside the carriers table. So you can edit it without having trouble.
All these problems comes from the "need" to show some nested choices instead of listing all these in the main selections. In that case it would be easy (just create carrier in the prestashop backoffice)

Prestashop: Producto with price 0 in category page

I have a prestashop 1.6 web.
I have this product, with a price of 19€. The product page is showing the correct price.
http://batavia.es/es/escuadra-y-cartabon-2395.html
But the price is 0 in the category page:
http://batavia.es/es/unisex-116158?p=2
I have this problem only with this product. I have checked the product in admin panel, and it seems correct. The product have not discounts or specific prices. I have debugged the php object, and it has the price attribute to 0.
Anything that I can try?
Thanks.
The product price can be fetched using the getPriceStatic() function in Product.php class file, you can try debugging this function for the product which is causing the issue.
You might be able to find the problem with that product.

CSV Imported categories not listed in PrestaShop Catolog->Categories

I am using PrestaShop Version 1.6.1.4.
I have created a CSV for Categories and uploaded it successfully but the catogories and the sub-categories are not shown in Catolog->Categories. When I configure a Module "Top Horizontal Menu" in that under Available items Categories can be seen and added to UI as well. When I click on the category in UI 404 error pages comes.
Any idea how to fix this?
Thanks in advance.
The below image is from Top Horizontal Menu Module where JEWELLERY is category and the other below them are sub category.
Thw below image shows that the categories CSV is uploaded successfdully
But it is not listed under Catolog->Categories refer the below image for this
First when I added categories from CSV, the categories is not getting displayed in Catalog->Categories but when I add one category manually then it is displayed in Catalog->Categories but cannot add subcategories to it.
I think there should be some issues in Presta Shop.
For example : I manually added "Testing" as one category. It was added as main category by default. Then both "Home" and "Testing" categories can be seen in Catalog ->Categories.
After this I tried to add the subcategories to "Home" categories through CSV, it worked out.
PrestaShop is expecting the category to be listed in Catalog->Categories to add the subcategories to it even if that particular category is in DB.
Now I can add the sub categories to what ever Main Categories needed and also the products are also getting listed under the subcategories through CSV.
But I dont know why it is not getting added to Catalog->Categories initially when I add from CSV.
Now in DB ps_category table the records are as expected as you have listed.
This is the default Prestashop categories (table ps_category). Please check if you have only one row with is_root_category = 1. This must be a category ID 2 (id_category = 2), your site Home category.
And please check if all three categories ID 1, 2, 3 in your table looks the same in columns id_parent, id_shop_default, level_depth, is_root_category.

Bigcommerce - add category name to product page layout

I'm changing a theme in Bigcommerce, and I should put the product Category name in Product page layout, but there isn't any panel that could do that, and I don't really know is it possible?
I can get the list of all categories, but that's not what I want, and I would like to do it without unecessary JavaScript.
So, for example..
I have few categories, and when I'm in each of that categories product, this product category should be writen.
Category - Product - Headline ( should be writen in this page )
Car - Honda - Car
Cloth - Shirt - Cloth
etc..
If anyone knows how it can be made, it would be very appreciated.
Thanks!
I believe the only place the category is pulled onto the product page is through the product breadcrumbs. You could use a simple Javascript to get the category set in the product breadcrumbs and then display it somewhere else.
Something like
Get breadcrumbs
Find the item before the ones that matches the product name
Set it's text as a variable
Set the element where you actually want the cat name to appear to contain the text of the var

How to fix price error for a product in Magento?

I am trying to fix this product listing: http://shop.crystalvine.com/salt/blueberrysalt-c.html
You see in the dropdown there is an option for "refill" which is supposed to say $10.95 but says $45.95
When I log into Magento and click on Catalog --> Manage Products
There are f different listings for this product, differentiated by size/price. I try to edit the price by clicking "edit" on the product and under the price option on the left I edit the price and save.
But doing that to the products does not change the price on the live site when I edit the price for them.
Am I doing something wrong there? How do I change the price?
Thanks!!
This is a configurable product.
Make sure you change the price for the simple product having that option or in the configurable product page, choose "Associated products" and make the price change there.
Then you probably must reindex your catalog (System -> Index managment).