Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - PureMart (SKU# FLEX-00010)

TOPIC: Add a new badge to the product

Add a new badge to the product 11 years 4 months ago #1500

Hi,

I would like to know how can I add a new badge to the products. Well, we have the featured, new, etc.. badges, so I need to create an other one, and name it GIFT or BONUS, and be displayed over the products images as the orginals when at that product I add an other free product as gift.

It´s that possible? In the case wich are the files I have to modify and what are the modifies I have to do.

Thank you
The topic has been locked.

Add a new badge to the product 11 years 4 months ago #1530

Hi,

If you are saying, you want to add another one, it would depend on the condition.. the condition is all the matter and how can you define that condition?... through PHP

For example, the NEW badge is easy, all we have done was; subtracting the today's day from the creation day, if the remaining is less than the "time-frame" which is selected through "Flexible VM2 Plugin" then the NEW badge is appeared.

Discount badge is also relatively easy, if the final price is less than the tax with/without price, the discount badge appears.
"Featured Product" badge, is the easiest badge, there is "checkbox" in the VM Backend, our VM Template check that checkbox, if it is clicked, it shows the "FEATURED" badge.

You see, the condition is a requirement so you can run
<?php if (something=something) { show the badge } ?>
Most like likely having this: <span class="bonusbadge"></span>
Is the easiest way to show the badge, so you can control its stylizing through CSS by having a CSS rules something like this (in any CSS loaded in the website):

.
.bonusbadge {
	background: // this will be the badge figure;
	width: // width size of the figure;
	height: //height size of the figure;
	position: absolute; //you would need this to have the badge stays above the product thumbnail.
	top: 0px;  // stick to the top of the product thumbnail.
	right:0px;	// stick to the right side of the product/
	z-index:9999; //stays above the thumbnail. Z-index represents the z-direction (there are x,y,z directions in 3D right?
}

It is all up to you to get the condition to run this if.....end in php to show <span class="bonusbadge"></span> or hide it . And you most likely show that badge in the category browse page, so the PHP file of the category browse page is this:

ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/category/default.php
(default.php, defaultlist.php, flexv2.php or flexv2list.php depends on which layout you have chose from VM configuration)

I can't help you more than this, i can't give you a tutorial to achieve what you are looking for because this is not the purpose of this forum. This forum is our support section and we are providing free support here. We are solving the problem that occurs after installing our VM Template/extension.

Regards.
Last Edit: 11 years 4 months ago by Support.
The topic has been locked.

Add a new badge to the product 11 years 4 months ago #1545

Ok...Thank you very much....Very grateful for your explications....You have right it´s not an after installation problem.... Sorry for open this topic....
The topic has been locked.

Add a new badge to the product 11 years 4 months ago #1559

No prob.

topic is closed.
The topic has been locked.
Time to create page: 0.102 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo