Has anybody been able to successfully get Enable S...
# suitecommerce
b
Has anybody been able to successfully get Enable Strike-Through Behavior to work on your site? I have followed all instructions and it does not appear on the site. I want to know if anybody has ever gotten it to work?
w
We've got strike-through pricing working on non-matrix items but not matrix items yet. I have been told that we need to set up an online base price in addition to our base price but I have not had time to look at that yet and still not clear why we would have to do that. I am interested to see if anyone else has insight about this as well. We are nearing the end of our implementation phase so everything is bit overwhelming for our small store.
b
How did you get it working on non-matrix?
s
In the docs where it says to add the fields to the search field set, that seems wrong to me — can you do me a favour and add them to the details field set, save, and then rebuild the search index please
I have been told that we need to set up an online base price in addition to our base price but I have not had time to look at that yet and still not clear why we would have to do that.
That seems odd to me too
w
The way ours is currently set up has default price level as you have it with pricelevel1 on the configuration. Online Price is selected on the website setup price level. Then we added the price levels to the search field set (we also have this in detail likes Steve said), also on the website setup. Not sure how much of this changes once we get it working for matrix items. https://5746720.app.netsuite.com/app/help/helpcenter.nl?fid=subsect_159197524883.html
b
In my case, the price values are already in the details field set
s
OK — since making the changes, have you rebuilt the search index?
b
Yes
s
(Are the fields being returned in the API response?)
In the developer console, does
SC.CONFIGURATION.priceLevel
return the values you expect?
b
Yes, and the values are in the API response
s
While on the PDP, does
SC.Application.getLayout().getCurrentView().model.getItem().get(SC.CONFIGURATION.priceLevel.default)
return the correct value or
undefined
?
b
Copy code
SC.Application.getLayout().getCurrentView().model.getItem().get(SC.CONFIGURATION.priceLevel.default)
225
It returns the correct price
s
OK, well we know then the data is in the right place
b
Yeah, everything seems to be there
s
SC.Application.getLayout().getCurrentView().childViewInstances['Product.Price']['Product.Price'].childViewInstance.getContext()
Is the
comparePriceFormatted
correct?
b
That value is defined
s
Is it $225.00?
b
but isPriceVisible_detail: undefined
s
I think that’s only for PCV
b
Yes, the price is correct
message has been deleted
s
Good and
showComparePrice
is true
SO!
What’s in your template?
(Is this SCA or a custom theme?)
b
It is a custom theme
s
Cool
Open ProductViews/Templates/product_views_price.tpl
You got a section like this to show the price?
b
Copy code
<span class="product-views-price-range" itemprop="offers" itemscope itemtype="<https://schema.org/AggregateOffer>">
				<meta itemprop="priceCurrency" content="{{currencyCode}}"/>
				<meta itemprop="highPrice" data-rate="{{maxPrice}}" content="{{maxPrice}}"/>
				<meta itemprop="lowPrice" data-rate="{{minPrice}}" content="{{minPrice}}"/>
				<!-- Price Range -->
				<span class="product-views-price-lead">
					{{translate '<span data-rate="$(0)" >$(1)</span> to <span data-rate="$(2)">$(3)</span>' minPrice minPriceFormatted maxPrice maxPriceFormatted}}
				</span>
				{{#if showComparePrice}}
					<small class="product-views-price-old">
						{{comparePriceFormatted}}
					</small>
				{{/if}}
				<link itemprop="availability" href="{{#if isInStock}}<https://schema.org/InStock{{else}}https://schema.org/OutOfStock{{/if}}>"/>
			</span>
s
You should have two sections with
showComparePrice
- one for price ranges and one for non-ranges
b
Yes, I am missing that part. I only have 1
We are working on trying to upgrade to 2022.1
To keep our current theme, do we need to rewrite that? I am more familiar with extension development then theme development.
It seems that our theme as it stands doesn't carry over the new changes in 2022.1
s
I’m guessing this theme is pretty old because it’s not using JSON-LD
It wouldn’t, no
If you use custom themes, you need to update them yourself
b
Ok, that is our issue then
s
So! It looks like we figured out the problem: the data is being exposed to the template but a series of conditionals in the appropriate template is stopping it from being shown
b
Thank you!
netsuite halo 1
s
No problem. Was a fun brainteaser 🤣
b
I switched to base theme and it works. But comparePriceFormatted is empty sometimes. Do you know why that would be?
s
Well, the simple answer is that there is no comparison price. This could be because one isn't set or it is equal or less than the customer's selling price