Custom fields in my joomla component - joomla

I add in submenu of my component for Joomla 3.8 next items:
JHtmlSidebar::addEntry(JText::_('JGLOBAL_FIELDS'), 'index.php?option=com_fields&context=com_railway2.direction', $vName == 'fields.fields');
JHtmlSidebar::addEntry(JText::_('JGLOBAL_FIELD_GROUPS'), 'index.php?option=com_fields&view=groups&context=com_railway2.direction', $vName == 'fields.groups');
And made 1 custom group and 1 custom field.
How i start to add values in this custom field in my view "direction"?

Related

Tableau: How to restrict a dropdown filter to fields that start with "2021*" (a fiscal week field that adds a new field weekly)?

I need an automatic way to have new fiscal weeks (a string that looks like yyyyww) added to my dropdown filter. It's necessary that it's a dropdown unfortunately. Can I just filter out all values that don't start with "2021*" in this particular table? I use those other values in other parts of my dashboard, so I can't filter them out of my data completely.
Create a calculation called DateDisplay as follows:
IF STARTSWITH((STR([Period])),'2021') = TRUE then 'Display'
END
Add the new DateDisplay field to the Filters Shelf and uncheck NULL
Select 'Show Filter' for the string date field
On the drop down menu (down arrow on the right) for the filter which is now showing, select the options 'Only Relevant Values'

Tier price not working on Migration_Default attribute set Magento 2

I just migrated to magento 2.2.6. If I change the attribute set of product from 'Migration_Default' to 'Default', then it works fine. Also that it is just not showing on product detail page, but working fine in cart page on both attribute sets.
Got it resolved. In my case it was a qty attribute that was duplicated, i.e their were 2 qty attributes in 'Migration_Default' attribute set. So I just made the values of all products with 'Migration_Default' attribute set, to zero '0' from admin. (catalog > product > filter > {attribute_Set -> Migration_Default, status -> enabled} > select all > update attributes > quantity attribute -> 0 > save). Hurry!

Magento How to Add Product attribute of dropdown with Key Value Pair

I tried to add a new "product attribute" of dropdown type filed in Magento, i am able to add my dropdown values, but what i need is to add the dropdown as Key => value pair, these key values are used by NAV System. So, how can we achieve this ??
Let me explain with an example :
S.No Key Value
1 IND India
2 AUS Australia
3 NZ New Zealand
Now, i am able to to insert values(India, Australia, New Zealand,...) ; Now i need to insert Keys ( IND, AUS, NZ,...) Because i have to send these key values to NAV System(ref: http://en.wikipedia.org/wiki/Microsoft_Dynamics_NAV), as we integrated magento with NAV.
This is Magento natural function of Magento.
When you setting values to Magento EAV attribute (Catalog / Attributes / New Attribute / Values (on left)), there are fields named Admin, Default Store view etc...
There you set admin value NZ and for default store view set New Zeland, in export/import value will be saved as NZ. New Zeland will be visible only to customer on frontend.

Magento set "Show All" products by specific category (or in .phtml) rather than globally

I'm aware of the setting in the admin panel for the default number of products to show on the category list pages. This appears to be a global setting for the whole store. I'm looking for a way to set this on a per category basis (e.g. have most categories default to 25 products per page, but one specific category default to showing all products on the first page). Ideally this would be done in admin or in a .phtml file if possible. How can I set the default products per page for a specific category?
Take a look in
design/package/theme/catalog/product/list/toolbar.phtml
The items per page select drop down is generated by a for loop around:
$this->getAvailableLimit()
The block for the toolbar has the following method on it:
public function getLimitUrl($limit)
{
return $this->getPagerUrl(array(
$this->getLimitVarName() => $limit,
$this->getPageVarName() => null
));
}
The trick is to do one of the two following:
1) leverage magento to build the proper url when it is injected in any link directing to the category you want to be in view all mode.
2) on the /catalog/product/list/toolbar.phtml block check the current category, if the current category is the desired category execute the following code:
if( strtoupper($this->getLimitVarName()) != "ALL" )
{
$viewAllUrl = $this->getLimitUrl('All');
$this->_redirectUrl( $viewAllUrl );
}
At Admin Panel
Go to -> CMS -> Pages -> Home Page
Click on "Content" tab on LEFT
Click on "Show/Hide Editor" Button at RIGHT
Copy - Paste This Code there :
{{block type="catalog/product_list" category_id="2" template="catalog/product/list.phtml"}}
Give Category ID of your desired Category
To check Category_id of any category Go to : Catalog Menu -> Manage Catagories
Click on category, at right side's TITLE somewhat like will be displayed :
"CATEGORY_NAME ( ID : 5 )"
Regards.

How can I add "Quantity" to a VirtueMart "Browse" page?

My VirtueMart shop.browse page has the typical columns of SKU, Name, Price, and "Update" (which contains the Add to Cart button). I would like to add a Quantity column between Price and Update so that a buyer can choose a quantity prior to pressing the "Add to Cart" button.
Though I don't know HOW to do this, I think I know WHERE to do it:
/public_html/components/com_virtuemart/themes/default/templates/browse/includes/browse_listtable.tpl.php
Lines 67-72 of that file tell the program how to build the table, but what I DON'T know how to do is modify the code source to tell it to include quantity as an element for the table. Here's the code:
// Loop through each row and build the table
foreach($data as $key => $value) {
$table->addRow( $data[$key], 'class="sectiontableentry'.$i.'"', 'td', true );
$i = $i == 1 ? 2 : 1;
}
Which include file is actually being called in this foreach loop, and what code would I add to reference quantity data?
You should not modify your core code. If you just need to put quantity box inside your browse template use variable $form_addtocart
It will give you quantity box and add to cart button.
All variables for browse page and for flypage template you can find here:
http://virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html
If this is not what you are trying to get, please be more specific, or show your web page.

Resources