polylang custom product attributes - attributes

Is it possible to translate custom product attributes using Polylang Pro?
I don't see anywhere the option to translate a custom product attribute.

The answer came from the Polylang!
I need to unsychronize the Custom Product Attributes.
The developper need to use the pllwc_copy_post_metas filter. It will
allow you to uncopied and unsynchronized the product_attribute and
attribute metas. Be careful because these 2 metas included custom and
global attributes. That's mean the developper must target only the
custom attributes inside this filter (that's required to get a fair
knownledge of WooCommerce).
The pllwc_copy_post_metas filter is documented in
polylang-wc/include/product-language-cpt.php
The developper may need to unhook the 3 actions in
polylang-wc/products.php at line 30-33 to allow you to have global
attributes in one language and custom product attributes in another.
add_filter("pllwc_copy_post_metas", function($to_copy, $sync, $from, $to, $lang){
unset($to_copy['my_custom_product_attribute_name']);
return $to_copy;
}, 1, 5);

Related

soapClient.GetList does not return CustomFields, created in Acumatica I300 course

Acumatica course I190 shows how to create custom fields. I followed the tutorial and created two custom fields for Stock Items.
Acumatica course I300 has an example of exporting StockItems, procedure RetrievalOfDelta.
However, call soapClient.GetList(stockItemsToBeFound) does not return the CustomFields, even though I changed ReturnBehavior = ReturnBehavior.All, and can see values of all other fields.
How to include the CustomFields to be returned by GetList?
Thank you.
For guidelines on broad general topics like API Custom Fields refer to documentation.
You need to extend the default endpoint and extend the entity (stock item).
Reference:
https://help-2020r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=c450492e-06fe-4563-95c3-efa76975415b
Use populate action to add custom fields to the extended entity.
Reference:
https://help-2020r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=bd0d8a36-b00b-44c8-bdcd-b2b4e4c86fd0

Change object identifier in hybris backoffice

I wanted to add an extension in backoffice, so that it is possible for non-programming people to add new objects (of defined types) to the database.
I've almost done it:
I defined two items: offer and tile (their relation is one to many)
What i achieved is there is a possibility to add a new offer in the backoffice.
When you add it, and click to edit, you can also add a tile to this offer - either form drop-down list (if any tiles exist) or create a new tile, which will automatically be added to its table and realted to edited offer.
However, the representation of the drop-down list is unacceptable, see below:
screenshot from backoffice
as you can see, the identifier of an existing tile (within []) is its PK - which clearly is not a good identifier. I would like to inject there instead a value form one of tile's other attributes (which also is unique) so that someone could easily identify which tile to add.
Where is the mechanism responsible for it? How to override it. I tried to override toString method in the tile class, unfortunately to no avail
You need to customize the backoffice-config.xml for your custom Model. For your Tile model, you can use something like:
<context merge-by="type" type="Tile" component="base">
<y:base xmlns:y="http://www.hybris.com/cockpit/config/hybris">
<y:labels>
<y:label>nameOfTile</y:label>
</y:labels>
</y:base>
</context>

Liferay 7 - Get Dynamic Attributes from DDLRecord in Freemarker

How can I get the dynamic attributes from a DDLRecord inside an Application Display Template (ADT) that has an Asset Publisher type using Freemarker?
As far as I know, I don’t have any other choice that doesn’t involve an Asset Publisher ADT, since I use the filters provided by the Asset Publisher. In case you need context, my Dynamic Data List (DDL) has a date attribute and I need to show the record from the latest date.
It is totally possible to get dynamic attributes from the asset publisher. However, you can also display your DDL inside a portlet where you can customize your display.
To do this you would need to know the unique id of the DDL (this can be gotten from your liferay admin interface) and the you can elicit the attributes and then order your list as is appropriate for you.
Check out this example
https://github.com/Temire/Getting-DDL-Attribute-Dynamically/blob/master/GetDDLAttributejava

Hybris core itemtypes

sorry if it is too simple questions. I am using b2c extension and cannot find definition of Product and Category itemtypes definition. Can someone direct me where to search that files.
The definition of an item can be done through several files in hybris.
In the case of product, depending of the extensions you use, your model will change.
To know all files that define product use your IDE research and look for all itemtype code="Product" in all *.items.xml.
In the case of catalog you can do the same thing, currently all the definition is done in one file : catalog-items.xml in platform/ext/catalog/resources
An other way to know all attributes defined for a type is to use the backoffice.
Go to system->types and search for your type, then in property tab you will find the list of all attributes defined for this type.
product and category should be there in core item xml file present in platform .
One needs to extend it in custom extension and define in custom item xml .

Reusing a custom ContentPart in the same ContentType

I'm trying to figure out the best way to handle a requirement I have for an Orchard module I'm building.
I have a ContentPart that has a few fields. One field is a ContentPicker that allows for multiple items to be associated to the part. The rest are descriptive information.
The issue I have is that I actually need to be able to include more than one of this ContentPart into a ContentType. I need to create a ContentType that has exactly 3 of this part.
Should I be making this into a field instead of a part? Is it even possible to have a ContentField that has other fields in it?
Or, should I somehow use all the same models and data structures, but somehow define it as 3 distinct parts?
Just wondering what the best practice to do something like this would be.
You can only have one part of each kind on a given type. You can't have fields that have other fields in it (instead - take an existing field and extend it with custom stuff).
As I understand, the actual problem is "how to make groups of fields with some metadata for each group", right? If so, there are a few approaches to solve the problem:
Create a custom field based on Content Picker (basically - take existing Content Picker and extend it with your metadata) and use this without the need for a separate part
Create one part to hold only the metadata for each field attached to it and attach 1 or more fields to it
Create 3 distinct parts. Parts should be thought of as extensions that add some unique features to an item. If you think it's logically ok to have 3 parts then go for it.

Resources