Move add to cart

  • Posts: 147
  • Thank you received: 6
5 years 9 months ago #304032

-- url of the page with the problem -- : advancn.org/amen-code/edu-courses-traini...ings-of-jesus-christ
-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.3

Hello,
I have read your previous article ( www.hikashop.com/forum/4-how-to/76246-ch...-to-cart-button.html ),
but its seems to be old.

Please see image.
I would like to move the "add to cart" button to the uppermost right.
From reading your previous articles, I should find the following code in DISPLAY> VIEWS> VIEW: product :: FILE: quantity

Q 1. IS THIS STILL THE CORRECT CODE?( AS I COULD NOT FIND IT)
<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
<?php
$this->row = & $this->element;
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>
</div>

Q 2. TO WHERE, DO I MOVE THE CODE?
DISPLAY> VIEWS> VIEW: ? :: FILE: ?

Thank you for your assistance,

Wrina

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
5 years 9 months ago #304039

Hello,

First, in Main HikaShop Configuration, in Advanced tab and in Advanced settings, you will find the "Display view files option", switch it to All


Result :


With this it's easy to get which view you have to edit or where you can place your elements.
Second step, To get your "add to cart" button you will find it in your product page view (show_default, show_reversed or show_tabular depends from your configuration) your Quantity "call" to display show_quantity view.
By example, in the show_default view this code is around line 138



The tricky stuff, in your case is that you have in the same block quantity, whishlist and other product data, if you just use your "add to cart" button, you can simply move the block shown in my previous image.

If you want use other product data that depends from show_quantity view, you can have 2 calls for the view, just add different div class to use css.
Then with Css command you will be able to choose what you want to display :
Ex :
<style>
.show_quantity1 quantity,
.show_quantity1 whishlist {
display: none;
}
</style>
<div class="show_quantity1">
- Quantity
- Add to cart
- Whishlist
</div>

Last edit: 5 years 9 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 147
  • Thank you received: 6
5 years 9 months ago #304063

Hello Philip,
When I attempt to make the adjustments I receive error message: 0 syntax error, unexpected '<'

I have moved the button parameters from line 184-192 to line range 88 as follows, but it is not working.
Please advice on proper coding.
Thanks Wrina.

Last edit: 5 years 9 months ago by Jerome. Reason: removing code. Please do not paste all view content and use the [code] tag to paste code in the forum

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 9 months ago #304070

Hello,

I'm sorry but I had to delete the code you paste in our forum since it was not readable.
If you want to paste some code, you can use the "code" tag but you should not paste the full content of a view like that in our support forum.

The error indicate that in a file, there is a "<" character within some PHP code. Probably an HTML tag with a missing PHP closure ("?>") before.
Dont hesitate to use the PHP debug mode and PHP error display in order to have more details about your issue and location (file and line).

Please understand that our support can help you with the understanding of HikaShop concept and how our views are structured ; but as you understand, we need to place limit on what our support can do regarding customization.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum