- Posts: 157
- Thank you received: 7
Move add to cart
- wrina iamwe
-
Topic Author
- Offline
Less
More
7 years 7 months ago #304032
by wrina iamwe
Move add to cart was created by wrina iamwe
-- 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
-- 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
Please Log in or Create an account to join the conversation.
7 years 7 months ago - 7 years 7 months ago #304039
by Philip
Replied by Philip on topic Move add to cart
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">
- [strike]Quantity[/strike]
- Add to cart
- [strike]Whishlist[/strike]
</div>
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">
- [strike]Quantity[/strike]
- Add to cart
- [strike]Whishlist[/strike]
</div>
Last edit: 7 years 7 months ago by Philip.
Please Log in or Create an account to join the conversation.
- wrina iamwe
-
Topic Author
- Offline
Less
More
- Posts: 157
- Thank you received: 7
7 years 7 months ago - 7 years 7 months ago #304063
by wrina iamwe
Replied by wrina iamwe on topic Move add to cart
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.
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: 7 years 7 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.
7 years 7 months ago #304070
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Move add to cart
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,
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.
Please Log in or Create an account to join the conversation.
Time to create page: 0.197 seconds