Post by Digital Sushi » Tue Apr 26, 2011 7:38 am

I'm trying to mod a feed extension that I have. My PHP isn't very good, but I know what I want to do.

What I'm trying to say is if the product quantity is 0, the the description must read: <p>This product is not in stock with us and will need to be ordered for you. Please contact us before ordering to check if stock is available.</p> and then place the product's description, which is .html_entity_decode($product['description']) . It has to have .html_entity_decode($product['description']) as it needs to decode the htnl for the feed system.

This is my code so far with the values:

Code: Select all

                    if (($product['quantity']) == '0') {
						$product['description'] =  . echo "This is a product." .html_entity_decode($product['description'] . ;
					}
Any ideas?

Active Member

Posts

Joined
Mon Oct 18, 2010 10:23 pm
Location - South Africa

Post by Xsecrets » Tue Apr 26, 2011 11:30 am

get rid of the first and last dot so it would be.

Code: Select all

if (($product['quantity']) == '0') {
                  $product['description'] =  echo "This is a product." . html_entity_decode($product['description'];
}
 

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Digital Sushi » Tue Apr 26, 2011 2:05 pm

Thanks!

I did that, but got this error: Parse error: syntax error, unexpected T_ECHO in /home/digital2/public_html/catalog/controller/feed/any_feed.php on line 153

Active Member

Posts

Joined
Mon Oct 18, 2010 10:23 pm
Location - South Africa

Post by Xsecrets » Tue Apr 26, 2011 7:46 pm

DOh! I wasn't paying attention. The extra . just caught my eye. It should be this.

Code: Select all

if (($product['quantity']) == '0') {
                  $product['description'] =  "This is a product." . html_entity_decode($product['description'];
}
 

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Digital Sushi » Tue Apr 26, 2011 8:12 pm

It's still being silly, because I'm getting this error: Parse error: syntax error, unexpected ';' in /home/digital2/public_html/catalog/controller/feed/any_feed.php on line 154
That's talking about the code you gave me.

Active Member

Posts

Joined
Mon Oct 18, 2010 10:23 pm
Location - South Africa

Post by Xsecrets » Tue Apr 26, 2011 9:14 pm

I didn't go over it well and you had many errors in there. this actually should be completely valid code here I looked over the whole thing this time.

Code: Select all

if ($product['quantity'] == '0') {
                  $product['description'] = "This is a product." . html_entity_decode($product['description']);
}
 

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Digital Sushi » Thu Apr 28, 2011 7:33 am

Works like a charm! Thanks for all of your help!

Active Member

Posts

Joined
Mon Oct 18, 2010 10:23 pm
Location - South Africa
Who is online

Users browsing this forum: No registered users and 2 guests