How to direct localhost to mystorefront in hybris? - sap-commerce-cloud

Now when I go to https://localhost:9002/ it opens hac (hybris admin console).
When I go to https://powertools.local:9002/nystorefront/powertools/en/USD/cart I can reach my storefront.
I want to reach mystore when I go to localhost:9002.
What should I do?

I will assume your web extension name is mystorefront.
Add these into your config/local.properties
# This way hac extension will be available on https://localhost:9002/hac instead of https://localhost:9002/
hac.webroot=/hac
# If you want to remap the context path to the root site on the web container
# then you must set these values to be blank, do not set them to be '/'
mystorefront.webroot=
storefrontContextRoot=
Also make sure that the urlPatterns associated with your CMSSite allow you to access your storefront via: https://localhost:9002/
You can also find this properties and additional information in your mystorefront/project.properties.
As already mentioned there, "If you want to change these values then it is suggested that you override both
of them in your config/local.properties file rather than changing the value here".

You have to configure webroot and storefrontContextRoot in local.properties file.
1) Add properties to your config/local.properties, change mystorefront (mystorefront.webroot) with your storefront name. Also, need to change hac webroot to /hac
hac.webroot=/hac
mystorefront.webroot=
storefrontContextRoot=
2) To open your site without passing query parameter(?site=mysite), run the below Impex. Change mysite with your CMSSite name. This will also resolve your error(Cannot find CMSSite associated with current URL).
$siteUid=mysite
# CMS Site
INSERT_UPDATE CMSSite ; uid[unique=true] ; urlPatterns ;
; $siteUid ; (?i)^https?://[^/]+(/[^?]*)?\?(.*\&)?(site=$siteUid)(|\&.*)$,(?i)^https?://$siteUid\.[^/]+(|/.*|\?.*)$,(?i)^https?://[^/].*$ ;

Related

OpenCart - finding files

I am relatively new to OpenCart and need help locating the right files on Cpanel to customize site, most especially the home page. How do I locate a file name using Google Chrome Inspect element on storefront and then find the same file on my Cpanel File Manager? I am most especially looking for the html file on file manager for the home page. I would appreciate any advice.
Let me tell you the correct way.
Lets say your store URL is
http://demo.opencart.com/index.php?route=common/home
There are two parameters after route. They are
1st is folder
2nd is file
3rd is function
Since we know that this is the front end, so we will go in catalog folder in root. If you have to find the file in admin panel, you will check inside admin folder in root.
So http://demo.opencart.com/index.php?route=common/home is basically CATALOG FOLDER / common folder / home.php / function index().
If we have to search something in admin lets say http://demo.opencart.com/admin/index.php?route=catalog/category/add&token=43d61e31aa46a1e66b4bfe63181ebe85 so it is basically ADMIN FOLDER / catalog folder / category.php / function add().
Now if you go through the function, there will be a line at the end something like this.
$this->response->setOutput($this->load->view('common/dashboard.tpl', $data));
This is your tpl file. Go inside the views folder, templates, common, dashboard tpl. This is your desired file.
I know this is an old question, but sometimes it's harder to find what you are looking for in OpenCart.
I have been searching for someting for more than an hour. As it turns out, what I was looking for (PHP CODE), was written in DataBase for whatever reason in this oc_modification table as an XML-ish text.
So if you are having trouble finding some file, it actually might not be a file at all. Actual code snippet could be in DB.
I use opencart 3.x.
Easiest way to find something is by downloading whole project, opening it in notepad++ and using "Find in Files" tab. If you can't find it there, there is a big chance you find it in DB.
Open PhpMyadmin, go to current database for your project, press SEARCH button on top, put wildcard like '%YOURTEXT%', make sure to select "ALL TABLES" and click GO.

How do you find the user-selected install path in Inno Setup?

I need to get the path that the user chose to install my application into.
If I set CreateAppDir=yes and set a DefaultDirName=C:\MyApp\ the user can change it to some other directory. After they do this, I need to know which directory they chose on the next install wizard step. How can I get this value?
Use the {app} constant. The reference describes it as:
The application directory, which the user selects on the Select
Destination Location page of the wizard. For example: If you used
{app}\MYPROG.EXE on an entry and the user selected "C:\MYPROG" as the
application directory, Setup will translate it to
"C:\MYPROG\MYPROG.EXE".
Optionally you can use the WizardDirValue function. This one is described as:
Returns the current contents of the edit control on the Select
Destination Location page of the wizard.
Unlike ExpandConstant('{app}'), this function will not fail if called
after the wizard is shown but prior to the user selecting a directory.
Rather, it will return the default directory name.

Liferay login portlet display text change

Change display name in login portlet from “Screen Name” to “Username”. As per discussion in liferay forums I am assuming that it can be done by using creating hook. Is there any easy way to change the display text.
As reported by discussion forum the best way to do it it's a hook. Your choice if you prefer change login jsp or change the "screen-name" resource bundle properties files. Be aware that changing screen-name label affect whole portal and wherever screen-name label was used (not only login portlet).
If you don't want write a hook, you can try to add to Liferay web application a file named Language-ext.properties within the WEB-INF\classes\content (if content dir doesn't exist create it). Edit Language-ext.properties and add a line with screen-name=Username. Restart Liferay. It should works.
Be aware that language specific version of Language properites files takes precedence over "-ext" version and location specific version takes precedence over language version. If your portal-impl contains language/location specific version you have to ovverride it with relative language specific ext file (e.g. Language-ext_en.properties)

Add menu item in XAMPP

I want to add a menu item in my xampp home page, right in the Demos category. I can see in here there are multiple items like CD Collection, Biorhythm, Guest Book etc..., I want to add my folder "Courses01" right before CD Collection.
How can I do that?
Here's where I want to place it
I forgot to mention, I saw this option in WAMP, I had a directory in /www folder and I could browse my directory from the browser, just click on the links. I want something similar.
In order to display the folders where you code, all you need to do is:
Stop the servers (Apache, MySql etc..)
Go to your XAMPP directory (where you've installed it)
Rename the file htdocs to *htdocs_default* (that's so you know which one's the original one...)
Create a new folder called htdocs
Store your PHP scripts here or folders and have fun!
NOTE: To access your workpath in the browser, you just type localhost (as usually).
May be it is too late but ...
You can add your menu item by modifying 2 files :
First add your items in the file name [your_langage].php. You will find this file into the directory [xampp_dir]/htdocs/lang/
Into the file (en.php for example), add the navi component you want.
For example, in your case :
$TEXT['navi-course01'] = "Course01";
after the line " $TEXT['navi-phpswitch'] = "PHP Switch";"
Save your file
Secondly, you have to modify the file phpexamples.php into the directory :
[xampp_dir]/htdocs/xampp/navilinks
Add your menu item for example :
<a class="n" target="content" onclick="h(this);" href="external/mycourse01dir/index.php"><?php echo $TEXT['navi-course01']; ?></a><br>
Save the file, restart your menu eg. http://localhost
If you want this modification in all the languages of your xampp installation, please, you have to modify all the files in the dir lang.
The menu items are shown in the same order they are ordered in the phpexample.php file
Regards

Magento system.xml cache issue

I have been building a module and making numerous changes without any problems until just now:
I removed a configuration variable from my extension's system.xml file but the field is still in the config. I disabled all caching, flushed all caches (both through magento admin and by manually deleting everything in the directories) but it STILL won't go away.
As a test, I added it back to the system.xml file using the same node name but changing the label and it picked up the change. I was also able to hide it by setting <show_in_...> to 0. However, after it went away, I removed it from the system.xml file and it showed up again in the admin. I have to imagine this is a caching issue but I can't figure out what to flush to make it go away.
Any thoughts?
Two things to check. When you save a configuration value, magento (currently) persists it to the core_config_data table. Even if you remove the configuration field from your system.xml config. that path/value pair will still be stores in this database. Do a
SELECT * FROM core_config_data WHERE path = '/foo/baz/bar'
To see if there's still a values in there. If it is, calls to Mage::getStoreConfig will still return a value, again regardless of what's in system.xml
Secondly, Magento allows you to stores a default value for each configuration path in config.xml. Look under the
<default>
<foo>
<baz>
<bar>1</bar>
</baz>
</foo>
</default>
node for a nested tree path that matches your configuration path. If this node is present then this value will be returned for requests to Mage::getStoreConfig.
system.xml values are stored in the db, core_config_data: have you delete it there?

Resources