Sylius 1.0.0dev- base currency is thrown out when adding new currency - sylius

I added new currency EUR. The symfony debug toolbar now shows the base currency as "undefined" (in green colour as the selected value) and shows USD next to it (grey colour).
Also there is twig runtime error (currency could not be found) when rendering layout.html.twig and this is obvious as it arrives from renderSelectorAction in currency controller.
I think something is broken.
Can someone explain how to set up new currencies in Sylius 1 dev.
Thanks

Solved this by just selecting the base channel from debug toolbar. It removed the undefined currency and selected US$.

Related

In Opencart 3 under PHP 8 how do I call module to show in another page

I have seen on this site the post re calling a module on needed page. I have tried to use this code to solve a problem. This code does not appear to work for me.
What I have is a module that places a label over each product depending on its status. It works well on products throughout site. However I have a module which calls all products on to one page. I want the label to appear on the products on this all products page.
Banner on product
The code I used in catalog/controller for the all product extension from previous post here was (382 is the label module number):
$this->load->model('382');
$my_variable = $this->model_setting_module->getModule('382');
$data['any_variable'] = $my_variable['any_variable'];
On Template page:
{{ any_variable }}
How can I get the module to be apply the label to the custom all products page?
As always help appreciated
Create new module with name: "my_module" and you can call it in your "another_module" controller file:
$data['my_module'] = $this->load->controller('extension/module/my_module');
and in corresponding "another_module" template file you can retrieve it:
{{ my_module }}

Vue Storefront: Display labels for custom attribute filter instead of option id

I am trying to figure out from couple of days how to display label for filters on category page. As mentioned in document I have added attribute inside config.products.defaultFilters[] and the filter have started showing there.
I have color and brand filters. For color filters I have mapped color id to color name in config.products.colorMappings so it is displaying correctly there. But for brand I can do the same but it is a static solution so every time admin adds new brand I will need to add its mapping and build the storefront again.
I have tried to check their forum but nothing useful. I checked Vue Storefront vuex catalog and category-next stores for hint but cannot find anything related there.
The label for option under brand_filter should be readable but it is showing that brand attribute option's id
Ok, after spending couple of days finding solution to this problem, I finally got a hint from this answer.
I am using theme vsf-capybara, and according to its guide, to setup I generated a local.json from generate-local-config.js and I merged configuration manually from that local.json to config/local.json file. Prior to this there was no filter named brand or color added already to the main config file.
The config property responsible for the filter labels to be incorrect was entities.attribute.loadByAttributeMetadata and it was set to true I changed it to false because core/module/catalog/CatalogModule has one action attribute/list needs to be dispatched for application use. So if entities.attribute.loadByAttributeMetadata in config/local.json is set to true, this action will not be dispatched. Here is the excerpt from CatalogModule:
if (!config.entities.attribute.loadByAttributeMetadata) {
await store.dispatch('attribute/list', { // loading attributes for application use
filterValues: uniq([...config.products.defaultFilters, ...config.entities.productListWithChildren.includeFields])
})
}

How to add Price field to Odoo Product template?

I am using this free Odoo data slider module on website.
https://www.odoo.com/apps/modules/9.0/website_snippet_data_slider/
A nice module and works well too.I need to add "price" field in to this as currently it displays product name only.
Accordingly to this module we can add fields to slider from product.template to this section
https://github.com/laslabs/odoo-website/blob/9.0/website_snippet_data_slider/static/src/js/data_slider.js#L131
have tried to add price field like this
this.priceField = this.widgetOptions.data_price_field;
this.fields = [this.priceField, 'lst_price'];
unfortunate it doesn't work.Can anyone point me the reason and fix?
Thanks
Basically you need to map the value of the price to an html element. I have not tested this however if you take a look at data_slider.js just follow what is done for the display_name (product name data_name_field) from top to bottom.
You will also want to do some formatting for currency and so on. This should get you going in the right direction. Good luck!
In data_slider.js try making the following changes.
Below line 27 add:
data_price_field: 'price',
Below line 125 add:
this.priceField = this.widgetOptions.data_price_field;
Replace line 131 with:
this.fields = [this.nameField, this.priceField, 'id'];
Below line 96 add:
var $price = $('<h5>').text("Price " + record[this.fields[1]]);
Replace line 97 with:
var $caption = $('<div class="caption">').append($title).append($price);

Drupal 7 - Print PDF and Panelizer

Hi guys ,
I'm currently working on a Drupal project which use the Panelizer module by overriding the default node display. The panel for this content type is made width a lot of rules and specifications in order to display some specific content (like views) according some fields.
Now I need to print in PDF the same content that is displayed by the panelizer module but in another display (in one column ), so I cloned the display I use and rearranged it to display what I want.Then I want to use this display width the print module but I didn't managed to do that.
Any idea how can I do that ?
I just can't use the default node render, because I would miss some informations dues to the specifications used in the panel, and I can't print the panelized content because it's not the same display.
I read this thread but how can I say to the print module to use the "print" display I cloned instead of the default one ?
Any suggestions or ideas will be appreciated or if you have another idea for doing that you're welcome :)
Thank you !
In your print pdf template you can load the node then create a view with the display and finally render it : drupal_render(node_view(node_load($node->nid), "name of your display")) ;
Another way is to alter node entity info, telling that 'print' view can be panelized, i.e.
/**
* Implements hook_entity_info_alter().
*/
function mymodule_entity_info_alter(&$entity_info) {
$entity_info['node']['view modes']['print']['custom settings'] = TRUE;
...
}
After that, you go to panelizer settings of your content type(s), and set whatever you want for the print view mode

layered navigation block - place in product sort place prestashop 1.6

I want to create a manufacturer (brand in my case) filter using the layered navigation block and place this next to my default sorting
in ps 1.5 i did this by inserting this code at my category.tpl
{include file="./modules/blocklayered/blocklayered.tpl"}
So now my problem is when i do this step at prestashop 1.6 i ecounter this error
Notice: Undefined index: nbr_filterBlocks in /home/vhost/dextertonstore2/cache/smarty/compile/2a/3d/27/2a3d274f79f30dbcf6a26fed74f871da2fb62e0e.file.blocklayered.tpl.php on line 44 Notice: Trying to get property of non-object in /home/vhost/dextertonstore2/cache/smarty/compile/2a/3d/27/2a3d274f79f30dbcf6a26fed74f871da2fb62e0e.file.blocklayered.tpl.php on line 44
Notice: Undefined index: nbr_filterBlocks in /home/vhost/dextertonstore2/cache/smarty/compile/2a/3d/27/2a3d274f79f30dbcf6a26fed74f871da2fb62e0e.file.blocklayered.tpl.php on line 436 Notice: Trying to get property of non-object in /home/vhost/dextertonstore2/cache/smarty/compile/2a/3d/27/2a3d274f79f30dbcf6a26fed74f871da2fb62e0e.file.blocklayered.tpl.php on line 436
i tried to clear the cache and recompile my template, i even deleted manually my cache in \cache\smarty\cache and \cache\smarty\compile but still im getting this error.
is blocklayered.tpl the same between the two installations (old and new)?
As I know, ./modules/blocklayered/blocklayered.tpl is overriten after update. So maybe some of your changes are lost, especially regarding nbr_filterBlocks variable. You should do your changes inside of your theme folder (my-theme/modules/blocklayered/blocklayered.tpl).
i found the solution here, this error occurs because there were no values that is pass on to our page.. in order to include the blocklayered.tpl to work .. what i did is i transplanted the layered nav into my left column and display it to none.. in this case .. the values are pass to our page by the blocklayered.php