How to give the link dynamically for compare products in Opencart 2.x? - opencart2.x

I have made a custom bar in header section in opencart 2.1.0.1. Shown in the figure Header custom bar.
Where I want to give a link to view compared products.
I know that "$compare" is the variable to get the path. I wanted to access "$compare" but it is giving the following error
"Undefined variable compare in ..../header.tpl in line 68"
How to give the link dynamically for compare products ?
Suggestion and Solutions are appreciated.
Thank you.

Hi for this you need to modify header controller as well
$data['compare'] = $this->url->link('product/compare');
Put this line to your header controller than $compare will work on header.tpl

Related

Magento 2: Get store country full name in CMS pages

I want to show the store country full name in a CMS page.
When using:
{{config path="general/store_information/country_id"}}
It's only showing the 2 letter code. Like "FR".
But I want to show "France".
For phtml/php you can use this solution.
But how to solve this for CMS pages and Blocks?
Not the most elegant solution, but you could create a PHTML file from the solution you linked to, then call that from inside your page/static block with {{block class="Magento\Framework\View\Element\Template" template="Vendor_Module::myfiles/myfile.phtml"}}.

How to tell MODX wayFinder to detect the resource ID it is currently on

I am new to WayFinder but I have been working with it a bit and it has worked great for me, However I need something a little more dynamic that I'm not sure how to do.
I have a set of 5 pages in my website and each page has another side menu, but each menu for all five resources will be slightly different
I need wayfinder to detect what the current ID is and then display the appropriate menu
I've tried a couple things but nothign i can get to work:
[[!If? &subject=[[*28]] &then=[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]]]
So I need to say if the ID is = to 28 display this menu if the ID is = to 29 display this one and so on.
I've also tried &idIs=28 and a couple other variations but couldn't really find anything to help me out on this Does anyone else have any ideas how to make this work? Thank you.
With the solution typeset suggest, wayfinder will be called each time thereby causing uneeded loading time to your site. This will be faster because wayfinder only will be called when id = 28.
[[[[*id:is=`28`:then=`Wayfinder? &startId=27 &excludeDocs=28,29,30,31,32,33,89`:else=``]]]]
Read more on it here: http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/
You can use output filters for conditional calls. Documentation for them is here
You code would looks something like this:
[[*id:is=`28`:then=`[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]`:else=``]]
If the menu needs to start from the current ID then you'd use
&startId=`[[*id]]`
If you want it to show all the resources in the current folder, you can use UltimateParent, so
&startId=`[[UltimateParent]]`
Hope this helps!
This should work. The subject is just the parameter you are comparing it against so it shouldn't contain the value.
[[!If?
&subject=`[[*id]]`
&operator=`EQ`
&operand=`28`
&then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89`]]`
]]

Drupal 7 Programmatically Replace Field in Views

I have a question regarding Drupal 7 and the Views API.
I'm writing a module that replaces specific text in views. Essentially what I'm trying to do is scan text in a view (or page for that matter). Let's say the view has [special button] will be replaced with
l(t('button'),'mypage',array('query',array('page'=>$node->nid)));
Or whatever. Please understand this is pseudo code.
I've took a look at hook_view(), hook_node_view() (http://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_view/7) and neither of them seem to work for me.
I've also looked at http://drupal.org/node/1510828 but that didn't seem to help me out.
Have you tried selecting 'rewrite the output of this field' on the field/s ?
Or alternatively Views PHP should be able to do what you want.

Liferay Hook customization

I wanted to write a hook which will place a new field in new document type along with present ones(textbox, selectbox etc.)."I need That new field which works like dropdown box under Metadatasets as screen shot shows .and also i need to get values from database whenever i select that field in the available fields if we choose "select" it show option1 ,option2 ,option3 .."
Can anyone know which js and jsp files should I edit.? Please help
https://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/lp-6-1-ugen04-document-types-and-metadata-sets-0
i was unable to upload image,Can u plz see the above link.in this page figure 4.6 is the image.
Since Document Types are part of Document library so you can check-out: \portal-web\docroot\html\portlet\document_library\edit_file_entry_type.jsp. and other related pages which might be accessed from this page.
Hope this is what you want, again I would suggest to please pay heed to my comments to your question.

XPages view control link manipulation

I have a view control and at least one column has the option "Display as link" set. The link is generated manually. What I want to achieve is to add a url parameter which is added to a view column link. The usual link would like this
"http://host/path/file.nsf/$$OpenDominoDocument.xsp?databaseName=server!!path/file.nsf&documentId=03871DD0B47F88D4C12576AB00623137&action=editDocument"
What I would like to have is:
"http://host/path/file.nsf/$$OpenDominoDocument.xsp?databaseName=server!!path/file.nsf&documentId=03871DD0B47F88D4C12576AB00623137&action=editDocument?param1=value1&param2=value2&etc..."
There must be a (presumably easy) way to achieve this - unfortunately I don't know how...
Any help or hint is appreciated.
Many thanks in advance.
Michael
Follow the below steps:
1. go to All Properties of view Column which displays column values as link.
2. Compute the PageUrl with the below Code.
var col:com.ibm.xsp.component.xp.XspViewColumn = getComponent("viewColumn1");
col.getDocumentUrl()+"&param1=value1"

Resources