News:

Support the VirtueMart project and become a member

Main Menu

$this-> VS $product->

Started by PRO, April 03, 2012, 20:58:22 PM

Previous topic - Next topic

Stonedfury

How can I load the current product into a module? I tried <?php echo $this->product->product_name ?> I get no error but I get no module text either. The module shows the title shows but it just doesn't load a product name. :(
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

PRO

Quote from: Stonedfury on May 13, 2013, 02:52:16 AM
How can I load the current product into a module? I tried <?php echo $this->product->product_name ?> I get no error but I get no module text either. The module shows the title shows but it just doesn't load a product name. :(


yopu cant without custom coding


what exactly do you want to do?


Stonedfury

I purchased a very crappy module that loads recently purchased products. I have been trying to clean it up and make it load better. I could truly use some help. I don't want to commandeer this post though. I was just checking to make sure I wasn't totally stupid. lol Ill start a new topic.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

antonino78

Hello,
I would show you a picture in the category when a product is not available.
I would use something like this:
<div style="padding:5px;">
<a><?php if ($this->product->product_in_stock == 0) {echo "<img src='http://mysite/images/red2.png' non disponibile' onclick=\"javascript:window.open('/legenda.html','legenda',')\"";} 
                
?>
</a>
</div>

I used this product in detail and it worked out great in the category but I do not know how to do.
can anyone help me please?  :'(

PRO

Quote from: antonino78 on June 29, 2013, 15:38:40 PM
Hello,
I would show you a picture in the category when a product is not available.
I would use something like this:
<div style="padding:5px;">
<a><?php if ($this->product->product_in_stock == 0) {echo "<img src='http://mysite/images/red2.png' non disponibile' onclick=\"javascript:window.open('/legenda.html','legenda',')\"";} 
                
?>
</a>
</div>

I used this product in detail and it worked out great in the category but I do not know how to do.
can anyone help me please?  :'(


did you NOT read the first POST in this thread?

$this->    or    $product->

There is a place foreach one

antonino78

Hello,
thanks for your answers.
Since I'm no expert I would be grateful if you could post the solution without sending me to other posts.
The code that I posted it found around ilo web and it worked perfectly for product details.
I simply would like to know how should I modify it to make it work aqnche products in the category.
Can you help me please? :-[

PRO

Quote from: antonino78 on June 29, 2013, 17:26:01 PM
Hello,
thanks for your answers.
Since I'm no expert I would be grateful if you could post the solution without sending me to other posts.
The code that I posted it found around ilo web and it worked perfectly for product details.
I simply would like to know how should I modify it to make it work aqnche products in the category.
Can you help me please? :-[




Product variables are called on the category page with   $product-> and NOT    $this->

SO, CHANGE
$this->   to $product->


maxispin

Awesome thread! People like me can actually understand a bit more about coding now. Thanks for Pro for starting this and Ivus about great hints too!
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

poisom

Hello,

i am trying to show the stock_level inside a productdetails page bu i cant.

i am using this code:

<span class="vmicon vm2-<?php echo $this->product->stock_level?>" title="<?php echo $this->product->stock_tip?>"></span>

i copied this code from a category page and changed the $this to work inside a product page...any help??
Joomla 3.4.1 - Virtuemart 3.0.9.4

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

poisom

Quote from: Maxim Pishnyak on September 26, 2013, 14:54:35 PM
Quote from: poisom on September 26, 2013, 13:41:41 PM
i copied this code from a category page
Which code?

<span class="vmicon vm2-<?php echo $this->product->stock_level?>" title="<?php echo $this->product->stock_tip?>"></span>

you don;t see the code tags??
Joomla 3.4.1 - Virtuemart 3.0.9.4

Maxim Pishnyak

Nope. I don't see original code. BTW the first pages of each of those two sticked threads about Template Overrides in this forum section could give you a hint.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

isuv

Hello,

I have Joomla 2.5.14 and VM 2.0.18b. I used this solution http://forum.virtuemart.net/index.php?topic=106732.0 to display related products prices on a product details page. But after I began to use different prices for registered and not registered users the prices of related products disappeared. There were "0" instead of prices. So, as I understand, I need to correct this code somehow:
$product = $model->getProductSingle($field->custom_value,false);
$price = $calculator -> getProductPrices($product);
echo $currency->priceDisplay($price['salesPrice']);
Can you help me with this?

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Robert_ITMan

#29
Quote from: poisom on September 27, 2013, 09:42:53 AM
you don;t see the code tags??

poisom - did you figure this out yet? I posted a solution here:  http://forum.virtuemart.net/index.php?topic=92756.msg409006#msg409006
WEBSITES @ OURFINGERTIPS
manage > develop > market > repeat

Save a lot of time and money when focused on building a website that works with marketing efforts to get more leads and sales from visitors.

www.ourfingertips.com