prestashop free shipping issue - prestashop

I just upgraded firstly manually but later on by 1-click Upgradev1.0.13 to 1.5.4 version. I got a big problem on shopping cart with the shipping fees.
The cart located on homepage top left was solve not to show "FREE SHIPPING" from the previous code in this forum.
But once I checked on the shopping cart inside after I select and press "Update Carrier List" button and
press "Update Cart" button, the shipping fees is not updated but show as "FREE SHIPPING".
Could anyone suggest me solution about this? Thank you very much. I very much appreciate it.
My demo website is http://store.relishthai.com/.
You can try to add item by selecting the "TEA" tag and add one item to the cart and see the "FREE SHIPPING" problem.

I have had a very similar issue. The problem is that there is a Javascript file that updates the value to "FREE SHIPPING" if the value(shipping price) is equal to 0.00. I am using a different version, so I can't exactly point you to the file, but you can definitely solve this in three minutes. (Check order-opc.js in your theme/js folder)
View source of the web page and see what .js files are included. Search "FREE SHIPPING" in Javascript files (such as cart.js) and see which one is the culprit. Then go on FTP and change it to 0.00. I prefer "Free!" by the way ;)
EDIT: It seems like I misread your Q.
I tried pressing "Update carrier list" and then "Update cart", but I do not see the shipping fees as "Free shipping." Instead, I see 8 dollars.

Thanks again. Previously before your answer the $0.00 appeared in the top left cart on the page but later on after your comments I double checked things and deleted unused zone (no fees in there). And I tried to put the real shipping fees for all weight ranges. Now, the old problems has been solved but the shipping fees with weight ranges (in small ranges) still exits. I'll try to figure things out.
Many Thanks!!

Open the file /themes/xxx/modules/blockcart/blockcart.tpl
and remove this block of code (or comment):
<div class="layer_cart_row">
<strong class="dark">
{l s='Total shipping' mod='blockcart'} {if $display_tax_label}{if $priceDisplay == 1}{l s='(tax excl.)' mod='blockcart'}{else}{l s='(tax incl.)' mod='blockcart'}{/if}{/if}
</strong>
<span class="ajax_cart_shipping_cost">
{if $shipping_cost_float == 0}
{l s='Free shipping!' mod='blockcart'}
{else}
{$shipping_cost}
{/if}
</span>
</div>

Related

PrestaShop - Display shipping price and subtotal on shipping page

I am using
{displayPrice price=$total_price_without_tax}
{displayPrice price=$total_price}
on the cart and payment pages, but it doesn't work on the shipping page, it returns nothing. Is there a way to display those values on all checkout pages ?
Also,
{displayPrice price=$total_shipping_tax_exc}
works on the cart page but not the checkout nor the shipping ones... Can I fix this ?
Thank you.
These variables are not generated in that page, the easy way to create it inside a smarty template is:
{assign var="total_price_without_tax" value=Context::getContext()->cart->getOrderTotal(false)}
{assign var="total_price" value=Context::getContext()->cart->getOrderTotal()}
And now you can use as normally:
{displayPrice price=$total_price_without_tax}
{displayPrice price=$total_price}

Prestashop how to make modification on Add and Minus button in shopping cart

who knows what file controls the function for add and minus button in the shopping cart? I want to change the qty that is added or minus after any buttons is clicked.
this is the code for the ADD button
<a rel="nofollow" class="" id="" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add' mod='advancedcheckout'}"><span><i class="fa fa-plus"></i></span></a>
Changing add=1 is not making any changes. So At start I thought it was a JS or AJAX file, but the button continues working even after I deleted all classes and ID. So I think all this trick is made by the code in href=""
But where I can make the changes for the qty added? Who knows?
If I good understand. You should look at those file:
themes/defaylt-theme/js/product.js: line 424
themes/defaylt-theme/js/product.js: line 408
You have to check the
cart-summary.js
in your theme/js/ folder. This will contain the + and the - button events
function upQuantity
function downQuantity

Prestashop - out of stock list

I have a prestashop shop, when I sell t-shirts. Every t-shirt have several sizes (combinations), i.e. M, L, XL etc.
In blocklayered filter there are two filters: "Available" and "Out of stock" products, but they behave weirdly: "out of stock" filter shows products, that have 0 quantity in one/several sizes.
How can I modify this to show on "out of stock" list only products, that have no items available in ALL available sizes.
What I mean is when a t-shirt have 3 items in size M, but 0 in size L, I do not want it to show on "Out of stock" list.
The second thing is - how can I hide products, that are truly "out of stock" (no items in all combinations) from default category list page? What I want to achieve is that on category pages we have "Archive" tab, which should show products that used to be available in shop, but they are not anymore.
I use PS 1.6.1.9
Open www/themes/yourtheme/product-list (Dont forget to backup)
Search for
{assign var='nbLi' value=$products|#count}
Right below add
{foreach from=$products item=product name=products}
{if ($product.quantity <= 0)}
{$nbLi=$nbLi-1}
{/if}
{/foreach}
Search for
{foreach from=$products item=product name=products}
Right below add
{if ($product.quantity > 0)}
Search for
{/foreach}
Right above add
{/if}
Replace all instances of
$smarty.foreach.products.total
and
$smarty.foreach.products.iteration
with
$nbLi
This question was anwsered by MEG Venture in the prestashop forum.
https://www.prestashop.com/forums/topic/537182-disable-out-of-stock-product-from-listing-only/
There is a function in StockAvailable.php core class of PrestaShop that can be used to find the actual quantity of any option of a product.
StockAvailable::getQuantityAvailableByProduct()
You can simply run through a loop for every option of a product and find the quantity for all options and mark the product out of stock only if any option is not available.

Remove "Social Title" from order form in Prestashop?

I have just downloaded and installed the latest version of Prestashop. And found out there is a Social Title-option in order checkout form.
I want to remove that. I have found how to remove the Mr and Mrs boxes. But the whole row and label "Social Title" remains.
Have tried to search on Google for an answer but can't find. Some answers refer to the addresses.tpl. But I think the templates might been changed since these threads.
In fact, I have tried to search for "social" in the whole template directory and can't find anything related to this.
The nearest I get is in the ../templates/customer/_partials/customer-form.tpl. And I think it's rendered where this is:
<section>
{block "form_fields"}
{foreach from=$formFields item="field"}
{block "form_field"}
{form_field field=$field}
{/block}
{/foreach}
{/block}
</section>
So, maybe the social title isn't able to change from templates anymore?
So, where do I change it nowadays?
In Prestashop 1.7 there is no need to edit any code, you can just go to Shop Parameters -> Customer Settings -> Titles and remove all existing titles.
This will prevent the "Social title" field from being generated.
Shop Parameters -> Customer Settings -> Titles - Delete titles
themes/xxx/templates/_partials/form-fields.tpl 9th line change
{if $field.type !== 'checkbox'}
{$field.label}
{/if}
to
{if $field.type !== 'checkbox' and $field.type !== 'radio-buttons'}
{$field.label}
{/if}
Yeah, it's kind of dummy workaround, but it works.
UPDATE:
More proper way would be to comment the block:
$genderField = (new FormField)
->setName('id_gender')
->setType('radio-buttons')
->setLabel(
$this->translator->trans(
'Social title', [], 'Shop.Forms.Labels'
)
)
;
foreach (Gender::getGenders($this->language->id) as $gender) {
$genderField->addAvailableValue($gender->id, $gender->name);
}
$format[$genderField->getName()] = $genderField;
You can find it in /classes/form/CustomerFormatter.php
You can find the code for Social Titles in file at the following path:
/themes/default-bootstrap/identity.tpl
Note: It is not a good practice to remove the code from a core file, we recommend to apply some CSS to hide the Social Title block.

Can I add the custom fields to the product listing page in BigCommerce

Each product has the custom fields options. Can I output those custom fields on each product item in the product list page? If so, how? I have tried adding the ProductOtherDetails and the %%SNIPPET_ProductCustomFieldItem%% in the CategoryProductsItem.html, but got no output at all of any of the items I have tried. Any suggestions or pointers on how and if this is possible?
As of September 2015, you can now access %%GLOBAL_ProductCustomFields%% on any template file that renders a particular panel's individual items. For example:
-Snippets/CategoryProductsItem.html for category list pages
-Snippets/HomeFeaturedProductsItem.html for the featured products panel
I recommend adding the custom field name as a class to each field for easy hiding, and accessing of the value in case the custom fields ever change you won't be accessing them via :nth-child CSS which would break. You can do so by modify Snippets/ProductCustomFieldItem.html to add the custom field name to the CSS class or ID like this:
<div class="DetailRow %%GLOBAL_CustomFieldName%%">
<div class="Label">%%GLOBAL_CustomFieldName%%:</div>
<div class="Value">
%%GLOBAL_CustomFieldValue%%
</div>
</div>​
Doing so, will output like this in each item in the category list.
Above, I am using the custom fields to send through shipping time, as well as "Starting At" to prepend to the list page price if the item is a parent which has children of higher prices. In my opinion, these features greatly increase the user experience.
For Faceted Search (handlebars.js)
I recommend adding this to Panels/FacetedSearchProductGrid.html:
{{#each product.custom_fields}}
{{ id }} : {{ name }} : {{ value }}
{{/each}}
Those filters will be limited to the Product pages specifically. The only way around it is to hash together a solution using jQuery to go and fetch items in question from the product page. A pain, but do-able with unnecessary effort.