How to put "add2cart" button above wishlist button

  • Posts: 27
  • Thank you received: 0
11 years 4 months ago #151135

Please look at the screenshot in the attachment. I should tell everything what is want to. ;)

Best Regards
ff87

Attachments:
Last edit: 11 years 4 months ago by ff87.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #151152

Hello,
Using some CSS code will probably do the job.

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

  • Posts: 27
  • Thank you received: 0
11 years 4 months ago #151335

Thanks for the link which is useful for me.
Apart from that, I don´t think that it has something to do with CSS as content from tables can´t be changed with CSS. It must have to do with PHP, what do you think?

In the attachment, you can see what I mean.

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #151372

Hi,

Indeed it will require php edition because actually the add to cart button is in a table.
To have what you want, you will have to edit the file "administrator/components/com_hikashop/helper/cart" function "displayButton()" to edit the HTML part.

This will be changed in a future release, to allow an easiest edition of the add to cart button.

The following user(s) said Thank You: ff87

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

  • Posts: 27
  • Thank you received: 0
11 years 4 months ago #151583

Dear Xavier,

unfortunately, I can´t find the code of the button to move it above the code of the wishlist button. I was looking for this:

<input class="btn button hikashop_cart_input_button art-button" name="add" value="In den Warenkorb" onclick="var field=document.getElementById('hikashop_product_quantity_field_1');if(hikashopCheckChangeForm('item','hikashop_product_form')){ return hikashopModifyQuantity('1',field,1,0,'cart'); } else { return false; }" type="submit">


Can you give me a boost how to do it correctly?
There is only the table for the + and - buttons somehow.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #151619

Hi,

You have to edit that code:

					<table>
						<tr>
							<td rowspan="2">
								<input id="hikashop_product_quantity_field_'.$i.'" type="text" value="'.JRequest::getInt('quantity',$min_quantity).'" class="hikashop_product_quantity_field" name="quantity" onchange="hikashopCheckQuantityChange(\'hikashop_product_quantity_field_'.$i.'\','.$max_quantity.','.$min_quantity.');" />
							</td>
							<td>
								<a id="hikashop_product_quantity_field_change_plus_'.$i.'" class="hikashop_product_quantity_field_change_plus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange(\'hikashop_product_quantity_field_'.$i.'\',1,'.$max_quantity.','.$min_quantity.');">+</a>
							</td>
							<td rowspan="2">
								'.$html.'
							</td>
						</tr>
						<tr>
							<td>
								<a id="hikashop_product_quantity_field_change_minus_'.$i.'" class="hikashop_product_quantity_field_change_minus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange(\'hikashop_product_quantity_field_'.$i.'\',0,'.$max_quantity.','.$min_quantity.');">&ndash;</a>
							</td>
						</tr>
					</table>
To putthe add to cart button out of the table, and then with some css properties you will be able to display it as you want.
Here is an example of code to replace the table.
		<div class="hikashop_product_quantity_div hikashop_product_quantity_input_div_default">
			<input id="hikashop_product_quantity_field_<?php echo $i; ?>" type="text" value="<?php echo JRequest::getInt('quantity',$min_quantity); ?>" class="hikashop_product_quantity_field" name="quantity" onchange="hikashopCheckQuantityChange('hikashop_product_quantity_field_<?php echo $i; ?>',<?php echo $max_quantity; ?>,<?php echo $min_quantity; ?>);" />
		</div>
		<div class="hikashop_product_quantity_div hikashop_product_quantity_change_div_default">
			<div class="hikashop_product_quantity_change_div_plus_default">
				<a id="hikashop_product_quantity_field_change_plus_<?php echo $i; ?>" class="hikashop_product_quantity_field_change_plus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange('hikashop_product_quantity_field_<?php echo $i; ?>',1,<?php echo $max_quantity; ?>,<?php echo $min_quantity; ?>);">+</a>
			</div>
			<div class="hikashop_product_quantity_change_div_minus_default">
				<a id="hikashop_product_quantity_field_change_minus_<?php echo $i; ?>" class="hikashop_product_quantity_field_change_minus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange('hikashop_product_quantity_field_<?php echo $i; ?>',0,<?php echo $max_quantity; ?>,<?php echo $min_quantity; ?>);">&ndash;</a>
			</div>
		</div>
		<div class="hikashop_product_quantity_div hikashop_product_quantity_add_to_cart_div hikashop_product_quantity_add_to_cart_div_default">
			<?php echo $html; ?>
		</div>
With the corresponding CSS:
.hikashop_product_quantity_div .hikashop_product_quantity_field{height:20px;}
.hikashop_product_quantity_div{display: inline-block;}
.hikashop_product_quantity_add_to_cart_div{display:block; vertical-align: top;}
.hikashop_product_quantity_field{text-align: center;}

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

  • Posts: 27
  • Thank you received: 0
11 years 4 months ago #151684

Thanks for your help, Xavier.
But when I replace the table with your given code, I only get a blank page after a refreshing the page.

The replacement looks like this:

}else{
$html ='
<div class="hikashop_product_quantity_div hikashop_product_quantity_input_div_default">
<input id="hikashop_product_quantity_field_<?php echo $i; ?>" type="text" value="<?php echo JRequest::getInt('quantity',$min_quantity); ?>" class="hikashop_product_quantity_field" name="quantity" onchange="hikashopCheckQuantityChange('hikashop_product_quantity_field_<?php echo $i; ?>',<?php echo $max_quantity; ?>,<?php echo $min_quantity; ?>);" />
</div>
<div class="hikashop_product_quantity_div hikashop_product_quantity_change_div_default">
<div class="hikashop_product_quantity_change_div_plus_default">
<a id="hikashop_product_quantity_field_change_plus_<?php echo $i; ?>" class="hikashop_product_quantity_field_change_plus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange('hikashop_product_quantity_field_<?php echo $i; ?>',1,<?php echo $max_quantity; ?>,<?php echo $min_quantity; ?>);">+</a>
</div>
<div class="hikashop_product_quantity_change_div_minus_default">
<a id="hikashop_product_quantity_field_change_minus_<?php echo $i; ?>" class="hikashop_product_quantity_field_change_minus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange('hikashop_product_quantity_field_<?php echo $i; ?>',0,<?php echo $max_quantity; ?>,<?php echo $min_quantity; ?>);">–</a>
</div>
</div>
<div class="hikashop_product_quantity_div hikashop_product_quantity_add_to_cart_div hikashop_product_quantity_add_to_cart_div_default">
<?php echo $html; ?>
</div>
';
}

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #151713

Hi,

Indeed, I gave you this code but I had not adapted it for this modification.
Thanks to try:

$html ='
<div class="hikashop_product_quantity_div hikashop_product_quantity_input_div_default">
<input id="hikashop_product_quantity_field_'.$i.'" type="text" value="'.JRequest::getInt('quantity',$min_quantity).'" class="hikashop_product_quantity_field" name="quantity" onchange="hikashopCheckQuantityChange(\'hikashop_product_quantity_field_'.$i.'\','.$max_quantity.','.$min_quantity.');" />
</div>
<div class="hikashop_product_quantity_div hikashop_product_quantity_change_div_default">
<div class="hikashop_product_quantity_change_div_plus_default">
<a id="hikashop_product_quantity_field_change_plus_'.$i.'" class="hikashop_product_quantity_field_change_plus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange(\'hikashop_product_quantity_field_'.$i.'\',1,'.$max_quantity.','.$min_quantity.');">+</a>
</div>
<div class="hikashop_product_quantity_change_div_minus_default">
<a id="hikashop_product_quantity_field_change_minus_'.$i.'" class="hikashop_product_quantity_field_change_minus hikashop_product_quantity_field_change" href="#" onclick="return hikashopQuantityChange(\'hikashop_product_quantity_field_'.$i.'\',0,'.$max_quantity.','.$min_quantity.');">–</a>
</div>
</div>
<div class="hikashop_product_quantity_div hikashop_product_quantity_add_to_cart_div hikashop_product_quantity_add_to_cart_div_default">
'.$html.'
</div>
';

The following user(s) said Thank You: ff87

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

  • Posts: 27
  • Thank you received: 0
11 years 4 months ago #151745

Thanks, Xavier.
This problem has already been solved but thanks anyway. *thumbs up*

Best Regards

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

Time to create page: 0.083 seconds
Powered by Kunena Forum