Magento remove store code for default store view - php

I've Magento multilanguage store and I need to add store code to url. In this path System > Configuration > Web > Url Option > Add Store Code to Urls I've turn ON, then I see in url as such site.com/en (default), site.com/br (brazillian).
How I can remove EN in default site.com/en and get for default store site.com without EN path??

I have made a new extension available on GitHub that allows you to hide the default store code from URLs.
More information here: https://github.com/jreinke/magento-hide-default-store-code

By Default magento will only allow you to change this config option for the whole setup, you can't change it on a by store basis.
You can possibly update magento to allow you to specify different settings for this option per website to allow you to do what you need:
app/code/core/Mage/Core/etc/system.xml
<use_store translate="label">
<label>Add Store Code to Urls</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<backend_model>adminhtml/system_config_backend_store</backend_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</use_store>
Note, you should not change this file directly, but overrie it in your own module. You can find many tutorials out there for helping to override core magento configs and files.
if you updated the scope settings:
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
this will allow you to change the "Add Store Code to Urls" for each website/store front in the admin section.
Now you can try and set "Add Store Code to Urls" = NO for the default store
and "Add Store Code to Urls" = YES for the others.
Please note I have not tested this, so I would not do this on a live store :)

I have an alternative solution that worked well too.
Copy app/code/core/Mage/Catalog/Block/Widget/Link.php to app/code/local/Mage/Catalog/Block/Widget/Link.php
Search for (line 91 in Magento 1.7.x / line 100 in Magento 1.9.x)
$this->_href = $this->_href . $symbol . "___store=" . $store->getCode();
And modify to
$this->_href = $this->_href;
Upload and save your changes and you'll now not have your widget (dynamically) inserted links getting appended with ?___store=default.
Credit: DesignHaven

Related

How custom template implement in opencart

I am new in Opencart, I have installed Opencart 2.3.0.2 in my xampp server.
I have a custom html template. How I implement it in Opencart ?
can I use the template in same store(opencart default) or another ?
Thanks alot.
Make copies…
To start with copy the default folder found in
upload/catalog/view/theme/default
to a new folder in the same directory. Name it “mytheme“.
Then copy the theme_default.php file in
upload/admin/controller/extension/theme
and place it in same directory. Name it “mytheme.php“.
Rename the class to (line 2):
ControllerExtensionThemeMyTheme
+ Replace all “theme_default” text to “mytheme“. Yes there are a lot (197).
Copy the theme_default.tpl in
upload/admin/view/template/extension/theme
and place it in the same directory. Name it “mytheme.tpl“.
Replace all “theme_default” text to “mytheme“. (48)
Copy theme_default.php in
upload/admin/language/en-gb/extension/theme
and place it in the same directory. Name it “mytheme.php“.
Set the new theme’s title in heading_title (line 3) to “My Theme”.
Finally for the thumnail image to show correctly in store settings rename default.png to mytheme.png in
upload/catalog/view/theme/mytheme/image
Now go into your Administration > Extensions > Extensions and select Themes in “Choose the extension type”. You should be seeing your new theme. Install it with the green (+) button and edit it to enable it. Also ensure you set the correct theme directory whilst editing the theme!
Then in System > Settings edit your store to use your new theme.
That should do it. You can now go ahead and start chopping and changing the default theme.

Typo3 add a new option or change existing options in backend for Page Frontend Layout drop down not working

i am clearly missing something, but i can't figure out what. I am developing site on Typo3 CMS v7.6.10. I included my extension configuration in TS template.
In \Configuration\TCA\Overrides\pages.php:
<?php
defined('TYPO3_MODE') or die();
// Add pageTSconfig
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'/**/', // my extension
'Configuration/PageTS/pages.ts',
'My special config'
);
In \Configuration\PageTS\pages.ts: (from question here)
TCEFORM.pages {
layout.altLabels.0 = Normal
layout.altLabels.1 = Startpage
layout.altLabels.2 = Landing page
}
After clearing all cache, reinstalling extension nothing had changed in Edit page - Appearance - Frontend Layout drop down. Am i wrong and this configuration is for something else? This is just an example of me using TCEFORM.pages, my attempts to do something with other elements not working too. Do i need to include registered config file? If so, nothing appears in my typoscript template include options.
I am not sure if you did this but
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile()
"only" registers a PageTSConfig file for the selection in the page property. To include it you have to go to the properties of a page in the resources tab and select your file there (see screenshot). It is then active for this page and all subpages.
As an alternative you could use ExtensionManagementUtility::addPageTSConfig() instead. If you pass the <INCLUDE_TYPOSCRIPT string to that function your PageTSConfig will be loaded on every page.

Joomla, add position into file

I want to connect my Joomla module with position.
How can I create this position (user position)? Where is this file in the template?
If you have to create new positions (not defined in your current template) you have to edit /templates/template_name/index.php and add a jdoc:include statement where you need:
<jdoc:include type="modules" name="new-position" style="xhtml" />
Then edit /templates/template_name/templateDetails.xml adding the position:
<positions>
...
<position>new-position</position>
...
</positions>
In some templates, positions could not be in index.php, in that case search for other files that defines the template layout (always in /template/template_name/ folder or subdirectories).
Also consider to ask Joomla related questions on joomla.stackexchange.com to get better answers!
In general each template includes some positions, first check the positions available in your template.
Go to System > Global Configuration > Templates
From here enable the option Preview Module Positions.
Now if you go to Extensions > Templates You can click in the little eye icon or add in your url something like:
yoursite.com/?tp=1
Now you can go to Extensions > Modules > Your Module, here select the position of your choice.

get custom configuration into email template (Magento)

hyee . im not so good in explanation, but i'll try.
how to get data from configuration in magento to email template. example, i'll already add new field on store information which is on:
Configuration > General > Store Information
field that i add is gst no which is the code as below.
system.xml
<fields>
<gst_no>
<label>GST No</label>
<frontend_type>text</frontend_type>
<sort_order>31</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</gst_no>
</fields>
and it function as expected. now how do i call this value on email template. example like
{{var store_email}}
on the other words, data is work as variable.
or if there is a way to set GST field as global variable like email, contact phone and etc. I already try {{config path="general/store_information/gst_no"}} but is not work.On php level it would be work like thisMage::getStoreConfig('general/store_information/gst_no');
thanks in advance :)
You are going to the right way.
Add {{config path="general/store_information/gst_no"}} in you email template.
Now Login to admin panel and navigate to System->Permissions->Variables
Click on Add new variable and fill the text box with general/store_information/gst_no. Set Is Allowed to yes
Hope this helps you!

Changing Virtuemart Checkout Page Shipping address label

Please check this page:
https://newbabyhampers.com.au/index.php/checkout
I need to change the label of Shipment Addresses to Shipment address. I am using VM2 for this site. I have searched in all language files. But I cant find any HTML code or Language file text. I have also activated IceVMcart module. I really need to deliver this site soon. Where can I edit this label?
The output is overridden, please check:
templates/*your_template/html/com_virtuemart/cart/default_pricelist.php
*your_template = your active template name
The default value is: <?php echo JText::_ ('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL'); ?>
You could create a language override for this variable using:
Extensions -> Language Manager -> Overrides
Good Luck!
I have found the solution
I have edited 'en-GB.com_virtuemart.ini' in public_html/administrator/language/en-GB. All I needed to do was to change the COM_VIRTUEMART_USER_FORM_SHIPTO_LBL Label -> 'Shipment Address'. Thanks everyone for help.

Categories