PDA

View Full Version : custom field data for wrong product showing


drstuey
07-02-08, 04:09 AM
Hi,

I have a foreach loop in a Latu's Wow Wow Widgets block of code that displays some special products on the homepage. I am trying to add the product custom fields to those product listings.

I have two product custom fields: 'tagline' and 'tombstone'.

If the product has a 'tombstone' entered then it shows up correctly in the product listing. If the product has neither a 'tagline' nor a 'tombstone' entered then the product listing correctly shows nothing.

But if the product has a 'tagline' entered but not a 'tombstone' then it shows the tombstone for the wrong product!

Presumably this is because the first time through the foreach it sets the value of tombstone and it reuses this on subsequent times through the foreach.

The fact that it correctly hides it if there is no tagline, and shows it if there is a tagline suggests that (a) when one custom field is added to the database for a product it creates a new blank line in the database for the other custom field for that product and (b) my if exists code is not testing for a value in the custom field it is testing for the presence of a line in the database for that custom field. Yes?

My if exists code is: if expr="NOT ISNULL 1.settings:product:customfield_values:customfields :tombstone"

Is there a way to alter my if exists code to get it to only be true if there is real content in the custom field?

Leanne
07-02-08, 07:49 AM
I ran into similar problems trying to use Wow Wow Widgets, and foreach loops. It seems to be a bug in the module, and I was never able to get any assistance from the developer.

Emporium Plus' Tool Kit will do what you're trying to do, and a whole lot more besides -- well worth the investment if you ask me.

drstuey
07-03-08, 08:14 AM
Thanks Leanne, I do have toolkit. It is just that I bought WWWidgets first and implemented it and only later did I buy toolkit. I will try and convert my content block from WWWidgets to toolkit. If I ever do a Miva site again I expect I will go straight to toolkit and not bother with WWWidgets.