Please refer to TemplateMonster Support for any issues surrounding TemplateMonster/TemplateTuning Themes – thanks, Jigoshop Team

Specific Customization, and Widget Template Customization

albyrock87

29 Oct, 2012 11:34 AM

I'd like to customize the jigoshop_get_price_html, in fact I removed and added a custom action.
The problem is that $_product->regular_price is protected, so it cannot be accessed.
Jigoshop shoud add a get_regular_price() function to retrive that property as it is, or make regular price a public field.

I'd like to customize the template of a Widget, is it possible?
It seems that widgets don't have a template file to customize.

Thank you

Oh, I almost forgot.. The Product Categories Widget has a bug:
Let say we have the following tree of categories:
- A
  - A1
  - A2
- B
- C
If my product is in A2 category (in the single-product page), only "A" has the current-category class (so only A is selected).
The widget should set the selected class on both A, and A2 entries.

  1. Support Staff 2 Posted by chriscct7 on 29 Oct, 2012 11:38 AM

    chriscct7's Avatar

    What exactly do you want to do to get_price_html? You cannot alter the price of a product using it.

    I'll log the category widget bug.

    -Chris

  2. 3 Posted by albyrock87 on 29 Oct, 2012 11:43 AM

    Hi Chris,
    I don't want to change the product price, I just want to read it.
    If you look at the code of jigoshop_get_price_html() function, it uses the regular_price a lot to choose what to print on screen.
    in example:
    if ( $_product->regular_price == '' ) $html = __( 'Price Not Announced')....

  3. Support Staff 4 Posted by chriscct7 on 29 Oct, 2012 11:46 AM

    chriscct7's Avatar

    So what do you want to do different than what it already does? Just drop the formatting?

    -Chris

  4. 5 Posted by albyrock87 on 29 Oct, 2012 11:50 AM

    Hm, yes, I want to add some text in some specific cases, and also change the formatting tags :)

  5. Support Staff 6 Posted by chriscct7 on 29 Oct, 2012 11:54 AM

    chriscct7's Avatar

    Just override the function (note the filter we included at the end) ;)

    -Chris

  6. 7 Posted by albyrock87 on 29 Oct, 2012 12:02 PM

    So I need to add a filter, thank you.. I didn't noticed that, anyway I think that adding a get_regular_price() function is an OOP best practice.

    What about the possibility to change the way widgets are rendered?
    Should I clone the whole widget, or is there a better way?

  7. Support Staff 8 Posted by chriscct7 on 29 Oct, 2012 12:04 PM

    chriscct7's Avatar

    There is also a get_price() function that the actual price is called from. That's public as well ;)

  8. 9 Posted by Dana Whittle on 30 Oct, 2012 01:18 PM

    I'd like to see MUCH more granular templating (as Woo is now doing with the fork); i.e. the ability to customize each separate chunk of output (price, image, description) and use that in the custom templates in my theme. Right now, I am busy trying to override all sorts of things via CSS which is really not ideal; example : "From" before the lowest price on product with variations, which I don't want to show... I have a bilingual site and need to customize teensy bits of text here and there and short of creating a new "language" file for the installation, I can't do things like get rid of caps in titles ("All Products") without resorting to trickery...

  9. Support Staff 10 Posted by chriscct7 on 30 Oct, 2012 01:31 PM

    chriscct7's Avatar

    You can template all of those you said by overriding the output functions.

    -Chris

  10. 11 Posted by Dana Whittle on 30 Oct, 2012 02:17 PM

    I must be missing something because I am overriding a number of things (breadcrumbs, pagination, etc.) via functions.php but I don't see any individual files in your template folder for description, price etc.; they appear to be called as grouped items and I can't find any specific template tags in your actions/filters/theming documentation to help me with this. As mentioned, there are individual files in Woo template folder for each of these "chunks"... maybe I am just not brilliant. Can you point me to something more detailed? Thanks, love Jigoshop so far apart from this...

  11. Support Staff 12 Posted by chriscct7 on 30 Oct, 2012 05:46 PM

    chriscct7's Avatar

    Did you look in jigoshop_templates_functions.php?
    We currently do not have Developers Documentation, but we are working on adding it. However the files all have verbose commenting.

    -Chris

  12. 13 Posted by Dana Whittle on 30 Oct, 2012 06:11 PM

    No, I didn't know to look there; thanks for the tip! Dev docs would be superb!

  13. Support Staff 14 Posted by chriscct7 on 30 Oct, 2012 06:49 PM

    chriscct7's Avatar

    No problem

  14. chriscct7 closed this discussion on 30 Oct, 2012 06:49 PM.

Comments are currently closed for this discussion. You can start a new one.