Display all the delivery methods - Opencart - twig

I am trying to hide all the delivery methods that appears for different areas under the same country for my weight based shipping, and instead I am trying to display only the delivery method with respect to that particular area in the country.
To achieve this, I am trying to get the country and region name in the checkout page under delivery. To use if condition on it and solve my issue. But I am not able to get the country and areas value at all in the checkout page as the opencart 3.X uses twig framework. Can anyone tell me how I can achieve this?

You can do this in you catalog shipping model by defining in which zones/countries its supposed to work like so
public function getQuote($address)
{
if($address['iso_code'] != 'FI' && $address['zone_id'] != 5)
return;
I don't know what kind of checkout you use but this would work on all without overriding checkout files.

Related

Shopware 6: Product Slider data is null when use manual assignment

I have a issue with the product slider.
First issue: In administration, i added a product slider that using dynamic product group and a product slider that using use manual assignment.
I created a my resolver class that inherit from ProductSliderCmsElementResolver for loading data on storefront.
But on Storefront only display data from dynamic product group , data from manual assignment is null.
Second issue: On Storefront can’t display product’s cover (I still using Product Slider). Do I need to do anything at resolver class ?
Thank everyone.
It was fixed by the OP by extending their resolver from ProductSliderCmsElementResolver. By this the existing logic / template is used and the data is displayed.

display locationquanityavailable on Netsuite Sitebuilder Site

Trying to figure out how to set the location of a multi-location Netsuite so that on the web store it only will display the quantity of that location only. Currently it displays ALL locations (sums).
I would like js in the header possibly that will set the location to one location and then when using locationquantityavailable it will grab that locations quantity and displays it.
Anyone been able to display just a locations quantity?
You can mark your locations as making their inventory available in the web store. Then the standard sitebuilder tags quantityavailable and quantityonhand will pull from those.
If that doesn't work you could manage this by various forms of scripting.
Script your inventory affecting transactions so that inventory changes from the desired locations update custom item fields.
Create a Suitelet that takes a page's item ids as a query string and returns current inventory for those items.
create a non-stored custsom item field that populates with the results of a saved search. I doubt this option will work in the context of the web store but it's very low effort to check. Search for "Creating Custom Fields with Values Derived from Summary Search Results" in the Netsuite online help for details.
I've used the first two of these in production to achieve the result you're looking for.
each of these has advantages and disadvantages so there's a trade off between how busy your back-end is vs how busy the site is.

Access Netsuite Internal Id Dynamically

Searching the Netsuite documentations is like having a date with freddy krueger, not good. Wondering if anyone knows a way to access Netsuite product internal IDs dynamically? We have WSDK enabled and can populate item name, descriptions, weight, etc., but we have to manually enter the ide for every script we run on the product page we create.
<script src='http://shopping.sandbox.netsuite.com/app/site/query/getitemname.nl?c=xxxxxx&n=1&id=3706'></script>
<script src='http://shopping.sandbox.netsuite.com/app/site/query/getitemname.nl?c=xxxxxx&n=1&id=DYNAMICALLY PULL THE ID'></script>
c= is the Netsuite account number, the id= is the product internal id. We need this for every product script "getitemsdescr" "getitemweight" etc. Is there a way to access that internal id dynamically? Or do we need to manually enter them on all 200 plus product pages we are building?
Not sure how to source this from inside the shopping cart, although I know it's possible, a dev I used to work with managed to do it.
You could alternatively use a SuiteLet to fetch the product Ids based on certain item parameters, and return as a JSON object to be used on by the page JS.

Sort articles by template variable

I have built a website (with MODX) where some products are managed and displayed via the articles addon. The products should have a custom ordering but I don't know how to use a template variable for that.
If I enter the name of the TV in the "Sort Field" field nothing is shown at all.
So is it somehow possible to use a TV there?
Or is there another way to achive a custom ordering (note that I need the summary and date fields, so I cant't abuse them for that)?
You can do this by using getResource package. Look at sorbyTV, sortdirTV, sortbyTVType parameters in manual:
http://rtfm.modx.com/extras/revo/getresources#getResources-SelectionProperties

Add finding attribute by name in Opencart Admin panel: Catalog - Attributes - Attributes

How to implement Attribute to find his own name in the admin area in Opencart : Products - Attributes - Attributes? Is that there is a separate field and simply by driving into the field and displays the name of the attribute is an attribute, as usual searching for items in the admin by name, but only with attribute
It's hard to understand what you are asking, but if you are trying to use attributes for products then you must first define them at catalog>attributes>attributes.
To List attributes in the Products tab you will need edit these files
admin>view>template>catalog>product_form.tpl
admin>controller>catalog>product.php
If your understanding of PHP or Opencart isn't very strong it will help you to copy data from the attribute.php controller to the product.php controller.
As for the search function, this is something I haven't done before but you could try using the search function on the front of the website as reference.
I recommend working through this as best you can then asking more questions if or when you get stuck.
*Update
Ok so since HTML is your strenth it will be smartest to start from there. Open any of these files (the ones that have the data you need).
admin>view>template>catalog>attribute_form.tpl
admin>view>template>catalog>attribute_group_form.tpl
admin>view>template>catalog>attribute_group_list.tpl
admin>view>template>catalog>attribute_list.tpl
Then work backwards with what you see. The tpl will show variables that look like $attribute, track these back to
admin>controller>catalog>attribute.php
admin>controller>catalog>attribute_group.php
And you will see how all the code is used to pull the data from the model and format it if necessary.

Resources