Add custom text box with dynamic text on every product page - prestashop

I want to add a couple of lines of dynamic text to my product description.
Like this text
What is the price of "product name" in Singapore?
The latest price of "product name" in Singapore is "product price" You can buy the "product name" at best price from our "store name" or visit "store address"
I don't want to visit every product page to add this.
And I want google to capture the question (attached picture)
https://ibb.co/3YJ8dmk
https://ibb.co/wS73jpr
How can I do it?

You should develop a simple module which uses one of the Prestashop product display hooks to show your dynamic informations.
A good starting point in module development is here

You can use one of theses hook to add your product custom fields (See the doc)
displayAdminProductsExtra
displayAdminProductsMainStepLeftColumnMiddle
displayAdminProductsMainStepLeftColumnBottom
displayAdminProductsMainStepRightColumnBottom
displayAdminProductsQuantitiesStepBottom
displayAdminProductsPriceStepBottom
displayAdminProductsOptionsStepTop
displayAdminProductsOptionsStepBottom
displayAdminProductsSeoStepBottom
See module demo to add custom fields https://github.com/PululuK/democustomfields17

Related

How do I get a field in odoo 15 from res.partner module shown in account.move?

In odoo 15 I have created a PDF report for invoices using a custom layout via an external module. The address of the customer is specified at the top left of the first page of the PDF report. The content comes from the record that was created via "Customer" (res.partner) and selected via the field "partner_id". After the selection, the street and postal code as well as city are loaded in the edit view of an invoice and thus transferred to the PDF document.
How can I extend or overwrite the address field in my custom report layout to create an own address field that comes from the customer data (model res.partner)? I have created an additional field there via a module (address_suffix) that can store an address addition. I would like to be able to include this custom field of res.partner in the address field at account.move and in the end into the PDF report.
To illustrate it:
I want this field (address_suffix in res.partner)
can be seen here (account.move):
You can check the OCA partner_address_street3 module. It is similar to yours, it adds a third street field (street3) to store additional address information.
The module extends the address format, so it should automatically show on reports
On your report xm, I think you can try using t-field and using widget contact inside the t-options tag.
Example:
<span t-field="partner_id" t-options='{"widget": "contact", "fields": ["address"]}'/>

Prestashop 1.7.6.9 display default category_name into email and backoffice order

I need to show:
"default category name" of the purchased products into email template
order_conf "default category name" of the purchased products into
backoffice > single order (where at the moment it shows product_name + reference)
BO > orders > order > purchased product
Would you give me some indication on the files to be modified to show the category name (default_category) of the purchased products?
I have searched around the web but I can't find any solution / instructions to do this
Thanks to anyone who will be able to help me
Prestashop 1.7.6.9
To show info in back office order detail you can use hook displayAdminOrderLeft.
For more info look at https://devdocs.prestashop.com/1.7/modules/concepts/hooks/list-of-hooks/
For mail you must change order_conf.html in mails directory.
To put extra data in template vars you can use actionEmailAddBeforeContent hook.
Thankyou Fran Cerezo for the indication to investigate.
To show Default Category name into hook "displayAdminOrderLeft", i opened
/admin123456/themes/default/template/controllers/orders/_product_line.tpl file
So i added
{if isset($product.id_category_default)}
{assign var='catname' value=Category::getCategoryInformations(array($product.id_category_default))}
{$catname[$product.id_category_default].name}
{/if}
Otherwise, to show the "default category name" in the order confirmation email (for single product purchased) I'm in trouble ..
The /mails/it/order_conf.html file declares the {products} variable.
Where do I find the template to edit the {products} variable and then add the category name information?
Where is the reference file located?
Thanks
{products variable into order_conf.html}

Showing different price on category page and single product page in variable product in 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.

Prestashop - VAT Number for guests and new accounts

I am using Prestashop 1.6
I would to know if there is a way to make the VAT Number field appear in the "Guest check out" and "New account" forms, but without being required (because some countries doesn't have VAT Number).
I tried to remove "VAT Number" from some countries in the Localization tab in the dashboard, but it didn't change anything, so the solution is not there.
Thank you !
I think I found the solution.
In your_shop/themes/default-bootstrap/order-opc-new-account.tpl
Remove the following line :
{elseif $field_name eq "vat_number"}

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).