- if #likelist
You like
= #likelist.products.size
products.
= link_to "Likelist", likelist_path
this results in ugly linebreaks -->
<div id='likelist_link'>
You like
1
products.
Likelist
</div>
is there a way to get everything in one line?
- if #likelist
You like #{#likelist.products.size} products. #{link_to "Likelist", likelist_path}
Related
I'm using the Cornerstone theme in BigCommerce. On my product page, I need to hide pricing unless the end user is logged in. BigCommerce has this feature, but it's all or nothing and I only want to restrict certain items from displaying their price. I am using a custom field at the product level named HidePrice. This custom field has either a True or False defined for each product on my site. There are three conditions I need to account for...
The end user is logged in: Display the price regardless of what the HidePrice value is
The product's HidePrice value = false: Display the product's price
The product's HidePrice value = true and the end user is NOT logged in: Suppress the product's price and display an alternate "Too low to show" message.
Here's my code that isn't quite working...
<div class="productView-price">
{{#if customer}}
{{#if product.can_purchase}}
<p class="productView-price">
<span>Price: {{product.price.without_tax.value}}</span>
</p>
{{/if}}
{{else}}
{{#filter product.custom_fields 'HidePrice' property='name' }}
{{#if (toLowerCase value) '==' 'true'}}
<div class="too-low-to-show">This product is priced too low to show!</div>
{{else}}
<p class="productView-price">
<span>Price: {{product.price.without_tax.value}}</span>
</p>
{{/if}}
{{/filter}}
{{/if}}
</div>
The piece I can't seem to get working is condition #1 above (The product's HidePrice value = false: Display the product's price). Conditions #2 & #3 work just fine but the price simply never displays when the requirements of condition #1 are met. Oddly, the "Price:" label I've pre-pended just before the price handlebar will display but the price handlebar itself seems to be ignored by BigCommerce. I have found that if I use the same price handlebar outside of my conditional statement, it will render on the page. I'm baffled by this one. Any help would be greatly appreciated. Thanks!
I believe the issue here is simply scope. Once you enter the filter condition, you have left the global scope and entered the product.custom_fields scope. You no longer have access to the product object. A simple fix for this should be to go back up a level by appending "../" in front of product.price.
<div class="productView-price">
{{#if customer}}
{{#if product.can_purchase}}
<p class="productView-price">
<span>Price: {{product.price.without_tax.value}}</span>
</p>
{{/if}}
{{else}}
{{#filter product.custom_fields 'HidePrice' property='name' }}
{{#if (toLowerCase value) '==' 'true'}}
<div class="too-low-to-show">This product is priced too low to show!</div>
{{else}}
<p class="productView-price">
<span>Price: {{../product.price.without_tax.value}}</span>
</p>
{{/if}}
{{/filter}}
{{/if}}
</div>
It's possible concatenate two response.xpath in one? I have, for example i have one response.xpath to movie name and other for the director. But instead output this in two lines and the json i do like to have it in one.
Like this in the json :
{"movie" = "Pulp Fiction, Quentin Tarantino", "year":"1994"}
The HTML is like :
<div class="movie_col">
<div class="movie_director"><h1>Pulp Fiction</h1></div>
<div class="director-link"><a><span itemprop="director">
Quentin Tarantino
</span></div>
</div>
I have a problem regarding a webpage that I´m currently working on.
The theme that I´m working the site with is gameguru 1.5 and the matter is that on the final row of my product-list, when I get to the bottom of it, there are 2 products appearing instead of 3.
The relevant code of the source file (product-list.tpl) is this one:
{if isset($products)}
<!-- Products list -->
<div id="product_list" class="clear category_list product_list grid row">
<div class="inner-product-list">
{foreach from=$products item=product name=products}
<div class="ajax_block_product {if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{/if} {if $smarty.foreach.products.index % 2}alternate_item{else}item{/if} clearfix col-xs-6 col-sm-6 col-md-4">
I´ve tried several things but I´m quite stuck here.
Finally, I would like to include one product list of the webpage in order to give you a bit more guidance.
http://tutiendadevideojuegos.com/127-ps4-videojuegos-ps4
I would appreciate very much any help.
Thanks,
Orestis
try this part
{if $smarty.foreach.products.index % 2}alternate_item{else}item{/if}
change to
{if $smarty.foreach.products.index % 3}alternate_item{else}item{/if}
UPD:
to manipulate number of products per page, in backoffice Preferences -> Products option "Products per page" put there e.g. 12 and you will have 3 products in all lines + correct values in dropdown.
Say I have multiple price quotes from multiple retailers, how will I retrieve the 5th value from a particular retailer - say Target or Walmart ? I can get to the 5th entry using the matching image logo bit how do I retrieve the value ?
Adding Html Code to make things more clear .I need to retrieve the ratePrice value (198)
<div id="rate-297" class="rateResult standardResult" vendor="15">
<div class="rateDetails">
<h4>Standard Goods
<br>
<img src="http://walmart.com/walmart/ZEUSSTAR999.jpg">
</h4>
<p>
<span class="vendorPart-380">
<img alt="Walmart" src="/cb2048547924/icons/15.gif">
<br>
<strong>
<br>
MNC
</span>
</p>
</div>
<div class="ratePrice">
<h3>
$198
<sup>49</sup>
</h3>
<p>
<strong>$754.49</strong>
<br>
</p>
<a class="button-select" href="https://www.walmart.com/us/order/95134/2013-05-14-10-00/95134/2013-05-17-10-00/297"> </a>
</div>
</div>
If you could provide some HTML it would help. Speaking generally from what you're asking you'd get a locator to the price div or whatever HTML element and then get its text using something like:
_driver.FindElement(locator_of_element).Text
The trick is understanding the HTML in order to target the 5th element. So if you can find the row that has the 5th entry then it's simply a matter or then finding the price div in that row and getting the text of it.
EDIT based on more info provided by OP in comments
Using the HTML you provided (which isn't well formed by the way, missing closing strong tag, a tag, etc.). I'd say do the following:
_driver.FindElement(By.XPath("//div[#class='ratePrice'][5]/h3")).Text
is the following syntax good to go to emhpasize a multicolumn headline totalling around 20 ~ 30 words? I dont want to use CSS3 multicolumns since it is not supported in IE9 etc.
<H3>
<div id="headingLeft" >blaa blaa blaa</div>
<div id="headingRight">blue blue blue</div>
</H3>
In response to a request from the OP:
[That's] what I was looking for! Place it as an answer so that I can accept is as an answer! The up-vote in your answer would be for the quality of the link you added. Explains everything in very clear language!
Have you considered using html5's header element, and the html5 doctype of course?
The headings shouldn't have div's inside of them. Maybe something more like this... The data in the two headings must not be too closely related, otherwise you shouldn't be splitting them apart at all. I'm assuming it's like a callout or something.
<div class="headings">
<h3 id="headingLeft" >blaa blaa blaa</h3>
<h4 id="headingRight">blue blue blue</h4>
</div>
Why not use a <div> with a class associated to it (or a css selector) instead of using H3 this way. I'm not sure this is the more SEO-friendly way of doing what you want to do.
<div class="headline">
<div id="headingLeft">blaa blaa blaa</div>
<div id="headingRight">blue blaa blue</div>
</div>
It doesn't seem that you're using H3 in a semantic way.