Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need quick help on code for product_info.php


JoeWoodworker

Recommended Posts

I've been playing around with some code for a couple of hours and cant seem to get it to do what I want.

 

I need a special message to display on the product_info.php page if certain criteria are met.

 

Display positive message if

The product title does not contains the word "test1" or the word "test2" or the product description does not contain the word "test3"

Else, display negative message.

 

This is a greatly simplified way of expressing the code I am trying to write. Any suggestions would be very much appreciated.

 

Thanks

Joe

Evil will always triumph over good...

Because good is dumb.

- D.H.

Link to comment
Share on other sites

A good, good friend of mine was kind enough to write the code. If anyone is interested, here it is...

 

<?php
   if (
		 (stristr($product_info_values['products_name'], 'test1') == TRUE) ||
		 (stristr($product_info_values['products_name'], 'test2') == TRUE) ||
		 (stristr($product_info_values['products_description'], 'test3') == TRUE)) {

					echo TEXT_TEST_NO;
   } else {
					echo TEXT_TEST_YES;
   }
   ?>

 

Then I simply placed this into catalog/languages/english/product_info.php

define('TEXT_TEST_YES', 'Yes');
define('TEXT_TEST_NO', 'No');

Evil will always triumph over good...

Because good is dumb.

- D.H.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...