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

TOPIC: Availaibility info not display + PREORDER TAG

Availaibility info not display + PREORDER TAG 8 years 4 months ago #13478

Hi

When you enter a date on availability date +availability picture in the product admin

Attachment availability3.png not found




The availability picture + availability date are not showing on cleanmart category + product detail (see pictures)
On product detail page it is showing product in stock and ships in 48 hours which is wrong:

Attachment availaibility5.png not found




Attachment availability.png not found



Attachment availabaility2.png not found




+


would it be possible to create a PREORDER tag like the NEW, ON SALE... tags

exemple: we can create a product that will be available in 1 month time (availability date) for customer but customer can order right now before the 1 month on preorder
the product will have a PREORDER TAG

Attachment 2015-12-2117_57_23-.png not found




Would you be kind enough to show me how to do it? it is a very important feature i need for my shop

thnak you very much
Last Edit: 8 years 4 months ago by M grano.
The administrator has disabled public write access.

Availaibility info not display + PREORDER TAG 8 years 4 months ago #13525

Hi,

The first patch is;

1- open this PHP file:
/templates/YOUR_TEMPLATE/html/com_virtuemart/prodictdetails/default.php

(default.php or flexv2.php which ever layout you are currently using)

2- Find this line:
<div class="addtocart-area">

3- right before it (or after that DIV tag is finished) enter these lines:
<?php $product_available_date = substr($this->product->product_available_date,0,10);
		$current_date = date("Y-m-d");
		if ($product_available_date != '0000-00-00' and $current_date < $product_available_date) { ?>
    	<div class="availabilityDate">
			<?php echo vmText::_('COM_VIRTUEMART_PRODUCT_AVAILABLE_DATE') .': '. JHtml::_('date', $this->product->product_available_date, vmText::_('DATE_FORMAT_LC4')); ?>
		</div>
	<?php } ?>    

4- That's all.

About your 2nd inquiry.

Do you also want to change the "Add To Cart" text to "Pre-Order" ? If so, then you will need a hard coding modification. It is really easy. But you can create a custom "availability" icon. For example, on-order.gif.. Then type whatever you want to this PNG file:

templates/YOUR_TEMPLATE/html/com_virtuemart/assets/images/availability/on-order.png

change that graphic and have it reads: "Pre Order" or what ever you want.

Or you can build your own php expression, So, if the "Availability Date" is "in the future" (newer than today's date), then show a picture of "pre-order.php".. You can do it like this:
<?php 
$product_available_date = substr($this->product->product_available_date,0,10);
$current_date = date("Y-m-d");
if ($product_available_date != '0000-00-00' and $current_date < $product_available_date) { ?>
      <img src="pre-order.png">
<?php } ?>


You can change the text "Add to Cart" to "Pre-Order" for products that are available in the future by following the same idea. Basically the idea would be:

if TRUE
display "Pre-Order" text
else
display "Add to Cart" text

Regards.
Last Edit: 8 years 4 months ago by Support.
The administrator has disabled public write access.

Availaibility info not display + PREORDER TAG 8 years 4 months ago #13538

wow all is working like a charm

stupid question (sorry not very good in php) where do i put the code

if TRUE
display "Pre-Order" text
else
display "Add to Cart" text

because if im doing a copy / paste it is not working


because the idea is change add to cart to PRE ORDER button (it should be an option sometime shop owner prefer button to be add to cart instead of pre order)


and also how can i show a pre order label on top of the image in multi grid view, list view.... like for the SALE, FEATURED, NEW badge?
and also the availability date on the gird, multi view on the category list? as it can be confusing if customer buy the product directly from the category list without showing the pre order information

i think as it is simple you can implement this feature on the 3.9.2 version as it is a very very needed option for shop owner, and only you will offer it!

thank you very much
Last Edit: 8 years 4 months ago by M grano.
The administrator has disabled public write access.

Availaibility info not display + PREORDER TAG 8 years 3 months ago #13572

Hi Grano,

When i said this below:
if TRUE
display "Pre-Order" text
else
display "Add to Cart" text
You probably misunderstood me.

That is just the logic you should follow, you have to put that logic into actual PHP codes to make things work. If you look at my previous reply, i have already given you the "IF..END" statement you should use.

The idea behind that IF..END is;
- get the availability date of product
- get the todays date
- Compare the availability date with today's date.
- If true, the product will be available in the future, so print the "pre-order.png" image file
- if false, the product is already available right now, so don't do anything special.

Use the same IF...END statement to change pretty much anything on the product page or category page. Change the "Add to Cart" text to "Pre-Order Now" or put a PNG or label anywhere you want.. sky is the limit..)

IF you want to change anything on the Category page, then the idea (the IF..END statement) will be the same, just.. where ever you see this object $this->product->... change it to $product->... (in category page, the object to access product information is $product->...)

Those you are asking are actually 100% custom modifications (because you want to change how the things work/look) and i must say; we don't provide step-by-step instructions for custom coding modifications. But I just tried to "guide" you about what needs to be done. If you don't have at least mid-level PHP experience; you might get confused and mess things up (DON'T FORGET TO BACKUP FILES BEFORE TOUCHING !!)

Although you may purchase premium support via www.flexiblewebdesign.com/premium-support and let us take care the modifications for you directly on your website though.

Regards.
Support
The administrator has disabled public write access.
Time to create page: 0.146 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