I want to display all the comments of one particular product in magento - magento-1.9.1

I want to display all the comments of one particular product in magento. For example for Each Product it have to show the comments of that particular product only.

If you want to display the Reviews on the product page you can use the code below:
Step 1. You have to edit the catalog.xml file you can find it by navigating to the app/design/frontend/YourPackage/YourTheme/layout/catalog.xml
Step 2. Add this block under the catalog_product_view
<block type="review/product_view_list" name="product.info.product_additional_data" as="product_review" template="review/product/view/list.phtml">
</block>
Step 3. Now call this particular block into the view.phtml page you can find it by navigating to the app/design/frontend/YourPackage/YourTheme/template/catalog/product/view.phtml
Step 4. Add this chunk of the code where you want to display the review on this page
<?php echo $this->getChildHtml('product_review') ?>
That's it hope it helps.
Thanks

Related

Customizing a BigCommerce product listing

This is a section of code for listing the name of a product in list-item.html:
<h4 class="listItem-title">
{{name}}
</h4>
Below the name, I would like to add "Date Added: " and the date it was added to the website, but only if the item is in the "What's New" category. I can't figure out the syntax for saying "If this product is in the What's New category, then display "Date Added: " and date it was added.
Does anyone have a clue where I would start to do this? I am still very new to BigCommerce.
You can use {{date_added}} to display the date that the product was added, but adding logic to display it in a specific category is a little more complex.
In list-item.html, {{category}} is scoped to the individual product being rendered, so doing something like the example below will only work if the item appears only in the What's New Category.
{{#if category '===' 'What's New'}}
{{date_added}}
{{/if}}
Another option would be to create a custom template for the category page. That would give you the control to create a custom list-item.html component that references {{date_added}} just on a certain category page. This video is a good starting point for creating custom templates, and you can find documentation here.

Prestashop: how to add fields to the order summary page

I'm working with Prestashop 1.6 and I need to add a checkbox and text field in the order summary page, as shown below.
I'm lost on which hooks to use to do so. These fields should be also shown in the invoice. For the hook of the invoice I believe it is the DisplayPDFInvoice hook, but for the order summary (display and get information) I don't know which hooks to use.
Can you give me some tips? Thanks for any help
You can use hook hookDisplayBeforeShoppingCartBlock to render any content on cart summary page. Don't forget to register this hook to your module.
I have tried using the same and got the results as below:
Code:
public function hookDisplayBeforeShoppingCartBlock()
{
return '<div>Text Area : </div><textarea rows="3" cols="30">This is a text area rendered from hookDisplayBeforeShoppingCartBlock</textarea><br><br><input type="checkbox" name="vehicle" value="Bike">checkbox 1<br><input type="checkbox" name="vehicle" value="Car">checkbox 2';
}
The above code is used just to show an example, you can render any template file from there. As you can see that this hook renders content above cart block so you can use javascript to move it below cart block.

Add image to Odoo survey

How should I add an image field to an odoo survey?
In a survey I need the option to upload an image (or even more than one).
I found this, but I can't figure where or what.
First of all, we have to give the creator of the survey the opportunity to add a binary field to a survey page (used for the image upload)
Create a custom model that inherits from the survey.question model. Add a ('binary','Upload') element in the state field.
Then on addons/survey/views/survey_views.xml find the with the id survey_question_form and change it accordingly (for example when you add a question of type Binary you might want to hide some elements that refer to other types of questions)
After that go to addons/survey/views/survey_templates.xml and add a template:
<template id="binary_field" name="Image">
<input type="image" class="form-control" t-att-name="prefix"/>
</template>
Then, on the same file, find the template with the id = page and add
<t t-if="question.type == 'binary'"><t t-call="survey.binary_field"/></t>
Start testing the whole process by restarting your server with -d your_database_name -u survey and move from there.
More changes might be needed in addition to what I have mentioned.

Adding Custom Product Detail Fields in BigCommerce Stencil?

We want to add custom fields that can be modified on the back end, yet also populate on the front end using custom fields. We have tried following, yet the fields didn't populate on the front end. See below for examples of the code and corresponding output:
Example Code
Result
How can we get these fields to properly populate on the front end?
I would start by reading the BigCommerce Stencil Documentation. The way you are calling the custom field values is not how they suggest calling these values.
The custom_fields are only accessible on the product detail page at this time in Stencil.
To display them on the product detail page, you can loop through each custom_field value with the following code.
{{#each product.custom_fields}}
<dt class="productView-info-name">{{name}}:</dt>
<dd class="productView-info-value">{{{value}}}</dd>
{{/each}}
You can check to see what values are available on each page by either reading the Stencil docs linked above, or debugging your page by removing the closing '/' and adding '?debug=bar' to the end of your localhost URL. Refresh your page and you will see all available store data in JSON format below the rendered page.
For more control over which custom field you output where you can create a reusable loop.
i.e. Create templates/components/products/custom-fields.html
{{#each product.custom_fields}}
{{#if name '===' ../custom_field}}
{{{value}}}
{{/if}}
{{/each}}
Then from your product_view.html you can specify the field value to output with a single line:
{{> components/products/custom-field custom_fields='custom field name'}}

Determining Last page position in xsl-fo

Can we somehow determine the position of the last-page in XSL-FO?
If I want to place my footer only on the last page, then how it could be done? As Input data varies and is not static. So any number of pages can come depending on the data.
Hope, it's not too late. But anyway, for all interested people:
Create a page master
<fo:simple-page-master master-name="my-last-page">...</fo:simple-page-master>
and put your footer as a "region-after" into that master.
Add this to your repeatable-page-master-alternatives
<fo:conditional-page-master-reference page-position="last" master-reference="my-last-page"/>
This is how you could define the last page. I don`t know your structure but you can add this in a block and reference with your footer.
<fo:block id="LASTPAGE"></fo:block>