Keyword

[SOLVED] Specific Extra Field Data repeats info

  • Mariana Ramírez Figueroa
  • Mariana Ramírez Figueroa's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 4 months ago - 10 years 4 months ago #128892 by Mariana Ramírez Figueroa
[SOLVED] Specific Extra Field Data repeats info was created by Mariana Ramírez Figueroa
Hello! I'm trying to show three specific extra fields in category listings: Price, % Discount and City, using the code
www.evernote.com/shard/s322/sh/1b3ac698-09ef-47a9-820c-2f38fdfa5571/931df93d70f7c78abfd98e2013ceb09d

I know there must be something wrong with the code, but I can't figure out what it is... Has anyone else had this issue? or anyone knows how to fix it?

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #128893 by jeffrey liu
:P

keep only one set of
<span class="catItemExtraFieldsLabel"><?php echo $this->item->extraFields->CiudadoMunicipio->name; ?></span>
                                <span class="catItemExtraFieldsValue"><?php echo $this->item->extraFields->CiudadoMunicipio->value; ?></span>

let foreach do the cycle job. good you only have 1 extra field set, otherwise, its a lists of 6 times of your EF sets.
:lol:

Please Log in or Create an account to join the conversation.

  • Mariana Ramírez Figueroa
  • Mariana Ramírez Figueroa's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 4 months ago #128894 by Mariana Ramírez Figueroa
Replied by Mariana Ramírez Figueroa on topic Re: Calling Specific Extra Field Data repeats the info
I'm sorry Jeffrey but I'm still a little bit lost here... if I use just
Log in  or Create an account to join the conversation.

More
10 years 4 months ago #128895 by Lefteris
@Mariana

Hi. You have placed the code inside a foreach loop. Doing this will make your code execute as many times as the number of extra fields. If you need to use the extra field alias you need to place your code outside of the loop.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Mariana Ramírez Figueroa
  • Mariana Ramírez Figueroa's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 4 months ago #128896 by Mariana Ramírez Figueroa
Replied by Mariana Ramírez Figueroa on topic Re: Calling Specific Extra Field Data repeats the info
Hi Lefteris, thanks a lot! it works now :)

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #128897 by Lefteris
You are welcome.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.