Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Opencart small PHP issue WordPress

  • SOLVED

Hi guys forgive me if Opencart questions cannot be answered here, but I will fire away anyway. If not the money will be donated to the communal pot.

I am trying to set my store so when the price is set to £0.00 the charaters "Sold Out" are printed out, instead of £0.00.

I have played around with some php but the best I have been able to achieve is this (which obviously looks rubbish)

http://sound-affair.com/Bang_Olufsen_Accessories/Bang_Olufsen_Cables/Bang_Olufsen_Sock

And in the main item display I don't even get the words "Sold Out" but it just prints £0.00

Look for same product here to see this example:

http://sound-affair.com/Bang_Olufsen_Accessories/Bang_Olufsen_Cables

I am not that familiar with php but any help would be appreciated. I'm sure it probably involves adding a few lines of php and some css.

Ideally someone who is familiar with OpenCart would be great as the file structure is obviously different.

Kind Regards,
Sam

Answers (4)

2012-08-09

Hardeep Singh answers:

Hi

We have experience with OpenCart and have couple of plugins in our name too.

The issue you are facing is more of template related. I can get this fixed but would need some files to update it and need version of OpenCart being deployed.

You can contact me over email to worldofharry [at] trickmyidea.com

Thanks!


Hardeep Singh comments:

As discussed over the email, I am working on it.

Thanks!


smwilson comments:

cheers,
Sam


Hardeep Singh comments:

Ok, this is done. (Number of files updated - 12)
Please verify.

Regards
Hardeep


smwilson comments:

Looks great, but as described in the inital post, when you view http://sound-affair.com/Bang_Olufsen_Accessories/Bang_Olufsen_Cables, any products listed as £0.00 still list as £).00 rather than sold out.

Once this is complete, can you please provide me the file location and name on where to amend the "Sold Out" Text incase i need to ammend it.

Thanks for your Help,

Kind Regards,
Sam


smwilson comments:

awesome stuff mate, i will keep you as a contact for future work.

If you can provide the location and file to edit the "Sold Out" text that would be great.

Sam


Hardeep Singh comments:

Please re-verify now.

I had not recorded the file locations but had screen shot for file names saved for my reference.
Sent them over email for reference

Regards
Hardeep


smwilson comments:

Looks great mate,

if you could find the location it would be great while its fresh in your mind. as i wont have a clue where to look.

Regards,
sam


Hardeep Singh comments:

.php files would be in :
/httpdocs/catalog/controller/module
/httpdocs/catalog/controller/product

.tpl files would be in:
/httpdocs/catalog/view/theme/Spicylicious/template/product
/httpdocs/catalog/view/theme/Spicylicious/template/module

2012-08-09

Michael Caputo answers:

It's printing sold out for me (screenshot)


Michael Caputo comments:

i'm not familiar with Opencart, but is there a way to set your stock levels?


smwilson comments:

Yes, but ideally I would like just the Words "Sold Out" centered and maybe slightly larger.

And displaying correctly on the main section.

There is a stock control feature however this doesn't inform the visitor, its real mian purpose is at the checkout stage not the frontend.

Cheers


Michael Caputo comments:

It doesn't appear as though there is an option to target elements on a page which products are 'sold out'. So I could give you some CSS to increase the size of the text and center it better, but it would apply it to all of the products.

2012-08-09

Arnav Joy answers:

can you provide me admin access to site via PM , I am having little knowledge of open cart , and want to try

2012-08-09

ajay answers:

Hi
The price displaying should have been stored on some variables. So need to check the conditions like, if price is stored in variable x, in php, it will be $x, so need to implement the condition, if($x == "0.00"){ echo "Sold out";}else{echo $x;}.


Thanks,
Ajay