When products grid is being disaplyed we dont have option to buy that product user has to click n the link can we ADD another button which allows user to buy it before going into another level.
If yes where we can add that line of code and what all we need to modify
thanks in advance
If yes where we can add that line of code and what all we need to modify
thanks in advance
Try this...
/catalog/view/theme/yourtheme/template/product/category.tpl
paste this code where you want to have buy now button
/catalog/view/theme/yourtheme/template/product/category.tpl
paste this code where you want to have buy now button
Code: Select all
<a class="button_buy" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" ><?php echo $button_add_to_cart; ?></a>
CID, VAT ID / ICO, DIC (vQmod) for OC 1.5.x
Autofill SEO field (vQmod) for OC 1.4.x-1.5.x
This thing works great
add to cart text appears in the right place.
in case I want an image instead of text?
add to cart Image buy now image...
assuming my image name is buynow.jpg in images folder
how do we handle it
add to cart text appears in the right place.
in case I want an image instead of text?
add to cart Image buy now image...
assuming my image name is buynow.jpg in images folder
how do we handle it
Code: Select all
<a class="button" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" ><span><?php echo $button_add_to_cart; ?></span></a>
thanks to you
now other problem I am facing is.
some product name are longer and some are smaller
so the price and button are not aligned horizontally
one is up and other is down
is there a way i can align them in one line so that all look aligned or I should add more wors in the name for some products ?
I think, that you need absolute position in the box. For example i have my own product list style in divs (not in table).
HTML
CSS
This is one of the easiest ways. Another way is to cut the long names with PHP.
HTML
Code: Select all
<div class="product-block">
<img class="product-image" src="..." />
<h3>Title</h3>
<a class="button">button</a>
</div>
Code: Select all
.product-block {
position: relative;
float: left;
}
.product-block h3 {
position: absolute;
top: XYpx; /*must be min height of the picture*/
}
.product-block a.button {
/*if the element above was absolutly positioned, it is good to absolute position elements after, but it's not necessary*/
position: absolute;
top: XYpx; /*picture height + height of the longest product name*/
}
CID, VAT ID / ICO, DIC (vQmod) for OC 1.5.x
Autofill SEO field (vQmod) for OC 1.4.x-1.5.x
hi sir sorry
I was not able to do this.
Which files we have to add this code? i added in above file and experimented few things but was not able to get it going
sorry I am new with this, I request you if you can spare some of your precious time and guide me, where I need to add/edit this code it will be very kind of you.
I was not able to do this.
Which files we have to add this code? i added in above file and experimented few things but was not able to get it going
sorry I am new with this, I request you if you can spare some of your precious time and guide me, where I need to add/edit this code it will be very kind of you.
What you want to do is not about OpenCart, it's about your CSS skills
this is what you need. Look at the tab 4 and 6. That is the right method to have product price and the buy button forever at the bottom of the product block.
Apply this method in category.tpl, special.tpl etc. .. just apply this wherever you want
Code: Select all
http://www.barelyfitz.com/screencast/html-training/css/positioning/
Apply this method in category.tpl, special.tpl etc. .. just apply this wherever you want
CID, VAT ID / ICO, DIC (vQmod) for OC 1.5.x
Autofill SEO field (vQmod) for OC 1.4.x-1.5.x
Who is online
Users browsing this forum: No registered users and 21 guests