Hack to hide stock

46 views
Skip to first unread message

marcellodj

unread,
Jun 7, 2012, 7:31:39 PM6/7/12
to goodrelation...@googlegroups.com
Hello,
i m using the module on my joomla/vm site; i would know if there is an hac to prevent display of stock available/unavailable.
Any help? thanks in advance.

Alex Stolz

unread,
Jun 8, 2012, 3:38:29 AM6/8/12
to goodrelation...@googlegroups.com
Hi,

it is quite easy in general to change the module output, because the templates resemble conventional HTML code. For the module to prevent it from displaying the stock level please have a look at
- lines 112 through 119 in mod_goodrelations/rdfa/templates/template-product.html, and
- lines 155 through 157 in mod_goodrelations/rdfa/templates/template-product.html



{% if stock_level %}
                <div rel="gr:hasInventoryLevel">
                        <div about="{{product_uri}}#inventory_level" typeof="gr:QuantitativeValue">
                                <div property="gr:hasUnitOfMeasurement" content="{{stock_unit}}" datatype="xsd:string"></div>
                                <div property="gr:hasMinValue" content="{{stock_level}}" datatype="xsd:float"></div>
                        </div>
                </div>
{% endif %}



{% if stock_level %}
                                                <div rel="gr:hasInventoryLevel" resource="{{product_uri}}#inventory_level"></div>
{% endif %}



Taking the first code snippet, you could change it to sth. like (note the False in the if-clause)

{% if False %}
                <div rel="gr:hasInventoryLevel">
                        <div about="{{product_uri}}#inventory_level" typeof="gr:QuantitativeValue">
                                <div property="gr:hasUnitOfMeasurement" content="{{stock_unit}}" datatype="xsd:string"></div>
                                <div property="gr:hasMinValue" content="{{stock_level}}" datatype="xsd:float"></div>
                        </div>
                </div>
{% endif %}

or, similarly in HTML

<!-- {% if stock_level %}
                <div rel="gr:hasInventoryLevel">
                        <div about="{{product_uri}}#inventory_level" typeof="gr:QuantitativeValue">
                                <div property="gr:hasUnitOfMeasurement" content="{{stock_unit}}" datatype="xsd:string"></div>
                                <div property="gr:hasMinValue" content="{{stock_level}}" datatype="xsd:float"></div>
                        </div>
                </div>
{% endif %} -->

where I think the former solution is the better one since it will not produce any output anymore (if in doubt you may also remove the whole block).
Don't forget to do the same with the second code snippet!


Best
Alex


--
You received this message because you are subscribed to the Google Groups "goodrelations-for-joomla" group.
To view this discussion on the web visit https://groups.google.com/d/msg/goodrelations-for-joomla/-/r1JY446MJSoJ.
To post to this group, send email to goodrelation...@googlegroups.com.
To unsubscribe from this group, send email to goodrelations-for-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/goodrelations-for-joomla?hl=en.

marcello vanni

unread,
Jul 23, 2012, 6:08:15 PM7/23/12
to goodrelation...@googlegroups.com
thanks alex for great explanation.best regards.

2012/6/8 Alex Stolz <stalso...@gmail.com>
Reply all
Reply to author
Forward
0 new messages