VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: yosandra on August 21, 2013, 10:54:54 AM

Title: A hack for quick delivery
Post by: yosandra on August 21, 2013, 10:54:54 AM
Hi,

I have a category "quick delivery" (in spanish "entrega rapida"): http://negre.es/tienda/entrega-rapida

You see I have a style for the image of that category (a text and a yellow bird on top of the image). This is the code of that:

<?php
       
                        if( $this->category->virtuemart_category_id == '35' ):
                       
                            echo  '<div class="quickdelivery">entrega rápida</div>';
                        endif;?>

But this only displays in this category. I need that same product has the same hack no matter the category is. Something like "if this product is quick delivery, display the hack".

In example, this item: http://negre.es/tienda/entrega-rapida/lampara-balloons-brokis-

is inside quick delivery category: http://negre.es/tienda/entrega-rapida

as you can see it displays the hack(yellow bird+text).

But the same item in other category or location, do not displays the hack:

http://negre.es/tienda/marcas-mobiliario/fabricante/brokis

Whay do you think of it?

I was thinking in create an attribute with text "quick delivery" and crete a acode:

if this atribute, show this hack

please let me know!

(VM latest version, joomla 2.5 version).

Regards,
Title: Re: A hack for quick delivery
Post by: Maxim Pishnyak on August 24, 2013, 12:06:32 PM
How you could mark such special product in other ways? What other ways except using category as a mark?
Title: Re: A hack for quick delivery
Post by: yosandra on September 05, 2013, 15:18:05 PM
Quote from: Maxim Pishnyak on August 24, 2013, 12:06:32 PM
How you could mark such special product in other ways? What other ways except using category as a mark?
Hi Maxim!,
I'm thing in a custom field, to mark the product as "quick delivery". Is it possible?
It's like if this custom field, display this css.
For the category I have
<?php
       
                        
if( $this->category->virtuemart_category_id == '35' ):
                       
                            echo  
'<div class="quickdelivery">entrega rápida</div>';
                        endif;
?>

and an image overlaying the product image. But no idea on how to do it for the product too. I'm thinking in a custom field, but what kind of field and what code should I use for this?

Any help is appreciated!Thanks.
Kind Regards,
Title: Re: A hack for quick delivery
Post by: yosandra on September 10, 2013, 13:35:27 PM
Hi,
any help to archieve this?

Kind Regards,
Title: Re: A hack for quick delivery
Post by: Maxim Pishnyak on September 15, 2013, 13:26:56 PM
You need to have at least one field added to a product. And mentioned field must have position "delivery"
if (!empty($this->product->customfieldsSorted['delievery'])) {
Title: Re: A hack for quick delivery
Post by: yosandra on September 18, 2013, 23:31:41 PM
Hi maxim, thanks,
do you mean I have to create a custom field with the design position "delivery", right?
The code you provide, where I have to add it?
Regards,
Title: Re: A hack for quick delivery
Post by: PRO on September 19, 2013, 00:47:55 AM
something like this might work
http://forum.virtuemart.net/index.php?topic=109549.0

OR:

how do you do availability?


I store my availability in numbers of days until it ships.


Title: Re: A hack for quick delivery
Post by: yosandra on September 19, 2013, 10:53:15 AM
Quote from: PRO on September 19, 2013, 00:47:55 AM
something like this might work
http://forum.virtuemart.net/index.php?topic=109549.0

OR:

how do you do availability?


I store my availability in numbers of days until it ships.
Hi PRO,
the link and suggestion you give me maybe works for me!
This code I see:
This is the code you put inside the foreach ($products as $product)

<?php if (!empty($product->intnotes)) {
         echo 
extendedNotes($product->intnotes,$product->link);
    } 
?>

where have I to put it on?

Can this hack be displayed as a product image overlay instead of below the price? I need it like this: http://negre.es/tienda/entrega-rapida (the text and yellow bird).

Please let me know and thanks!
Regards,
Title: Re: A hack for quick delivery
Post by: Maxim Pishnyak on September 20, 2013, 12:59:35 PM
Check pictures in Pro's thread - it's category view:
$product->
Mentioned by me code is for product details view:
$this->product->
Title: Re: A hack for quick delivery
Post by: PRO on September 20, 2013, 16:06:55 PM
I cant find a place on your site where it is, why dont you link straight to it?
Title: Re: A hack for quick delivery
Post by: yosandra on September 25, 2013, 12:06:04 PM
I have solved this topic.
Thanks anyway! ;)

Regards,