How to Manage Parent Child Relation Of Options In opencart - opencart

i want to add sub option with description depends On parent Option Like
eye wear frame power type(single vision,zero power)
sub options for single vision and and zero power

You can add a new field to the database, or utilize an existing one that you don't currently use.
For example:
EAN
If you don't use EAN, you can simply change the name in the language files:
your_directory/admin/language/en-gb/catalog/product.php
Change:
$_['entry_ean'] = 'EAN';
to
$_['entry_ean'] = 'Single Vision';
and similarly for catalog.
Tags are also used in similar fashion, for items to link/group similar products. (If you want all 'single vision' items to be linkable/grouped together, tags would be the easiest way to go.)

Related

Merge cells with similar but different data, different spelling

I am trying Tableau with data extracted from Salesforce. The input includes a "Country" record were the row have different spellings for the same thing.
Example: Cananda, CANADA, CAnada etc.
Is there a way to fix this in Tableau?
The easiest solution is create a group field based on your Country field.
Select Country in the data pane on the left side bar, right click and choose Create Group. Select elements that you want to group together put them into a single group, say Canada, that contains all variations of spelling.
This new group field initially has a name of Country (group). You may want to rename it Country_Corrected. (Or even better, rename the first field, Country_Original, and call the group field simply Country. Then you can hide Country_Original)
Groups are implemented using SQL case statements. They have many uses, but one application is to easily tolerate some inconsistent spellings in your data source without having to change your data. In general, you can specify several transformations like this that take effect at query and visualization time. For very large data sets, or for very complicated transformations, you may eventually want to push some of them upstream in your data pipeline to get better performance. But make those optimizations later when you've proven the necessity.
If the differences are just in case (upper vs lower), you can right-click the Country dimension, and create a calculated field called something like "New Country", and use the following formula to make the case consistent:
upper([Country])
Use this new "New Country" calc dimension instead of your "Country" dimension, and it will group them all without case sensitivity, and display as uppercase. Or you can use "lower" instead of "upper" if preferred.

Using a bucket as a datasource for a droplink/tree field

I'm trying to enable content editors to select an item that resides in a bucket in a droplink field but I'm unable to find a field type/datasource that enables this.
I need to allow the user to select a single item (so not a multilist), the items are in a bucket as the number of items may be huge and the search api would be most helpful to the editors.
Is there a field or datasource query that will enable a lookup field to select a single bucketed item?
The simplest solution is to use a Sitecore multilist with search field.
First you need to set the source of your field to display items within your bucket of a specific template(s).
Example: StartSearchLocation={11111111-1111-1111-1111-111111111111}&Filter=+_templatename:sample item
Here is an article describing how to set the source of your field: Sitecore 7 field types
If you need to limit the selection to one item then you need to also apply some regex. To achieve this you need to enable standards values in the view tab so you can alter the data section.
In the data section add the following regex: ^({[^}]+}\|?){0,1}$ and add some validation text.
Example:
This article provides additional infromation:Limit selected items on Sitecore multilist field
Just in case anyone else comes across this as I did, you can also use a query in the source field to filter the items in a droplink.
query:/sitecore/content/Home/YourBucket//*[##templateid='{your-template-guid}']
You can also use ##templatename='Your Template Name'
Keep in mind that unless your bucketed items aren't numerous (for some reason), the suggested answer is probably better since it provides search, and will not create a massive dropdown list of items.
I made some custom fields for this very purpose: https://github.com/Barsonax/SitecoreSearchFields
It gives you the same rich search interface you normally get when searching in buckets.

Can you create default product attributes

I am trying to create a store of products with WooCommerce and would like, if possible, to simplify the process of adding new products by having a default set of attributes.
For example, all of my products share certain attributes including: volts, watts, colour temperature etc. I have created these attributes and can select them when I add a new product but it would be really useful, for consistency and speed, if every time I added a product of a certain category the Add Product page automatically added a given set of attributes, rather than me having to add each attribute one by one for every product I add.
Does anyone know if this is possible?

How to run a SQL command to change the products layouts in opencart

I was wondering if someone knows a command to change some of the product pages to a certain layout that you create in Opencart?
I have about 100 products I need to change their layouts to display certain things in the sidebar for the 100 products.
I created the layout in the admin area of Opencart 1.5.5.1. Honestly, having to go to each product (catalog > products) and select the design tab and select the Layout Override: to the choice of layout seems a little long to do!
Was hoping there is a simply SQL command to do. Is this possible?
Supposing You would like to update all the products with the same layout, follow these steps:
Find out the Layout ID (let's say, it would be 15).
Open up Your famous DB manager, let's say phpMyAdmin, while opening the window to type the SQL queries into it
Type in the following query and execute it:
UPDATE `product_to_layout` SET
`layout_id` = 15
WHERE
`product_id` IN (
SELECT `product_id` FROM `product`
)
(if You are using DB table prefixes, add it to the table names product_to_layout and product)
I am also supposing You only have a single store installation. The multistore could be a little different if You would like to set one layout for one store and another for other store.
If You have more layouts and would like to set one layout to a certain set of products You would have to modify the WHERE part to update only the concrete set of products.

JSF selectOneMenu not whole List

Is it possible to choose only specific items from the list in selectOneMenu?
For example. I have List Products has many fields like name, id etc. One of it is category (1,2 or 3) I want to have only one category in the selectOneMenu without making new Lists and new classes. Can you help me?
I think the easiest way is to set the value attribute of f:selectItems to a method which filters your original collection.
Otherwise you'd have to implement your own version of f:selectItems which allows filtering - as we once did in one of our projects.