[Skip to main content](#vessel-content)

#   Vote View

##

- **[khashiz](/forum/user/61259-khashiz "View khashiz's Profile")**
- [![khashiz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/61259-khashiz "View khashiz's Profile") Topic Author
- [ Offline](/forum/user/61259-khashiz)

Less More

- Posts: 240
- Thank you received: 13
-
-

3 years 2 weeks ago [\#355898](#355898) by [khashiz](/forum/user/61259-khashiz "View khashiz's Profile")  *[Vote View](/forum/42-vote/907138-vote-view#355898 "-- HikaShop version -- : 5.0.0 -- Joomla version -- : 4.3.4 -- PHP version -- : 8.1  in hikashop view files, vote and comment form is located in show.php file  is there possibility to put the vote code in a partial view (like &quot;show&#95;block&#95;img.php&quot; or &quot;show&#95;block&#95;tags.php&quot;) so thatt i can put the comment section wherever i want regarding to the project UI design ?")* was created by *[khashiz](/forum/user/61259-khashiz "View khashiz's Profile")*

-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.3.4
-- PHP version -- : 8.1

in hikashop view files, vote and comment form is located in show.php file

is there possibility to put the vote code in a partial view (like "show_block_img.php" or "show_block_tags.php") so thatt i can put the comment section wherever i want regarding to the project UI design ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQyLXZvdGUvOTA3MTM4LXZvdGUtdmlldz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14286
-
-

3 years 2 weeks ago [\#355902](#355902) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Vote View](/forum/42-vote/907138-vote-view#355902 "-- HikaShop version -- : 5.0.0 -- Joomla version -- : 4.3.4 -- PHP version -- : 8.1  in hikashop view files, vote and comment form is located in show.php file  is there possibility to put the vote code in a partial view (like &quot;show&#95;block&#95;img.php&quot; or &quot;show&#95;block&#95;tags.php&quot;) so thatt i can put the comment section wherever i want regarding to the project UI design ?")*

Hi,

Yes and no. If you configured the "Choose which module you want to enable" setting of the HikaShop configuration to "Vote &amp; Comment connected", the vote and comment have to be submitted by the user in the same form, which forces you to have them in the same area. That's why we have them in the same view.
Actually, if you want to display the vote elsewhere on the product page, and supposing that you set the "Choose which module you want to enable" setting to "vote only" or "vote &amp; comment", then, a vote only area is displayed by default on the right side of the product page, with the code: Code:

&lt;!-- VOTE --&gt; &lt;div id="hikashop_product_vote_mini" class="hikashop_product_vote_mini"&gt;&lt;?php if($this-&gt;params-&gt;get('show_vote_product')) { $js = ''; $this-&gt;params-&gt;set('vote_type', 'product'); $this-&gt;params-&gt;set('vote_ref_id', isset($this-&gt;element-&gt;main) ? (int)$this-&gt;element-&gt;main-&gt;product_id : (int)$this-&gt;element-&gt;product_id ); echo hikashop_getLayout('vote', 'mini', $this-&gt;params, $js); } ?&gt;&lt;/div&gt; &lt;!-- EO VOTE --&gt;

As you can see, it uses the vote / mini.php view file as it only contains the vote form.
And this can be moved anywhere in the show_default product page layout view file with the drag &amp; drop editor.

The following user(s) said Thank You: [khashiz](/forum/user/61259-khashiz "View khashiz's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQyLXZvdGUvOTA3MTM4LXZvdGUtdmlldz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[khashiz](/forum/user/61259-khashiz "View khashiz's Profile")**
- [![khashiz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/61259-khashiz "View khashiz's Profile") Topic Author
- [ Offline](/forum/user/61259-khashiz)

Less More

- Posts: 240
- Thank you received: 13
-
-

3 years 2 weeks ago [\#355917](#355917) by [khashiz](/forum/user/61259-khashiz "View khashiz's Profile")  Replied by *[khashiz](/forum/user/61259-khashiz "View khashiz's Profile")* on topic *[Vote View](/forum/42-vote/907138-vote-view#355917 "-- HikaShop version -- : 5.0.0 -- Joomla version -- : 4.3.4 -- PHP version -- : 8.1  in hikashop view files, vote and comment form is located in show.php file  is there possibility to put the vote code in a partial view (like &quot;show&#95;block&#95;img.php&quot; or &quot;show&#95;block&#95;tags.php&quot;) so thatt i can put the comment section wherever i want regarding to the project UI design ?")*

by your explanations i get how to place "vote" anywhere i want.
but how about the comment form ?

how i can change the display place of comment form ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQyLXZvdGUvOTA3MTM4LXZvdGUtdmlldz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14286
-
-

3 years 2 weeks ago [\#355921](#355921) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Vote View](/forum/42-vote/907138-vote-view#355921 "-- HikaShop version -- : 5.0.0 -- Joomla version -- : 4.3.4 -- PHP version -- : 8.1  in hikashop view files, vote and comment form is located in show.php file  is there possibility to put the vote code in a partial view (like &quot;show&#95;block&#95;img.php&quot; or &quot;show&#95;block&#95;tags.php&quot;) so thatt i can put the comment section wherever i want regarding to the project UI design ?")*

Hi,

That's complex.
The comment form is inside its own form. And the product layout (show_default for example) is also inside its own form.
And in HTML you can't have a form inside a form.
So if you edit the view file product / show.php, you can see the code to display the product page layout near the top with the code: Code:

&lt;form action="&lt;?php echo hikashop_completeLink('product&amp;task=updatecart'); ?&gt;" method="post" name="hikashop_product_form" onsubmit="return hikashop_product_form_check();" enctype="multipart/form-data"&gt; &lt;?php $this-&gt;variant_name =''; if(!empty($this-&gt;element-&gt;variants) &amp;&amp; $this-&gt;config-&gt;get('variant_increase_perf', 1) &amp;&amp; !empty($this-&gt;element-&gt;main)) { foreach(get_object_vars($this-&gt;element-&gt;main) as $name =&gt; $value) { if(!is_array($name) &amp;&amp; !is_object($name)) { if(empty($this-&gt;element-&gt;$name)) { if($name == 'product_quantity' &amp;&amp; $this-&gt;element-&gt;$name == 0) { continue; } $this-&gt;element-&gt;$name = $this-&gt;element-&gt;main-&gt;$name; continue; } } if($this-&gt;params-&gt;get('characteristic_display') == 'list' &amp;&amp; !empty($this-&gt;element-&gt;characteristics) &amp;&amp; !empty($this-&gt;element-&gt;main-&gt;characteristics)) { $this-&gt;element-&gt;$name = $this-&gt;element-&gt;main-&gt;$name; } } } $this-&gt;setLayout($this-&gt;productlayout); echo $this-&gt;loadTemplate(); if($this-&gt;productlayout != 'show_tabular') { ?&gt; &lt;input type="hidden" name="cart_type" id="type" value="cart"/&gt; &lt;input type="hidden" name="add" value="&lt;?php echo !$this-&gt;config-&gt;get('synchronized_add_to_cart', 0); ?&gt;"/&gt; &lt;input type="hidden" name="ctrl" value="product"/&gt; &lt;input type="hidden" name="task" value="updatecart"/&gt; &lt;input type="hidden" name="return_url" value="&lt;?php echo urlencode(base64_encode(urldecode($this-&gt;redirect_url))); ?&gt;"/&gt; &lt;/form&gt; and a bit below, you have the code to display the comment form: [code] &lt;form action="&lt;?php echo hikashop_currentURL() ?&gt;" method="post" name="adminForm_hikashop_comment_form" id="hikashop_comment_form"&gt; &lt;div id="hikashop_vote_listing" data-votetype="product" class="hikashop_product_vote_listing"&gt; &lt;?php if($this-&gt;params-&gt;get('show_vote_product')) { //LAYOUT listing of the comments for this product $js = ''; if(isset($this-&gt;element-&gt;main)) { $product_id = $this-&gt;element-&gt;main-&gt;product_id; } else { $product_id = $this-&gt;element-&gt;product_id; } $this-&gt;params-&gt;set('product_id',$product_id); echo hikashop_getLayout('vote', 'listing', $this-&gt;params, $js); ?&gt; &lt;/div&gt; &lt;div id="hikashop_vote_form" data-votetype="product" class="hikashop_product_vote_form"&gt; &lt;?php //LAYOUT form to send a comment &amp; vote $js = ''; if(isset($this-&gt;element-&gt;main)) { $product_id = $this-&gt;element-&gt;main-&gt;product_id; } else { $product_id = $this-&gt;element-&gt;product_id; } $this-&gt;params-&gt;set('product_id',$product_id); echo hikashop_getLayout('vote', 'form', $this-&gt;params, $js); } ?&gt; &lt;/div&gt; &lt;input type="hidden" name="add" value="1"/&gt; &lt;input type="hidden" name="ctrl" value="product"/&gt; &lt;input type="hidden" name="task" value="show"/&gt; &lt;input type="hidden" name="return_url" value="&lt;?php echo urlencode(base64_encode(urldecode($this-&gt;redirect_url))); ?&gt;"/&gt; &lt;/form&gt;

Moving the comment form inside product_default is complex since you would end up with a form inside a form and you need to avoid that one way or another.
For example, for the show_tabular view file, we moved the form of the product page layout inside the layout excluding the bottom part of the layout so that the comment form could be in the tabs of the layout.

The following user(s) said Thank You: [khashiz](/forum/user/61259-khashiz "View khashiz's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQyLXZvdGUvOTA3MTM4LXZvdGUtdmlldz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.127 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
