texts: Add boost to Smile ElasticSearch category products

texts:
I'm trying to add a boost to products in a certain category to be displayed first. Using the Smile extension found in app\code\community\Smile\ElasticSearch\Model\Resource\Engine\Elasticsearch\Query\Abstract.php where the ElasticSearch is built

protected function _assembleQuery()
{
     $query = array('index' => $this->getAdapter()->getCurrentIndex()->getCurrentName(), 'type' => $this->getType());
     $query['body']['query']['filtered']['query']['bool']['must'][] = $this->_prepareFulltextCondition();
     ...
}

I'm trying to add something like:

$query['body']['query']['should'] = [
    'match' => [
        'field' => 'categories',
        'query' => 'id_of_category',
        'boost' => 10,
    ]
 ];

But this is not working. Returning error:

{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed;... nested: ElasticsearchParseException[Expected field name but got START_OBJECT \"should\"];

Can someone help, please?


texts: Can Magento Shopping Cart Rules be created only for a specific cart instance?

texts:
I would like to know if, after some conditions are met in a customers cart, it is possible for me to create a 'temporary' shopping cart price rule for that specific cart instance only?

For example- a customer uses a discount code in the cart, but I want to give this specific cart instance another 10% off. However, I don't want to create a "global" shopping cart price rule that will apply to other customers who are checking out around the same time.

Is this feasible? If the nature of shopping cart rules is that they exist irrespective of a shopping cart instance, then is it possible to modify the cart total/shipping/etc manually?

Thank you for your suggestions!


texts: How do i get enable /disable value from Magento admin?

texts:
I have created a module, where admin can enable/disable and also select any value from select options.

Now I want this data to check that values, and according to that I want to give some conditions to display menu on header. (If admin enables this, the menu will be displayed in frontend).

How do i achieve this?

Please let me know any way to do this.


texts: Place order using Magento Rest API - Issue

texts:
Magento 2 API docs

http://devdocs.magento.com/swagger/#/
http://devdocs.magento.com/guides/v2.1/rest/list.html

I am trying to place an order using magento 2 REST API. What i have done so far is given below,

Created an empty cart(quoteCartManagementV1: /V1/carts)
Added item to my cart(quoteCartItemRepositoryV1: /V1/carts/mine/items)
Assign billing and shipping info to my cart(checkoutShippingInformationManagementV1 /V1/carts/{cartid}/shipping-information)
Checking out using the cart I created above(quoteCartManagementV1: /V1/carts/{cartid}/order)

I have performed first three of the above four steps successfully, but while performing step no. 4 I am getting the following response from magento 2 REST API,

{"message":"Please enter a customer email."}

My Request against this response was,

{"paymentMethod":{"method":"checkmo"}}

Is there anything wrong in my work flow? Please help!!


texts: customer grid not showing list when added new customer using API

texts: i have created magento API to create the new user.it's functioning correctly.But newly added customer by API is showing in customer backend grid only if i reindex the customer grid .every i can't do this.anybody have solution please help with this


texts: How to create plugin for observer magento2

texts:
I want to create Plugin for observer SalesOrderAfterPlaceObserver, I created a di.xml file and added below coded,

<type name="Magento\SalesRule\Observer\SalesOrderAfterPlaceObserver">
    <plugin name="NameSpace_SalesRule::SalesOrderAfterPlaceObserver" type=" NameSpace\SalesRule\Plugin\Observer\SalesOrderAfterPlaceObserverPlugin" sortOrder="1"/>
</type>

And Created SalesOrderAfterPlaceObserverPlugin.php plugin File,

<?php

namespace NameSpace\SalesRule\Plugin\Observer;

use Magento\SalesRule\Observer\SalesOrderAfterPlaceObserver;
use Magento\Framework\Event\Observer as EventObserver;

class SalesOrderAfterPlaceObserverPlugin
{
    /**
     * @param SalesOrderAfterPlaceObserver $subject
     * @param                              $result
     * @param EventObserver                $observer
     */
    public function afterExecute(SalesOrderAfterPlaceObserver $subject, $result, EventObserver $observer)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('Your text message');

    }
}

But My Plugin is not calling.

Does have any idea?


texts: Post form, product id and date to database

texts:
I have created module to post comments. Basically I have added a new tab called Comments to product page view (just like reviews tab). So far I have managed to output comments based on product ID. Now I am creating post controller, it should save the form (name, email, text) and also add to database current product Id and date(created at). How can I achieve this?

This is my post controller:

    <?php

namespace Vendor\ProductComments\Controller\Post;

use Magento\Framework\App\Action\Action;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action
{
    public function execute()
    {
        $data = $this->getRequest()->getPostValue();
        $item = $this->_objectManager->create("Vendor\ProductComments\Model\Comments");
        $item->setData($data);
        $item->save();
        $redirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        $redirect->setUrl($this->_redirect->getRefererUrl());
        return $redirect;
    }
}

And this is my form.phtml:

<form action="<?php echo $this->getUrl("comments/post/index")?>" method="post">

    Name

        <input type="text" class="input" name="name" id="name_field">

    Email

        <input type="email" class="input" name="email" id="email_field">

    Comment

        <textarea name="comment" id="comment_field" cols="5" rows="3"></textarea>

    <button type="submit" class="action submit primary">Submit</button>

</form>


texts: How to remove items count from Compare products link in header

texts:
I don't want to remove the whole link from frontend theme I just want to remove a part of the link.
I don't know where the file that I should edit it
any help?


texts: Less file not included on frontend. Magento 2.3.4

texts:
I've got a really strange issue, If I choose to minify and merge css (or either or), then my site layout breaks because the less file style-l.css doesn't get included on the front page.

This doesn't seem to happen straight away, there seems to be some trigger, but I can't see what. Eventually style-l.css just doesn't get included on the frontend.

The style-l.css file is still accessible, it's just not being called to load on the front end.

Has anyone come across this before? Tearing my hair out as there are no error messages anywhere in the logs. I can't even work out when the site will break or what I can do to make it break to begin testing, it's completely random.

Using Magento 2.3.4 (migrated from Magento 1.9) Smartwave Porto theme patched to the latest version.


texts: Magento2, Admin panel. How to set ''require' for weight field to each sub-product of configuration product?

texts: Magento CE 2.2.1: I need to force user to input the value for weight of each sub-product in configuration product while add new product.


texts: Magento2 - How to hide price filter only in specific categories?

texts:
I want to hide price filter on some of my category pages.

Can anyone tell me how can I achieve this?

Thanks In Advance..!


texts:
I have a few questions about the css files delivered with magento and the best practices to do changes in them.

First of all I was not able to find a basic description for all the css files coming with magento. For example when is the reset.css file used?

But my bigger question is, why magento is doing almost everything in the styles.css by default?
Wouldn't it be a better idea to split the css into several smaller files and load those in the local.xml file for the different views? This allows for more control over the styling of the elements.

For example one could create a css file for simple product views and load the file in local.xml and another one for grouped products.

Another question i have is, about the -moz-* styles. Why are they in the styles.css and not in a firefox specific css file? If I use Opera (or any other browser) they show this styles as errors because they don't know about them.


texts: Check out page takes so much of time in Magento 2.2.4?

texts: Check out page takes so much of time in Magento 2.2.4. I tried to checkout the product in Magento 2 it takes so much of time


texts: magento 1.9 - How I can diagnose the exception.log file

texts:
I see this error on my exception.log, how I can diagnose or how I can find where is the issue?

2017-04-15T12:18:11+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Megamenu_Block_Megamenu' in /home/public_html/app/Mage.php:595
Stack trace:
#0 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('megamenu/megame...', Array)
#2 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('megamenu/megame...', 'leftmenu')
#3 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('megamenu/megame...', 'leftmenu')
#4 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(73): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(144): Mage_Catalog_Helper_Product_View->initProductLayout(Object(Mage_Catalog_Model_Product), Object(Mage_Catalog_ProductController))
#9 /home/public_html/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(5, Object(Mage_Catalog_ProductController), Object(Varien_Object))
#10 /home/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_ProductController->viewAction()
#11 /home/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#12 /home/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /home/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#14 /home/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /home/public_html/index.php(83): Mage::run('', 'store')
#16 {main}


texts: Single instalation with, multiple databases

texts:
Is it possible to make one installation, and from this installation to make multiple shops with different databases?

Something like I will make one installation on domain.1 with a database, and from admin I will crate a new website and a store on some new database for domain.2.

I know that multiple stores can be achieved with one database. But can it be the same with different databases.


texts:
As we know Magento release latest security patch 9652.

I have apply security patch on My server and check in https://www.magereport.com

but i can not find security patch is applied perfectly or not.

Can anyone know why its not display as green after we have applied security patch?

Thanks,


texts: Magento 2 - new inscription newsletter error (no such entity with customerId = 0)

texts:
I always have this error when I try to register to newsletter in Magento 2. The error is:

  No such entity with customerId = 0

If I try to add it directly from database, it works perfectly.


texts: Module installed and enabled but doesn't show up

texts:
I installed a module and the files are correct and the commands worked just fine but when I go to System > Advanced, it doesn't show up in the disable modules section at all but it shows up when I run module:status and it says enabled.

This is what I tried so far after installing the module:

Ran module:status and it shows as enabled
Ran setup:db-schema:upgrade
Ran setup:db-data:upgrade
Flushed all cache
Checked /app/etc/config.php and it shows up there
Switched to developer mode and back to production mode
Installed module in developer and production mode but no change
Installed old version of the same module that worked before and no change
Deleted entries from setup_module table and then redid install

Database related maybe?

UPDATE: After many attempts, I was finally able to see the module enabled in the System > Advanced > Modules section but I'm still not able to see the module section under the Store > Configuration so how can I get the module to install the necessary code to make that happen?


texts: Magento 2 + Permissions issue in Ubntu 16.04

texts:
Every time i run setup upgrade or static-content deploy command, I need to assign permissions to var, generated, pub/static etc in Ubuntu.

Is there any permanent solution for that so every time we don't have to give permission.


texts:
The project using an extension called 'Amitshree'. I need to override an email template file (filename.html) created in this extension in my project.

I need a step by step solution because I am not a Magento Developer.

I went through some solutions in this platform, but couldn't resolve my task.

Edited :
The following are the changes made in the files.

1. Copy the account_approval.html file from Amitshree/customer/view/adminhtml/email to app/code/project/tradeusers/view/frontend/email
2.The following line of code added in app/code/Project/Tradeusers/etc/email_template.xml

<template id="amitshree_customer_account_approved" label="Account activation confirmation for Trade user from Admin" file="account_approval.html" type="html" module="Project_Tradeuser" area="frontend"/>

But still the template loaded from extension only.


texts: Do not display a "per page" select box, if products are not paginated

texts:
I am working on a Magento 2.1.7 shop and I have created a child-theme of Magento Blank.

The products are 12 per page by default, but the user has the option to show 24 products per page.

Some (category) pages have less than 12 products, therefore, there is no pagination. I want, in such cases, the "per page" select box not to be displayed.

Adding a "paginated" class to the <body> tag would do the trick. How can I do that?


texts: How to hide short product description from Catalog page

texts:
I want to display short description in Product detail page.
But want to hide short description in Product list page.


texts:
I have been working on admin form where I want the user to select Start Date and End Date.

I have to provide validation such that the End Date must be greater than Start Date.

Could anyone pls help me in providing defautl Magento validation class for start and end date with the scenario as explained above?

If its not possible with default Magento validation, pls post custom JS code.

Also this is in my form for date range

        $dateFormatIso = Mage::app()->getLocale()->getDateFormat(
            Mage_Core_Model_Locale::FORMAT_TYPE_SHORT
        );

$fieldset->addField('start_date', 'date', array(
            'label'     => Mage::helper('myhelper')->__('Start Date'),
            'name'      => 'start_date',
            'note'      => $this->__('Start Date'),
            'required'  => true,
            'image'     => $this->getSkinUrl('images/grid-cal.gif'),
            'format'    => $dateFormatIso,
             'class'    => 'required-entry validate-date validate-date-range date-range-start_date-from'
        ));

        $fieldset->addField('end_date', 'date', array(
            'label'     => Mage::helper('myhelper')->__('End Date'),
            'name'      => 'end_date',
            'note'      => $this->__('End Date'),
            'required'  => true,
            'image'     => $this->getSkinUrl('images/grid-cal.gif'),
            'format'    => $dateFormatIso,
            'class'     => 'required-entry validate-date validate-date-range date-range-end_date-to'
        ));

Thanks


texts: Calculating average price of specific products over time

texts:
I'm trying to create a graph that will show the average price of specific products on my site over a period of time. What I'm struggling with is coming up with the most efficient query to use, in order to get the information I need.  I feel that Magento's querying method would be most efficient, so I'd like to know if that's possible first.

What's needed:

All products and their list price

Added OR updated in the last 30 days
Attribute set ID = 12
Type = virtual

Grouped by option ID from desired attribute ID

Example: Attribute ID / Code = 175 / Server

Options from that Attribute: Option ID = 22, 23, 24

I'd like them grouped into the option IDs.

Worth noting: Any item that has the attribute set ID of 12, must have the attribute 175 and one of the options selected.

I then would like to calculate the average of each option ID. So the average of 22 products, 23 products, 24 products, and so on.

I know it seems like a complex query, and I'm unsure of where to begin.


texts: Recently viewed widget display nothing - Magento 2.0.8

texts:
I installed Magento 2.0.8 without sample data.

When I insert the widget in the static block, it does not show any recently viewed product in home page(after sign in).

why it is not work in cms static block, below content is generated when I insert the widget in the block.

{{widget type="Magento\Reports\Block\Product\Widget\Viewed" page_size="5" template="widget/viewed/content/viewed_grid.phtml"}}

But when I do from content->widget and assign to cms home page main content it worked but it is always displayed on top of the content container even setting sort order 2000.

Note: I have tried with the below three configurations but no luck

store->configuration->catalog->recently viewed/compared->store
store->configuration->catalog->recently viewed/compared->website
store->configuration->catalog->recently viewed/compared->storeview


texts: Installing Google recaptcha:2.0.0 on Magento Open Source 2.2.6

texts:
Included in Magento documentation the following steps to install Google recaptcha:2.0.0 on Magento Open Source 2.2.6:

Install Module:

 composer require msp/recaptcha:2.0.0

Enable Module:

php bin/magento module:enable --all

php bin/magento setup:upgrade

For the first code composer require msp/recaptcha:2.0.0, I get this error message:

 Problem 1
    - The requested package magento/product-community-edition (locked at 2.2.5, required as 2.2.6) is satisfiable by magento/product-community-edition[2.2.5] but these conflict with your requirements or minimum-stability.
  Problem 2
    - Conclusion: remove magento/product-community-edition 2.2.6
    - Conclusion: don't install dotmailer/dotmailer-magento2-extension 2.5.0
    - Installation request for magento/product-community-edition 2.2.6 -> satisfiable by magento/product-community-edition[2.2.6].
    - Conclusion: don't install dotmailer/dotmailer-magento2-extension 2.5.0
    - magento/product-community-edition 2.2.6 requires dotmailer/dotmailer-magento2-extension 2.6.0 -> satisfiable by dotmailer/dotmailer-magento2-extension[2.6.0].
    - Can only install one of: dotmailer/dotmailer-magento2-extension[2.5.0, 2.6.0].
    - Can only install one of: dotmailer/dotmailer-magento2-extension[2.5.0, 2.6.0].
    - Installation request for dotmailer/dotmailer-magento2-extension (locked at 2.5.0) -> satisfiable by dotmailer/dotmailer-magento2-extension[2.5.0].

Any suggestions please about this problem?


texts: Magento 2 : Where is Estimated Shipping Information Saved

texts:
In which session or object, estimated shipping summary from cart is saving ?

When I checking checkout process, shipping form is pre-filling with that estimated information.

But any idea how we can take these values ?

[SOLVED]

I think Got it,

Magento2 saving data in local storage 'mage-cache-storage'.

Not sure, but I can see values there in shippingAddressFromData Object.


texts: Magento2 : interaction between a form block and three.js block

texts:
I defined 2 blocks which .pthml are

Block 1 (simplified) :

<form id="myform">
    <input id="myinput" type="number">
    </input>
</form>

<script type="text/javascript">
require([ 'jquery', 'jquery/ui'],function($) {

    $('#myinput').change(function() {
        var Value=$('#myinput').val();
        drawSomething(Value, THREE);
    });

});
</script>

Block 2 (simplified) :

<div id="canvas">
<script type="text/javascript">
require(['three'],function(THREE){
    var camera, scene, renderer;
    var mesh;
    init(THREE);
    });

function init(THREE) {
    ...
}

function drawSomething(thick, THREE) {
    var geometry = new THREE.BoxBufferGeometry( 100, 100, thick);
    var mesh = new THREE.Mesh( geometry);
    scene.add(mesh);
}
</script>
</div>

Both are called in the page via layout.xml

But when I change the value of the input, I have an error "THREE is not defined".

Than you for your help,


texts: How to Change default homepage to my custom page without coding

texts:
I have installed sample data on Magento, It has default homepage set.

I have created the new page called test (cms>pages>create page).

When I open my localhost, the test page should appear first rather than the homepage.

How can I do it?


texts: Magento2 css images deploy static files language

texts:
I'm trying to customize a theme with a child theme. When I add a new class in the css with background image it works like a charm in development both EN and FR (my 2 languages). I use the setup:static-content:deploy command in my production site to apply changes :

EN : ok
FR : images don't show in frontend

After many try, I check the /pub/static files : images are copied only in the EN folder (/pub/static/frontend/Vendor/theme/en_US/images). If I put directly the image in the fr_FR folder it works.

I'm probably missing something in my .phtml file to declare this in all languages available. Thanks for your help


texts: How to run setup scripts(InstallSchema/UpgradeSchema/InstallData/UpgradeData) without setup:upgrade

texts: Is there any way to run Magento 2 setup scripts without bin/magento setup:upgrade


texts: Magento 2: Error Disable some dates in jquery Datepicker

texts:
I try to add datepicker in magento 2 checkout page like this:
 ko.bindingHandlers.datepicker = {
            init: function (element, valueAccessor, allBindingsAccessor) {
                var $el = $(element);

                if (Array.isArray(holidays)) {
                  var options = {
                    showOn: 'button',
                    dateFormat:'mm/dd/yy',
                    minDate: calendar.min_date,
                    maxDate: calendar.max_date,
                    numberOfMonths: [1, 1],
                    beforeShowDay: function(date) {
                      var string = $.datepicker.formatDate('mm/dd/yy', calendar.holidays); //line 36 => this one that causes an error
                      return [ array.indexOf(string) == -1 ]
                    }
                  };
                } else {
                  var options = {
                    showOn: 'button',
                    dateFormat:'dd/mm/yy',
                    minDate: calendar.min_date,
                    maxDate: calendar.max_date,
                    numberOfMonths: [1, 1]
                  };
                }
                if (calendar.display_two_months !== false) {
                  options.numberOfMonths = [2, 1];
                }

                $el.datepicker(options);
                $el.datepicker( "show" );

and i got an error like this:
Uncaught TypeError: Unable to process binding "datepicker: function(){return true }"
Message: date.getMonth is not a function
    at Datepicker.formatDate (datepicker.js:1350)
    at HTMLInputElement.beforeShowDay (shipping-delivery-date.js:36)
    at Datepicker._generateHTML (datepicker.js:1753)
    at Datepicker._updateDatepicker (datepicker.js:781)
    at Datepicker.$.datepicker._updateDatepicker (timepicker.js:1396)
    at Datepicker._showDatepicker (datepicker.js:747)
    at Datepicker.$.datepicker._showDatepicker (calendar.js:542)
    at HTMLInputElement.<anonymous> (datepicker.js:2059)
    at Function.each (jquery.js:376)
    at jQuery.fn.init.each (jquery.js:142)


texts: Add new action in cartController.php in magento 1.9

texts:
I want to add a new action in cartController.php (core Magento file).

How to achieve this?
Any help would be appreciated.


texts:
The issue started with an indexing error. Error was sqlstate 1205.

We restarted mysql. We increased timeout. We increased memory because we are running a script and it takes up a good amount of memory but never had issues with the script before.

We now lost 900 products. Any ideas?


texts: Elasticsearch: No alive nodes found in your cluster & test connection gets failed

texts:
I have run this command:

composer show elasticsearch/elasticsearch

then all stats of elastic search runs perfectly. Attached is the screenshot. Also, I have configured in the admin panel. The screenshot attached as well then why my connection always failed. Please fix this solution & alive cluster found error comes in your cluster.


texts: Can't update products qty in cart Magento 2

texts:
I have some trouble with updating products quantity in cart. When I change qty in the mini cart and click update, nothing happened.

I saw a similar problem in Magento 1.9 and there were answers to add something to the cart.phtml, adding some form-id etc. But I have that in updatecart.phtml and it doesn't fix my problem in Magento 2.

Here is HTML of update button.

Here is issue: https://github.com/magento/magento2/issues/6656


texts:
I fill meta title for design settings and for seo settings in homepage cms, and still on homepage have empty meta title, for each other page works great.

Where I should find solution?


texts: Toolbar not displaying with overridden Mage_Catalog_Block_Product_List

texts:
I am banging my head against the wall on the following problem: To get a product list that is sorted by the subcategory string, an product attribute and finally by the product name I have overridden the Mage_Catalog_Block_Product_List class to provide my on construction of the list.

I first search for all categories and sub-categories at the current category level. Then I iterate over the found categories and fetch the product sub-lists of each category. These sub-lists are concatenated to an results array with all products in the current category as well as subcategories. Having this results array I use the native php function array_slice() to get the results for the current page (retrieved with Mage::getBlockSingleton('page/html_pager')->getCurrentPage().

I then create an empty collection like

$merged = Mage::getModel('catalog/product')
    ->getCollection()
    ->addFieldToFilter('entity_id',-1);

$sliced_results = array_slice($this->_results, $start, $length);

and iterate over the array slice of products and use addItem to fill the collection:

foreach ($sliced_results as $result) {
    if (!$merged->getItemById($result->getId()))
        $merged->addItem($result);
}

I assign my collection to the _productCollection member and return it.

All this works fine so far, sorting is just like I want to have it, but the Paging toolbar in the frontend will not show up.

When I use

$merged = Mage::getResourceModel('catalog/product_collection');

I will get an collection of all store products (OK, that does not wonder me), in other words I see my added products in the frontend plus all the other products of the entire store. But in this case I see the Toolbar.

So my problem is I do not know how to get to show up the pager toolbar with my collection.

All above described functionality is implemented in the overridden method _getProductCollection so I normally expect it to work. In the _beforeToHtml method in the overriden Mage_Catalog_Block_Product_List class it seems my collection also 'arrives', but I have the strong feeling, some information is missed. I tried to add setCurPage and setPageSize but nothing helps.

I would be so happy, if I could solve this problem. I am relatively new to Magento, it is my first project with this framework, so please bear with me.

Any help is greatly appreciated!!


texts: Get Payment method API keys in controller from admin sales->configuration->payment-methods?

texts:
I am integrating a custom payment module. I need to get the API keys in my controller. If possible in JS file also.

My Controller where I need to get the config values.

<?php
namespace vendorName\moduleName\Controller\Index;

class GetPrice extends \Magento\Framework\App\Action\Action
{
    protected $customHelper;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Vendor\Module\Helper\Data $customHelper
    ) {
        $this->customHelper = $customHelper;
        parent::__construct($context);
    }

    public function execute(){
        echo $this->customHelper->getConfig("payment/title/cmc_api_key");
    }
}

system.xml

        <group id="mypay" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="10" translate="label">
            MyPay
                <field id="title" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="20" translate="label" type="text">
                Title
            </field>

Thanks In Advance.


texts: Headers already send Magento 2 multistore addon domain

texts:
Multiple websites are working on Magento 2.2 with the addon domain method and symlinks.

The theme is visible, etc.

Only thing is that at the bottom I see the following message. Looking for advice.

Exception:
Warning: Cannot modify header information - headers already sent by (output started at /home2/staging/public_html/vendor\
/zendframework/zend-http/src/PhpEnvironment/Response.php:114) in /home2/staging/public_html/vendor/magento/framework/Std\
lib/Cookie/PhpCookieManager.php on line 148in /home2/staging/public_html/vendor/magento/framework/App/ErrorHandler.php:6\
1

Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'Cannot modify h...', '/home2/staging/...', 148, \
Array)
#1 /home2/staging/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(148): setcookie('X-Magento-Var\
y', '5c0fe9cddef92d0...', 0, '/', '', false, true)
#2 /home2/staging/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(101): Magento\Framework\Stdlib\
\Cookie\PhpCookieManager->setCookie('X-Magento-Vary', '5c0fe9cddef92d0...', Array)
#3 /home2/staging/public_html/vendor/magento/framework/App/Response/Http.php(95): Magento\Framework\Stdlib\Cookie\PhpCoo\
kieManager->setSensitiveCookie('X-Magento-Vary', '5c0fe9cddef92d0...', Object(Magento\Framework\Stdlib\Cookie\SensitiveC\
ookieMetadata))
#4 /home2/staging/public_html/vendor/magento/module-page-cache/Model/App/Response/HttpPlugin.php(25): Magento\Framework\\
App\Response\Http->sendVary()
#5 /home2/staging/public_html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\PageCache\Model\App\Re\
sponse\HttpPlugin->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor))
#6 /home2/staging/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Response\
\Http\Interceptor->Magento\Framework\Interception\{closure}()
#7 /home2/staging/public_html/generated/code/Magento/Framework/App/Response/Http/Interceptor.php(26): Magento\Framework\\
App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array)
#8 /home2/staging/public_html/vendor/magento/framework/App/Http.php(185): Magento\Framework\App\Response\Http\Intercepto\
r->sendResponse()
#9 /home2/staging/public_html/vendor/magento/framework/App/Http.php(156): Magento\Framework\App\Http->handleDeveloperMod\
e(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\LocalizedException))
#10 /home2/staging/public_html/vendor/magento/framework/App/Bootstrap.php(261): Magento\Framework\App\Http->catchExcepti\
on(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\LocalizedException))
#11 /home2/staging/…………………………………/index.php(143): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)\
)
#12 {main}


texts:
I am creating module which using ajax to load the order's product in to the grid , while user enter the order # in text box and press enter the Aajx fetches that particular product's order and loads it in to the grid.

Now the above process is working fine First time.But when i enter another order # in another text box the ajax calls again and reload the product data in second grid , but it overrides second grid data with first grid , and finally both grid data remains same , i have debugged everything from ajax call, to query etc..

i have changed the Grid.php file and edited the $this->setId('OrderProductsGrid'.$order_id); dynamic but no luck yet.

Please advice what i am missing here..


texts: Login to admin pending forever with Valet+

texts:
I'm using Valet+ on MacOS and have tweaked the Nginx and PHP configs to increase execution time etc.

Doing a fresh install, the frontend will load, slow at first, but fast after subsequent reloads, as expected.

The admin login screen is the same, loads slow, then fast afterwards.

Now, when I enter the correct credentials, the request to login is pending for 20+ minutes.

I have all caches enabled, except compiled_config and I have redis setup for sessions and caching.

There are is no data in the store either.

What is causing this never-ending load time for the admin?


texts: Stock management problems with downloadable products added programmatically (Magento 1.9.2.2)

texts:
Basically I'm trying to add downloadable products automatically. I started using some code snippets from Magento StackExchange, which worked partitially. But in the admin panel the quantity field is  just empty (it isn't even showing a 0) which is the apparent reason for the products not showing up in the search.

I've already tried really many code snippets to add a stock item to the products, but none of them really worked, for example:

$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($new);

$stockItem->setData(array(
                   'use_config_manage_stock' => 0
                   'manage_stock'=>1,
                   'min_sale_qty'=>1,
                   'max_sale_qty'=>2,
                   'is_in_stock' => 1,
                   'qty' => 999
               )
);
$stockItem->save()

which throws a PDOException.

$product->setStockData(array(
            'use_config_manage_stock' => 0,
            'qty' => 0,
            'min_qty' => 0,
            'use_config_min_qty' => 0,
            'min_sale_qty' => 0,
            'use_config_min_sale_qty' => 0,
            'max_sale_qty' => 0,
            'use_config_max_sale_qty' => 1,
            'is_qty_decimal' => 0,
            'backorders' => 0,
            'notify_stock_qty' => 0,
            'is_in_stock' => 1
    ));

which does nothing.

I've even tried to edit the SQL database manually, which made a 0 show up in the QTY field, but the products still didn't appear in the search.

However, if I edit and save the product in the admin panel, everything works which made me try to access the admin panel programmatically, which didn't work either.

Does anyone know if it's possible to disable the stock management entirely, so I don't have to care about this stuff?


texts: How to set discount value in .js file magento2

texts:
I have followed
https://webkul.com/blog/set-custom-discount-fee-cart-magento-2/
to get dynamic value. I tried below code.

define(
  [
      'jquery',
       'Magento_Checkout/js/view/summary/abstract-total',
       'Magento_Checkout/js/model/quote',
       'Magento_Catalog/js/price-utils',
       'Magento_Checkout/js/model/totals'
  ],
  function ($,Component, quote, priceUtils, totals) {
      "use strict";
      return Component.extend({
          defaults: {
              template: 'Mp_Accountmanager/checkout/summary/customdiscount'
          },
          total_tmp: quote.getTotals(),
          isTaxDisplayedInGrandTotal: window.checkoutConfig.includeTaxInGrandTotal || false,
          isDisplayedCustomdiscount : function(){
              return true;
          },
          getCustomDiscount : function(){
              return total_tmp.getSegment('coupondiscount_total').value;
          }
      });
  }
);

but i cannot set the value please help someone to solve this issue and can  anybody know how to get quote value in .js file


texts: Magento 2 Add to cart frontend event listener

texts:
I am trying to find good solution to execute custom javascript when product is successfully added to cart. Also this custom javascript need information about product that was added to cart (sku, qty, price, name, etc.)

Currently I come up with the following way to get information about products added to cart:

Rewrite $.mage.catalogAddToCart.prototype.enableAddToCartButton (for products added to cart from catalog or product view page)
Rewrite $.mage.dataPost.prototype.postData (for products added to cart from widgets)

To get necessary information I have to parse page (f.e. to get qty) and output additional infromation to page (f.e. to get sku having product id)

However my solution:

has two entry points
does not look nice
does not handle situation when validation is failed on backend
does not provide me all required information conveniently

Unfortunately I was not able to find any suitable extension point of checkout minicart to resolve my problem.

Any suggestions are much appreciated!


texts: Magento2: I need to get shipping address and Billing address after updated from admin with this event sales_order_address_save_after

texts:
I am stuck with this event sales_order_address_save_after.
When I update the address from Magento admin then not able to differentiate billing address and shipping address.
Anyone have an idea for the same?
Thanks!


texts:
I seem to have had a permissions error in var and specifically var/cache.

Both were previously set to 755, which has not caused issues before. This morning my CSV files stopped being generated by cron to the var/export_bkp directory, I resolved this by setting permissions to 777.

I'm now having the problem that my site has dropped the stylesheets. I tried changing permissions of media/js & media/css to 777, and I can see it is caching stylesheets in there correctly, however, they are not being displayed on the front end.

I have tried flushing cache via Magento admin but still, have nothing.
Any help would be appreciated,
Thank you.


texts: I'd like to change menu on My Account page

texts:
I'd like to hide several menu on MY Account page to my customers.
So I tried to change navigation.phtml file,
but I couldn't find the menu on MY Accout page.

The file was written like this

        <?php $_links = $this->getLinks(); ?>
        <?php $_index = 1; ?>
        <?php $_count = count($_links); ?>
        <?php foreach ($_links as $_link): ?>
            <?php $_last = ($_index++ >= $_count); ?>
            <?php if ($this->isActive($_link)): ?>
                <li class="current<?php echo ($_last ? ' last' : '') ?>"><?php echo $_link->getLabel() ?>

            <?php else: ?>
                <li<?php echo ($_last ? ' class="last"' : '') ?>><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?>

            <?php endif; ?>
        <?php endforeach; ?>

I think I have to change other file instead of navigation.phtml

Where the file having an effect on this menu?


texts: Magento 1.9.1.1 changes or release notes

texts: I am unable to find the list of changes in the release notes. Are there major changes to this release. Can anyone list the changes?


texts: Web Setup Wizard gives 401 after upgrade

texts:
I had a Magento 2.0.2 and upgraded into 2.0.4 version through Web Setup Wizard.
Everything worked fine,  and the frontend and backend work properly, but when I'm trying to access the Web Setup Wizard from the back-end, I get an error:

"Welcome to Magento Admin, your online store headquarters.
To use the Magento setup wizard sign into your Admin account and navigate to System => Tools => Web Setup Wizard"

Can someone please help me fix this.
Thanks

-Armindo


texts: Magento 2 : Creating widget using install script

texts:
I have a custom module for megamenu. I want to create some widgets predefined for the module when the customer installs this module. I have added the below script for creating the widget(widget type: cms block)

This is my InstallData.php

namespace Vendor\MegaMenu\Setup;
use Magento\Framework\Setup;

class InstallData implements Setup\InstallDataInterface
{
    /**
     * @var Setup\SampleData\Executor
     */
    protected $executor;
    /**
     * @var Installer
     */
    protected $installer;

    private $widgetFactory;

    public function __construct(
        Setup\SampleData\Executor $executor,
        Installer $installer,
        \Magento\Widget\Model\Widget\InstanceFactory $widgetFactory
        )
    {
        $this->executor = $executor;
        $this->installer = $installer;
        $this->widgetFactory = $widgetFactory;
    }

    public function install(Setup\ModuleDataSetupInterface $setup, Setup\ModuleContextInterface $moduleContext)
    {
        $this->executor->exec($this->installer);

        $megaMenuWidget = [
            'instance_type' => 'Magento\Cms\Block\Widget\Block',
            'theme_id' => 2,
            'title' => 'Test Megamenu Horizontal',
            'store_ids' => '0',
            'widget_parameters' => 'a:1:{s:8:"block_id";s:1:"11";}',
            'sort_order' => 1
        ];

        $this->widgetFactory->create()->setData($megaMenuWidget)->save();

    }

}

The widget is created. But not able to set layout update field and assign static block. Please refer the screenshot

http://i.prntscr.com/NEp1Nu_wToOwDCJYlQR_-g.png

How can I create a widget using upgrade script? My Magento version is 2.1.x

Please help me with a solution...


texts: How to update a field in a post array Magento 1.9

texts:
I have a custom field value that gets set at checkout form .
I want to update that custom field from the post array.

I`ve tried getting the current value and then setting it to a new value.

$thisarray = $array;
  $arraykeys = array_keys($thisarray);
   $obj =   $array[$arraykeys[4]];
        Mage::log($obj,true);
       $obj->setData('custom_field_four','Data Value Changed');

Please assist.


texts:
/**
 * 创建购物车
 * @param $source
 * @param $token
 * @param string $view
 * @return mixed
 * @throws Exception
 * @internal param $data
 */
public function createCart($source, $token, $view = 'default')
{
    $supplier = $this->_help->getSupplier($source);
    $api = $supplier['host'] . "index.php/rest/{$view}/V1/carts/mine";
    $this->_curl->setCredentials($supplier['username'],$supplier['password']);
    $this->_curl->addHeader('Content-Type','application/json');
    $this->_curl->addHeader('Authorization','Bearer '.$token);
//        $this->_curl->setHeaders(array(
//            'Content-Type'=>'application/json',
//            'Authorization'=>'Bearer '.$token
//        ));
        $this->_curl->post($api, json_encode(array(),true));
        var_dump($this->_curl->getHeaders());die;
        return $this->_curl->getBody();
    }

Response :


texts:
I created an EAV attribute on product entity, this attribute named user_id and has the ID of the user who's added the product.

After works, I crashed on this point, I need to join tables to get products added by a specific user.

So, I try with this code

->join(
      array(
           'product' => 'catalog_product_entity'),
           'product.user_id = 2',
            array()
      );

but always I get this error Unknown column 'user_id'

is there any solution?


texts: Magento how to filter Admin grid by store views

texts:
I have a grid with custom collection.Store view filter is not working in my grid. Here is my code

<?php

class Company_Banner_Block_Adminhtml_Homepage_Grid extends Mage_Adminhtml_Block_Widget_Grid {

    public function __construct() {
        parent::__construct();
        $this->setId("homepageGrid");
        $this->setDefaultSort("order");
        $this->setDefaultDir("DESC");
        $this->setSaveParametersInSession(true);
    }

    public function initForm()
    {
        return $this;
    }

    protected function _prepareCollection()
    {
        $collection = Mage::getModel("company_banner/homepage")
            ->getCollection();

        $collection->getSelect();

        foreach ($collection as $view) {
            if ( $view->getStores() && $view->getStores() != 0 ) {
                $view->setStores(explode(',',$view->getStores()));
            } else {
                $view->setStores(array('0'));
            }
        }
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    protected function _prepareColumns()
    {
        $this->addColumn("entity_id", array(
            "header" => Mage::helper("company_banner")->__("ID"),
            "align" => "right",
            "width" => "50px",
            "type" => "number",
            "index" => "entity_id",
        ))

        ->addColumn("title", array(
            "header" => Mage::helper("company_banner")->__("Title"),
            "align" => "left",
            "type" => "text",
            "index" => "title",
        ))
        ->addColumn("subtitle", array(
            "header" => Mage::helper("company_banner")->__("Subtitle"),
            "align" => "left",
            "type" => "text",
            "index" => "subtitle",
        ));

        $this->addColumn('store_id', array(
            'header'        => Mage::helper('company_banner')->__('Store View'),
            'index'         => 'stores',
            'type'          => 'store',
            'store_all'     => true,
            'store_view'    => true,
            'sortable'      => false,
            'filter_condition_callback' => array($this, '_filterStoreCondition'),

        ));

        return parent::_prepareColumns();
    }

   protected function _filterStoreCondition($collection, $column)
    {
        if (!$value = $column->getFilter()->getValue()) {
            return;
        }

         $this->getCollection()->addFieldToFilter('stores', array('finset' => $value));
    }

}

Filter is working,When I remove the following section from the _prepareCollection function. Now the All store Views value is blank.

foreach ($collection as $view) {
            if ( $view->getStores() && $view->getStores() != 0 ) {
                $view->setStores(explode(',',$view->getStores()));
            } else {
                $view->setStores(array('0'));
            }
        }

please check the screenshot http://prntscr.com/dpc49y


texts: Uninstalled module still populating in cron_schedule table

texts:
I've uninstalled an extension but it's cron jobs keep repopulating in the cron_schedule table. The steps I have taken are..

disable magento cron via crontab -e -u apache
Uninstalled the module using the ./mage command line tool
grep -r "bronto" . and removed any leftover files
Removed the module tables from the database.
truncate cron_schedule
Enable crontab

The task cannot execute because the module does not exist, however it still shows up in cron_schedule


texts: Display Custom Option Price In Order (E-mail, Backend & PDF)

texts:
I was wondering if anyone knew how to display the Custom Option price on an order. I was able to have it show up in the cart and the review section of the checkout. Is there any possible way to have it show up in the email, admin backend & pdf printouts?

Thank You


texts: How to create custom widget via Install?

texts: I need to create widget category link via Upgrade. How to do this?


texts: Magento currency symbol position - Euro for English language

texts:
I am using Magento v1.9.1.0. and I have a problem with currency symbol position when having locale set to English and currency to Euro. It displays:

€24.10

I would like to show it like where locale is set to Slovenian and currency to Euro:

24.10 €

If I change 'lib/Zend/Locale/Data/en.xml' currency format, then it won't display like it should for US dollars currency symbol($).

Does anyone know the solution for that kind of problem?


texts: Magento + Varnish + Turpentine and the cart doesn't work

texts:
Hello i'm using Magento 1.9.1 and i'm tring to migrate my e-commerce web site into a new web server.

The web server is using Varnish 4.0 and and i have install in my Magento Turpentine 0.7.1

The web site with Turpentine and Varnish active goes well except the cart.
Infact the cart shows products that have been added by different users in different pc.

Can you help me understand why this happens and what kind of modification i have to do to Varnish or Magento or Turpentine?

Thank you very much


texts: Fatal error: Call to a member function sayHello() on a non-object in C:\xampp\htdocs\magento\test.php

texts:
test.php

<?php

require_once 'app/Mage.php';

Mage::init();

$product=new TutsPlus_Demo_Model_Product;
$product->sayHello();

$product1 = Mage::getModel("demo/product");
 $product1->sayHello();

echo get_class($product1);

config.xml

<config>
    <global>
        <models>
            <demo>
                <class>TutsPlus_Demo_Model</class>
            </demo>
        </models>
    </global>
 </config>

product.php

<?php

class TutsPlus_Demo_Model_Product{

    public function sayHello(){

        echo "Hello Hi how are you";
    }
}


texts: Not able to place the order using paypal in magento 2 rest

texts:
I am developing an e-commerce mobile application using Magento 2 rest APIs only. This is the flow for making the REST API calls for order placement.

1.Create a cart

api -->{{url}}/index.php/rest/V1/carts/mine

This API will return a unique cart id

2.Add products to cart

api --> {{url}}/index.php/rest/V1/carts/mine/items

body ->

{
 "cart_item": {
     "quote_id": cartId,
     "sku": skuName,
     "qty": 1
     }
}

3. Estimate Shipping Methods

url --> {{url}}/index.php/rest/V1/carts/mine/estimate-shipping-methods

body ->

{
    "address": {
        "region": "Trivandrum",
        "region_id": 12,
        "region_code": "CA",
        "country_id": "IN",
        "street": [
            "Amstor house",
            "Eramam"
        ],
        "telephone": "5656565454",
        "postcode": "670390",
        "city": "Kazhakuttam",
        "firstname": "Peter",
        "lastname": "K",
        "same_as_billing": 0,
        "save_in_address_book": 0
    }

}

This will return all possible shipping methods based on shipping address. In my case the result is

[
  {
    "carrier_code": "freeshipping",
    "method_code": "freeshipping",
    "carrier_title": "Free Shipping",
    "method_title": "Free",
    "amount": 0,
    "base_amount": 0,
    "available": true,
    "error_message": "",
    "price_excl_tax": 0,
    "price_incl_tax": 0
  }
]

4)Save shipping information

url --> {{url}}/index.php/rest/V1/carts/mine/shipping-information

body data ->

{
    "addressInformation": {
        "shipping_address": {

            "region": "Trivandrum",
            "region_id": 12,
            "region_code": "CA",
            "country_id": "IN",
            "street": [
                "Amstor house",
                "Eramam"
            ],
            "telephone": "5656565454",
            "postcode": "670390",
            "city": "Kazhakuttam",
            "firstname": "Peter",
            "lastname": "K",

        },
        "billing_address": {
            "region": "Trivandrum",
            "region_id": 12,
            "region_code": "CA",
            "country_id": "IN",
            "street": [
                "Amstor house",
                "Eramam"
            ],
            "telephone": "5656565454",
            "postcode": "670390",
            "city": "Kazhakuttam",
            "firstname": "Peter",
            "lastname": "K",
        },
        "shipping_method_code": "freeshipping",
        "shipping_carrier_code": "freeshipping"

    }
}

This will return all possible payment methods. Here I am using paypal_express for payment.

5. Payment using PayPal plugin

Here i will pay the amount using  paypal cordova plugin.Also configured the IPN [{{url}}/paypal/ipn/]in paypal account

This API will return the following data,

{
   "client": {
       "environment": "sandbox",
       "paypal_sdk_version": "2.14.4",
       "platform": "Android",
       "product_name": "PayPal-Android-SDK"
   },
   "response": {
       "create_time": "2016-11-19T05:25:46Z",
       "id": "PAY-5VS11410F5341972MLAX6ETA",
       "intent": "sale",
       "state": "approved"
   },
   "response_type": "payment"
}

5.Save payment and place order

url --> {{url}}/index.php/rest/V1/carts/mine/payment-information

data ->

{
    "cartId": 3,
    "billingAddress": {
        "region": "Trivandrum",
        "region_id": 12,
        "region_code": "CA",
        "country_id": "IN",
        "street": [
            "Amstor house",
            "Eramam"
        ],
        "telephone": "5656565454",
        "postcode": "670390",
        "city": "Kazhakuttam",
        "firstname": "Peter",
        "lastname": "K"
    },
    "paymentMethod": {
        "method": "paypal_express"

    }
}

But this api will returning

{
  "message": "PayPal gateway has rejected the request. Invalid token (#10410: Invalid token)."
}

Is there any api missing in the above flow for capturing payments.P lease help me.


texts: how to avoid for muliple coupons applied on a same product at a time

texts:
I want to apply only one coupon at a time in a cart page either automatic apply else manually coupon code.
In that we apply only one and I also added stop furture using button yes.
But dynamic coupon apply and automatic coupon both are applied.
so how to do only one applicable coupon in cart page.


texts: products images are not show on frontend as well as backend in magento1.9.0.1

texts: I am using csv file for uploading products.but it is not show product images for both sides frontend and backend


texts: Magento version upgrade permission issue

texts:
I am trying to update magento version from 1.9.1.0 to 1.9.2.1 (latest version). However my website have some soft links. For example my website domain is pointing to /var/www/html/ folder. Inside this I have created some softlinks to other folders which are created under /var/www/magento/ folder.

When I am trying to update magento version from admin section magento connect manager, it is giving me permission error and conflicts with cummunity package installer.

Is it possible that mangento version can update with these softlinks using magento connect. Please help.


texts: ANSWERED: Show Amount to "Goal" for Free Shipping

texts:
I have an already running Magento CE 1.8.1 website running with two stores, and more to come. My client has asked me to find a way that can tell a customer how much more they need to spend before they qualify for "Free Shipping" (Subtotal of $49 or more - US only).

Tuga Sunwear - UPF 50+ Sun Protective Swimwear for Kids & Adults

I have looked around "magento connect" and did not see anything that can do this. Here are my ideas/requirements for this "micro-extension"

1) Somewhere on the page/site/block a banner is shown that says "Free Standard Shipping for US orders of $49 or more" on top, and below a 'counter' of sorts is displayed showing "You only need $XX.XX more to qualify!"

2) This needs to be shopper specific, so it would need to connect to the cookies or something being used to keep any "guest" or "logged in" users separate for others, even from the same IP address

3) The banner area can be clicked on to show details about the shipping information provided. The "$XX.XX to qualify" area can be clicked on to send them to the shopping cart review

I'm not asking for an extension to be built from here, but if someone can point me in a direction of what coding to use to pull a "subtotal" for the cart with *math to get an amount, and only show $0 when the amount is reached, instead of counting into negative amounts. I can figure out the rest or have a developer/freelancer tweak the rest.

Thanks for any help you guys and gals can provide!

Finally posting my solution that seems to work on any page, in any location:

<?php
$quote = Mage::getSingleton('checkout/session')->getQuote();
$freeShippingValue = Mage::getStoreConfig('carriers/freeshipping/free_shipping_subtotal');
if ($quote->getSubtotal() < $freeShippingValue):
$subtotalamt = Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();
$sumtotal = $freeShippingValue - $subtotalamt;
Mage::helper('checkout')->formatPrice($sumtotal);?>

Free US Ground Shipping with $<?php print (number_format($sumtotal, 2, '.', '')); ?>
more added to your cart.

<?php endif ?>

This will display: Free US Ground Shipping with $XX.00 more added to your cart.

Feel free to change the text as needed. Free shipping amount with automatically update as it is saved in the Config.


texts: creating multiple store on same domain magento

texts:
I am trying to run two Magento stores via same admin panel i have a magento installed at domain name/magento now as a first step i have go catalog->Manage Category and add two different root category for two different store and set Is Anchor to yesand Is Active to yes now i go to sytem->Manage Store and make other store name magento2 now i go to folder where my magento is installed and make the a folder name magento2 then copy the .htacess and index.phpfrom root folder to magento2 folder then edit the .htacces and index.php file then I have replace the following code

"$mageFilename = ‘app/Mage.php’;" with $mageFilename = ‘../app/Mage.php’; and in .htaccess file add the following line at the bottom SetEnvIf Host .*base.* MAGE_RUN_CODE="base"; SetEnvIf Host .*magento_site_2.* MAGE_RUN_TYPE="magento2";

now i go to system->configuration and the store view to magento2 then i go to genral->web and in base link url option under secure and unsecure tab add the following code

{{unsecure_base_url}}magento2/

when i open the url www.mydomain.com/magento/magento2/ then page is displaying only blank page and also www.mydomain.com/magento url not working properly.
Products and categories page are not working. That pages are giving error page not found.
What should I do now? Any help or suggestions please give.

how to create different store view on same domain magento?

thank you.


texts: UK Shipping Tax based on delivered goods

texts:
According to HMRC, "the VAT liability [of the shipping charge] is based on the liability of the goods being delivered"*

There does not seem to be a way in Magento of basing the shipping VAT on the tax class of the products in the cart. However, to get an accurate VAT total, that is how they should be calculated.

Is there an extension or workaround that anyone knows of for recent version of Magento CER (i.e. 1.7-1.9)?

From https://www.gov.uk/government/publications/vat-notice-70024-postage-and-delivery-charges/vat-notice-70024-postage-and-delivery-charges


texts: Hide phtml content programmatically in Magento 2

texts:
I need to Hide custom button from frontpage checkout page checkout/cart/  programmatically "customer group" based. Location of .phtml file is vendor/module/view/frontend/custom.phtml and location of button just above "Proceed to checkout" button. I need to add event to hide button (custom.phtml). I need to use admin/backend interface to enable/disable customer group to hide custom button.
E.g. Admin>stores>configuration>Extension_name>Hide Button . Here there is option to disable/enable button customer group based.


texts:
I am working on a Magento module that requires a quick fix.
I assume I can fix it by creating Magento 2 "patch" way.
I have never created a patch file before, can anyone help me to create a patch file for a custom module?


texts:
I want to add a if else condition statement in a layout xml file. I have to two uicomponent file.

if condition 1 then

  uicomponent file 1

else

  uicomponet file 2

Any help.


texts: How can I get a product's price as if it were in the cart?

texts:
Is it possible to get a product's final cart price? The products in the store I'm working on calculate pricing in a myriad of different ways, and rather than try to replicate the logic that decides which pricing method it uses, I thought it would be easier to just pretend the product was in the cart and use that price.

I know about $product->getFinalPrice(), but that's just one of the methods already being used on the site to display the price on the page. I'm hoping there exists a way to simulate a product already being in the cart, whether that's by creating a second, temporary cart to add it to, or some function I haven't yet found.

I already tried adding a product to the cart, getting the price, then removing it, but couldn't get $cart->removeItem($itemId) to work properly. Plus, that seems like a sloppy, unstable way to do that - I don't want to actually mess with the visitor's cart if I can help it.


texts: Add inline javascript to head - magento2

texts:
I am struggling to load a script tag on my Magento website. I am trying to add this to the head by adding the below code. I have tried to add this to the default.xml and default_head_blocks.xml

    <!-- Bugherd -->
    <reference name="head.additional">
        <block type="Magento\Framework\View\Element\Text" name="my_script">
            <action method="setText">
                <argument translate="true" name="text" xsi:type="string">
                    <![CDATA[
                        <script type='text/javascript'>
                        (function (d, t) {
                          var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
                          bh.type = 'text/javascript';
                          bh.src = 'https://www.bugherd.com/sidebarv2.js?apikey=dkjfsd89id6sftsdghkjn3';
                          s.parentNode.insertBefore(bh, s);
                          })(document, 'script');
                        </script>
                    ]]>
                 </argument>
            </action>
         </block>
    </reference>

Error:

  1 exception(s):
  Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'reference': This element is not expected. Expected is one of ( attribute, block, referenceBlock, referenceContainer, container, move, uiComponent ).
  Line: 637

Can anyone please advise how I can add my script to the head across all pages?

Thanks


texts: Missing Google Analytics conversions for PayPal Website Payments Standard orders

texts:
I'm pulling my hair out here, I've done a lot of searching and can't find an answer:

Using CE 1.7.0.2, whenever a customer pays using PayPal Website Payments Standard and exits PayPal before the redirect takes them back to the Onepage Success page the conversion / eCommerce referral data isn't showing in Google Analytics. The PayPal payment data makes it back to Magento OK, as the order status gets updated OK, it's just GA that is missing the data.

I realise using PayPal Payflow or another onsite gateway will get around this issue, but surely there must be a fix for PayPal Website Payments Standard?

Any ideas?


texts: Making a new import module, I need info where to find some documentation and tutorial about Magento ImportExport module

texts: I was researching about import/export in Magento and I decided to go and implement a module that will rely on Magento's native ImportExport module (app/code/code/Mage/ImportExport). Where can I find some fine detailed (or even not so detailed) information or documentation on this module and how it works? The more detailed - the better.


texts: Ramifications of "Price" attribute type?

texts:
I'm trying to understand the ramifications of setting an attribute type to "Price" when the attribute will not actually be a currency value.

The goal is to display length & width dimensional ranges (or a slider) in layered navigation. We've already purchased/installed Amasty Improved Layered Navigation. Currently my dimensional values are stored in an input type "text field" attribute with a validation of decimal number which unfortunately is not compatible.

The only option it appears is to change this attribute to input type "Price" but I want to make sure there are no unintended consequences.

It appears there may be some automatic UOM symbols created in the admin, but any additional insights or considerations would be very much appreciated.

Thanks in advance!


texts:
I'm using Magento 2.
Suddenly appeared below error in the Nginx error log.

Does anyone know how to fix that?

  2020/02/25 12:51:24 [error] 10295#0: *183747840 directory index of "/var/www/html/opcache/" is forbidden, client: 172.38.10.96, server: localhost, request: "GET / HTTP/1.1", host: "54.168.168.25"


texts: Magento 2 Confirmation widget confirm action

texts:
I'm trying to execute a function on confirm widget confirmation, but the confirm action is firing on load page always.

Here is the HTML:

        <?php /* @escapeNotVerified */ echo __('Accept'); ?>

And Here the JS:

How to execute the confirm action only when user click on Accept button from confirmation modal?

It's for frontend area.

Thank you!!


texts:
Is it possible to call a helper method to output a variable in a cms template?

Similar in fashion to the way helpers can be called in layout files such as:

<node helper="myhelper/myhelpermethod" />

Maybe there is some way to do like:

{{module method="params"}}

which is similar to

{{store direct_url="about-magento-demo-store"}}


texts: Always asking product attribute is required

texts: I have created dropdown attribute with values required 'No'. But in front end when I clicked 'add to cart' that dropdown shows error like 'this product is required'.


texts:
I've created an additional, static navigation that features a few links to important pages on our Magento website. It's a little nasty, but here's how it's coded:

<?php
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
$url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
$path = $url->getPath();
?>

<a class="button <?php if (strpos($path,'item1') !== false) { echo 'active'; } ?>" href="<?php echo Mage::getBaseUrl(); ?>item1">Item 1

<a class="button <?php if (strpos($path,'item2') !== false) { echo 'active'; } ?>" href="<?php echo Mage::getBaseUrl(); ?>item2">Item 2

<a class="button <?php if (strpos($path,'item3') !== false) { echo 'active'; } ?>" href="<?php echo Mage::getBaseUrl(); ?>item3">Item 3

Every so often I notice that when I'm on one of these pages there's another page also marked with the class active. As soon as I flush the Magento cache it goes away and functions as it should. Is it possible that Magento is caching the static block of another users active page, somehow?


texts:
I am not a developer in anyway, a novice at magento and coding so any help would be greatly appreciated on my issue.

I have a magento dev site: http://dev.colourcalendars.com/
On this site we have a megamenu that uses css and works at the root level fine.

However I cannot seem to get the css files loaded at product level when using a custom product layout file. I have tried adding code to xml files but nothing seems to work. I have a megamenu extension that needs the css when viewing these new product pages.

for instance if you view this page:
http://dev.colourcalendars.com/a2-ringbound-booklet-calendars/a2-ringbound-booklet-calendar.html
you will see the mega menu is all broken because the css is not loading up.

Can anyone help me with the best way of getting css files to load with these pages?


texts: Any good reason for a module to be accessing global/crypt/key remotely?

texts:
Forgive my ignorance, but crypt key is used for decrypting Magento data, right? Is there any good reason for a module to access this? I stumbled across this code after installing Advanced Content Manager...

<?php
    $stores = Mage::app()->getStores();
    $key = (string)Mage::getConfig()->getNode('global/crypt/key');
    $date = (string)Mage::getConfig()->getNode('global/install/date');
    $serverIp = $_SERVER['SERVER_ADDR'];

    $params = 'key='.$key.'&date='.$date.'&';

    foreach($stores as $store)
    {
        $params .= 'store_'.$store->getCode().'='.urlencode(Mage::app()->getStore($store->getId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)).'&';
    }
?>
<img src="http://www.advancedcontentmanager.com/images/distant/banana-tracker.gif?<?php echo $params; ?>time=<?php echo time(); ?>&serverip=<?php echo $serverIp; ?>" />


texts: How to sorting collection in magento by newest first and out of stock last in same collection

texts:
i need to sorting collection in two way in one collection.
first i need to sort new product on top.
out of stock product in last.

basically i need this solution by observer.
I used this ...

my config...

<?xml version="1.0"?>
<config>
    <modules>
        <Nine_Catalog>
            <version>1.0.0</version>
        </Nine_Catalog>
    </modules>
    <global>
        <events>
            <catalog_block_product_list_collection>
                <observers>
                    <filter_blank_image> // unique idrntifer
                     <type>model</type>
                        <class>Nine_Catalog_Model_Observer</class>
                        <method>filterBlankImage</method>
                    </filter_blank_image>
                </observers>
            </catalog_block_product_list_collection>
        </events>
    </global>
</config>

my observer

class Nine_Catalog_Model_Observer extends Varien_Event_Observer{

public function filterBlankImage(Varien_Event_Observer $observer)
{
    $collection = $observer->getEvent()->getCollection();

   $collection->getSelect()->joinLeft(
                array('_inventory_table' => $collection->getTable('cataloginventory/stock_item')),
                "_inventory_table.product_id = e.entity_id",
                array('is_in_stock')
            )
            ->order('is_in_stock DESC')
            ->order('created_at DESC');
}

}

}


texts:
I am sure if I am allowed to ask advices here.
I need to integrate Amazon with Magento. I need a module which can handle configurable products. This Amazon extension seems to support only configurable from some categories and doesn't match with my category. Also I want to get billing and shipping addresses as well.
Did you integrate Amazon with a module without limitations like these?


texts: Where do I deploy after changing docroot?

texts:
Once I change my docroot to /pub, do I then do my git deploy to /pub, or still deploy to public_html?
Also, do I point my db static file path to /pub, or just leave it?


texts:
I'm trying to upgrade Magento (from ver. 1.9.1.0) through the CLI using PuTTY.
I'm following this guide:

Magento isn't upgradable through Magento Connect Manager

But it always give me same error whatever I write.
"No such file or directory"

What is the problem?

Thank you very much in advance for any suggestion.


texts: Index Management - Catalog Category Flat Data - Stuck on processing

texts:
The Catalog Category Flat Data has been now stuck for weeks and i can't seem to fix it.

I tried to change the corresponding table in the database:

TRUNCAT catalog_product_flat_1, catalog_product_flat_2, etc...

I tried to run the indexer manually:

<?php
require_once('app/Mage.php');
$app = Mage::app('admin');
$indexer = 5;
{
     $reindexProcess = Mage::getModel('index/process')->load($indexer);
     $reindexProcess->reindexAll();
}
echo "Done!";
?>

I tried to run the indexer with shell:

<?php
set_time_limit(0);
error_reporting(0);
require_once('app/Mage.php');
umask(0);
$indexer="/shell/indexer.php";
if(file_exists($indexer))
{
        $idxlist=array("catalog_product_flat");
        foreach($idxlist as $idx)
        {
            echo "reindex $idx n ";
            exec("php shell/indexer.php --reindex $idx");
        }
}
echo "Done!";
?>

I tried deleting the lock files in /var/locks/ but they are being created automatically every hour or so:

index_process_1.lock
index_process_2.lock
index_process_3.lock
index_process_4.lock
index_process_10.lock
index_process_11.lock
index_process_5.lock
index_process_6.lock
index_process_7.lock
index_process_8.lock
index_process_9.lock

I also tried rebooting the server and apache.

I even checked if the table engine is InnoDB or not by using:

SHOW TABLE STATUS

But really nothing seems to help. I can't even change the status of the category flat data in the magento backend -> configuration, because it is grayed out.

Do you guys know of any suggestions/solutions to this issue?


texts: Magento2.2.4 - Web Setup Wizard not working after upgade to Magento2.2.4

texts:
I upgrade Magento2.2.1 to Magento2.2.4.

I want to access System => Tools => Web Setup Wizard from admin panel.

When I click on Web Setup Wizard, then it displays the blank page.

And I also check setup/index.php is not called when this action is performed.


texts: How to reload a component on checkout page when shipping address is modified

texts:
I am using Amasty Deliverydate module, this module allows customer to select delivery date and time on checkout step.
I am trying to customize this module and we have developed a feature where admin can set rules like customer group, shipping state/provision etc and based on that we disable dates in Delivery Date (date-picker).
We have added delivery date picker component using Layout Pre Processor class plugin:-
            $elements['deliverydate_date'] = [
                'component' => 'WebbyTroops_Deliverydate/js/checkout/date',
                'label' => __('Delivery Date'),
                'sortOrder' => 200,
                'disabled' => false,
                'validation' => [
                    'validate-date' => true
                ],
                'additionalClasses' => 'date',
                'dataScope' => 'shippingAddress.amdeliverydate_date',
                'provider' => 'checkoutProvider',
                'notice' => $this->deliveryHelper->getStoreScopeValue('date_field/note'),
                'visible' => !$this->deliveryHelper->getStoreScopeValue('date_field/enabled_carriers'),
                'config' => [
                    'template' => 'ui/form/field',
                    'id' => 'delivery-date',
                    'options' => [
                        'showOn' => 'both',
                        'amdeliveryconf' => $this->configProvider->getDeliveryDateFieldConfig()
                    ],
                    'readonly' => 1,
                    'pickerDefaultDateFormat' => $this->configProvider->getPickerDateFormat(),
                    'pickerDateTimeFormat' => $this->configProvider->getPickerDateFormat(),
                    'outputDateFormat' => DeliverydateConfigProvider::OUTPUT_DATE_FORMAT,
                    'inputDateFormat' => $this->configProvider->getInputDateFormat(),
                    'default' => $this->configProvider->getDefaultDeliveryDate(),
                    'currentDate' => $this->deliveryDate->getCurrentStoreDate()
                ]
            ];

        if (!empty($elements)) {
            if (isset(
                $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
                ['shippingAddress']['children']['shippingAdditional']['children']['amasty-delivery-date']['children']
            )
            ) {
                foreach ($elements as $key => $element) {
                    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
                    ['shippingAddress']['children']['shippingAdditional']['children']['amasty-delivery-date']['children'][$key] =
                        $element;
                }
            }
        }

On Checkout it looks like this:-

When I update State/ Country I want to update datepiker disabled dates, so I want to reload this component.
Please suggest best possible solution.
Thanks in advance.


texts: How to create a custom admin form with multiselect type in magento 2?

texts:
I created a custom module with a multiselect type input.

My InstallSchema.php file contains this for this field.

->addColumn(
    'elegible_products',
    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    500,
    ['nullable => false'],
    'Products'
)

My Main.php file looks like

$fieldset->addField(
    'elegible_products',
    'multiselect',
    [
        'label' => __('Products'),
        'title' => __('Products'),
        'name' => 'elegible_products',
        'values' => \Ayakil\FreeGift\Block\Adminhtml\Freegifts\Grid::getValueArray4(),
        'disabled' => $isElementDisabled
    ]
);

This is my Grid.php file

static public function getOptionArray4()
{
    $data_array = array();
    $data_array[0] = 'a1';
    $data_array[1] = 'a2';

    return($data_array);
}

static public function getValueArray4()
{
    $data_array = array();
    foreach(\Ayakil\FreeGift\Block\Adminhtml\Freegifts\Grid::getOptionArray4() as $k => $v) {
        $data_array[] = array('value' => $k, 'label' => $v);
    }

    return($data_array);
}

If i tried to save the form i am getting an error like below.

  {"0":"Notice: Array to string conversion in /home/muja/www/ayakil-greens/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3105","1"

How can add Multiselect in custom admin form and save the data and retrieve the data here?


texts:
i try to calculate each installment price on product page through php and html.
 I have add this code but php cannot take the value ($doseis) to calculate it:

<?php
$_product = $this->getProduct();
$price = $_product->getFinalPrice();
?>
<?php if ($price >=150) { echo $this->getLayout()->createBlock('cms/block')->setBlockId('doseisproduct')->toHtml(); }?>
<?php echo "calculate installment" ?>

<select method="post" action="" name="doseis" size="1" >
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>

<?php
$doseis = $_POST[doseis];
$_SESSION['doseis'] = $doseis;
echo $doseis;
$installment = (($price) / ($doseis)) ;
?>
<?php echo $installment; ?></div>

Any idea?


texts: Custom sales order report NOT matching Magento's sales order report

texts:
I'm building a custom report sales order using the following code as a start. I'm trying to get all orders that have been updated Yesterday, by passing filters from date and to date to sales/order collection.

$date = Mage::getSingleton('core/date');
$formatDate = 'Y-m-d H:i:s';
$from_date = $date->gmtDate($formatDate, 'Yesterday 12:00:00AM');
$to_date = $date->gmtDate($formatDate, 'Yesterday 11:59:59PM');

$updated_order_collection = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('updated_at', array(
    'from' => $from_date,
    'to' => $to_date,
    'date' => true,
))->load();

$updated_count = count($updated_order_collection); // Total order is not matching Magento's sales order report as showon in the screenshot.

I was not able to get the same result as Magento's sales order report. The custom code total orders are less than Magento's total orders. See picture below for more details.

So I'm wondering what I'm missing to get an incorrect total results.


texts: Magento 2 Enterprise - Can we use the page builder to create header/footer?

texts:
We upgraded our shop to Magento 2 Enterprise. It comes with a page builder.

Can we use the page builder to create our whole site, including header, footer, category site, customer backend, login etc? Or does it only work with CMS sites / CMS blocks?


texts:
Thats how I understand the problem:

Magento cant show a default shipping value in cart to guests or not-logged-in users because it doesnt know the country from a standard shipping address, right?

I only have one country to ship to (even only one global price) so it would be great if I could set that for everyone to see the shipping costs in cart even if guest or not-logged-in.

Is this right and can it be done? :)

Thx

EDIT: I mean the real costs in totals section -> NOT estimate


texts: How we can display associated product with radio buttons instead of Dropdown at Product View Page?

texts: I want to show associated product as like following manner. So user can select anyone product for cart. Which product type will be useful to show such products? Configurable or Bundle ?


texts:
I'm trying make my magento webshop work through HTTPS. I already have an SSL certificate.

This is what I've done:

In the backend (System > Configuration > Web > Secure Tab) I've changed the Base URL to https://mydomain.be .

My base Link URL: {{secure_base_url}}
Base Skin Url: {{secure_base_url}}skin/
Base Media URL: {{secure_base_url}}
Base Javascript URL: {{secure_base_url}}js/

I've changed the setting Use Secure URLs in Frontend to Yes. The problem is when I surf to https://mydomain.be I get the following errors (my css/js/images files aren't loaded):

example js: Mixed Content: The page at 'https://mydomain.be/nl/home' was loaded over HTTPS, but requested an insecure script 'http://mydomain.be/js/mage/translate.js'. This request has been blocked; the content must be served over HTTPS.

example image: Mixed Content: The page at 'https://mydomain.be/nl/home' was loaded over HTTPS, but requested an insecure image 'http://mydomain.be/media/catalog/product/cache/13/image/9df78eab33525d08d6e5fb8d27136e95/k/l/klorane-douchegels-2_1-gratis_13.jpg'. This content should also be served over HTTPS.

example css: Mixed Content: The page at 'https://mydomain.be/nl/home' was loaded over HTTPS, but requested an insecure stylesheet 'http://mydomain.be/skin/frontend/base/default/css/print.css'. This request has been blocked; the content must be served over HTTPS.

I also have a problem that when I set the option Use Secure URLs in Admin to Yes I get the following error when I try to access the backend:

ERR_TOO_MANY_REDIRECTS

What else do I need to do to make this work?


texts: Magento minimum qty allowed for particular product

texts: How to set up the minimum qty for particular product ?


texts: Magento 1.9 - After indexing, update at time doesn't change on Magento

texts:
As website is bigger, I can see some issues on index process.
After indexing, update at time of product prices doesn't change on Magento

Comparing to time of indexing, index of product prices takes 2 mins

Is it a megento bug? Thank you.


texts: Is there a way to place the front end of Magento into maintenance mode so that customers cannot access anything BUT the admins are still able to access the back end and place orders against products?


texts: "Require Customer To Be Logged In To Checkout" not available in Magento 2.2

texts:
Our Magento 1.8 store had the option "Require Customer To Be Logged In To Checkout" in the admin, so anyone could go to the checkout and login or checkout, and guests would have an account created after checkout.

Any reason why this doesn't happen in Magento 2.2?


texts: Magento homepage redirects to 404 page not found

texts:
After reindexing, when entering the homepage url, I'm redirected to 404 page not found.
I have checked configuration/general/web and everything seems to be working there.


texts: Magento : Displaying Pop Up Onclick Add to Cart

texts:
when we upload image in product view page and click on "Add to cart", its Adding product to cart successfully, but when we click on "add to cart" directly without uploading an image , it displaying pop up box & displaying message "Add text or image".

I want to Hide the pop up box when we click on "Add to cart" directly.

I need similar to this link : link2

addtocart.phtml

<button onclick="productAddToCartForm.submit(this)" id="submit-editorApply-add-to-cart" >
Add to cart
</button>

script :

<script>

initObservers: function()
{
if (this.config.editorEnabled && this.config.isUserLoggedIn == 'true') {
$('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this));
}
},

submitApply: function(event)
{
Event.stop(event);
this.option.apply();
if(window.productAddToCartForm == 'undefined') {
var productAddToCartForm = new VarienForm('product_addtocart_form');
} else {
var productAddToCartForm = window.productAddToCartForm;
}
productAddToCartForm.submit();

},
</script>


texts: How does Magento sort categories within the product edit admin section?

texts:
Working with Magento EE v2.1.7.

From the admin product edit page (URL/route: admin/catalog/product/edit/), I have an option to assign products to categories.

I'm curious about the ordering of these suggested categories as the ordering does not currently reflect what I can see from the category management section of the admin (URL/route: admin/catalog/category/edit/).

Does anyone happen to know the sort order for the product edit portion of the admin? It mostly lines up which is interesting but it doesn't 100% reflect. Tried reindexing just to see if something was amiss.


texts: How to get product image dimensions in the listing page per product?

texts:
I have spent more than 3 hours to search how to get the exact dimension of product image(original) size in the listing page of each product, but everyone has answered that only resize width and height. But I need the image dimension to show under the title. How can i get that?

Thanks.


texts: "Please specify a shipping method" when programmatically creating an order

texts:
I'm creating an order programmatically with code I wrote a while ago which functions correctly, when using the free shipping method (i.e freeshipping_freeshipping)

However, I'm now trying to place the order using a shipping method (which is from a module by WebShopApps).

$shipping_address->setCollectShippingRates(true)->collectShippingRates()
        ->setShippingMethod($delivery)
        ->setPaymentMethod($payment);

Where $delivery is the shipping method code. When I place the order, I get given an error

a:5:{i:0;s:33:"Please specify a shipping method.";i:1;s:1554:"#0 /chroot/home/site/site/html/app/code/core/Mage/Sales/Model/Service/Quote.php(303): Mage::throwException('Please specify ...')

When navigating to this file (Quote.php) on line 303:

protected function _validate()
{
    if (!$this->getQuote()->isVirtual()) {
        $address = $this->getQuote()->getShippingAddress();
        $addressValidation = $address->validate();
        if ($addressValidation !== true) {
            Mage::throwException(
                Mage::helper('sales')->__('Please check shipping address information. %s', implode(' ', $addressValidation))
            );
        }
        $method= $address->getShippingMethod();
        $rate  = $address->getShippingRateByCode($method);
        if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) {
            Mage::throwException(Mage::helper('sales')->__('Please specify a shipping method.')); //this is line 303
        }
    }
    ....

To try and solve this, I went the route of creating an order via Adminhtml, and modifying Quote.php for testing purposes, to:

echo ($method . " and " . $rate);die();

I'm then given a blank page with the method Magento is expecting as well as the rate (which is blank), yet the order still gets created fine.
The method Magento prints out is also the exact same value that my $delivery variable had set.

What am I doing wrong?


texts: Configurable product with group product functions

texts:
I'm looking for a way to do the following.

From a single product, the user would select from the dropdown a height (for example 100 and 200)

Once the dropdown is selected a table fills in with different products as per group product does allowing users to select different qtys from these listed products


texts: Currency switch not showing in modules homepage

texts:
When i activate the EUR to PND switch for currency it wont show on the modules of the theme. I think it doesn't have the conversion rate checker or pricing PHP lines to do that. What do I need to add for this in for example this file:

<?php
   $sym = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
   $price = $_product->getPrice();
   $specialprice = $_product->getFinalPrice(); // $specialprice = $_product->getSpecialPrice();
   if($price != $specialprice){
      if($price != ''){
     echo '
';
     echo $this->__('Regular Price'). ': ';
     echo 'getId().'" class="price">'.$sym.''.number_format($price,2).'
';
    }
    if($specialprice != '')
    {
     echo '

      Special Price
      getId().'" class="price">'.$sym.''.number_format($specialprice,2).'

 ';
    }
   }else {
    echo '

     getId().'" class="regular-price">
      '.$sym.''.number_format($price,2).'

';
   }
   ?>


texts: Hide shipping & handling value in the multishipping overview

texts: When i do multishipping checkout, there will be showed Shipping & Handling value in each of footer total of each adrresses like in the picture below. Is there a way to hide it? Since in my case, the shipping is always free.


texts:
I am getting following error.

  Uncaught TypeError: Cannot read property 'top' of undefined at step-navigator.js:158

I have created a custom step using Magento 2 documentation

  http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_step.html

I have added a new step for shipping and payment. When I am going to my custom step and click back on shipping. I get this error and both the step get displayed and selected.

        isVisible: ko.observable(false),
        errorValidationMessage: ko.observable(false),
        stepCode: 'shipping-method',
        stepTitle: 'Shipping Method',

        initialize: function () {
            this._super();

            stepNavigator.registerStep(
                this.stepCode,

                null,
                this.stepTitle,

                this.isVisible,

                _.bind(this.navigate, this),

                15
            );

            return this;
        },

        navigate: function () {

        },

        navigateToNextStep: function () {
            stepNavigator.next();
        },

Template

    <each args="getRegion('before-shipping-method-form')" render="" />

        <form id="co-shipping-method-form"
              class="form methods-shipping"
              if="rates().length"
              submit="setShippingInformation"
              novalidate="novalidate">

            <render args="shippingMethodListTemplate"/>

                <each args="getRegion('shippingAdditional')" render="" />

                    <button data-role="opc-continue" type="submit" class="button action continue primary">

                    </button>

        </form>

 0"
             translate="'Sorry, no quotes are available for this order at this time'" />

`


texts: Get Value Of Custom Layout Update Attribute

texts:
Hello guys I am new in Magento I want to get value of "Custom Layout Update" attribute. How can I achieve this in magento 1?
I tried like this but I get error

foreach ($products->getItems() as $item) {
  $att_value = Mage::getResourceSingleton('catalog/product')
  ->load($item->getId)
  ->getAttribute('layoutUpdate_validator')->getSource()
  ->getOptionText($item->getData('layoutUpdate_validator'));
}`


texts: Magento 2: Where does the oAuth verifier token come from

texts:
Per the developer documentation, when making a request for an access token, you need to include a verifier token

  oauth_verifier. The verification code that is tied to the consumer and request token.

However, there's nothing in the documentation that mentions where this verifier token comes from.  I would presume it comes from the request for an access token, but the documentation doesn't reflect this.

Hoping somewhere here knows the answer ans saves me the headache of tracing out the oAuth process


texts: How to add "Apple touch icon" in a magento store version 1.9.4.0?

texts:
I want to add an apple-touch icon in my Magento store which has version 1.9.4.0
I have googled but there was no usable and correct tutorial or guidance! does anyone have the same experience or something to share to help me?
Thanks in advance


texts: Upgraded to php 7 magento 1.9. No orders, customers or products are showing in admin

texts:
I've upgraded my php to 7 since my pci compliance scan said I needed to. So now my site is not working properly at all. I've tried a few edits from others and nothing is helping.

The product, orders and customers tables are not showing. The heading is there but  nothing under them.

Edited to add: The tables are not showing on the front end either. Header, template and category selection is working fine. No products show just an empty page between the header and footer.

Thank you in advance for your help.


texts: Magento 2: how to send POST request to REST API

texts:
I am struggling with POST REST API's in Magento 2 as I am quite new to it.
If possible, can anyone provide me one example for POST like creation of product or add to cart using oAuth and admin account, please help me.

Thanks in Advance


texts: Plugin not triggering while placing order

texts:
I am creating a plugin for Quotemanagement (placeOrder) with after method, but some reason it’s not triggering. I try with die but no luck

Please help, I am using Magento 2.2.6

Here is my code

namespace Vendor\Module\Plugin;
class QuoteManagement {
protected $logger;
protected $quoteFactory;
protected $orderFactory;

public function __construct(\Magento\Sales\Model\OrderFactory $orderFactory,
                            \Psr\Log\LoggerInterface $logger,
                            \Magento\Quote\Model\QuoteFactory $quoteFactory) {
    $this->logger = $logger;
    $this->quoteFactory =   $quoteFactory;
    $this->orderFactory =   $orderFactory;

}
/**
 * Before order success action
 */
public function afterPlaceOrder($quoteManagement, $result){
    $order  =   $this->orderFactory->create()->load($result);
    $quote  =   $this->quoteFactory->create()->load($order->getQuoteId());
    $addvalue =   $quote->getAdcodeValue();
    $order->setAdcodeValue($quote->getAdcodeValue());
    $order->save();

    return $result;
}

}

also here is my di.xml file

 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\App\Action\Action">
    <plugin name="Module_Name::urlstringcheck" type="Vendor\modulename\Plugin\ActionUrlValueCheck" />
</type>
<type name="Magento\Quote\Model\QuoteManagement">
    <plugin name="Module_Name::checktheorder" type="Vendor\modulename\Plugin\QuoteManagement" />
</type>


texts: How to set an image which is already on the server as product image

texts:
Is there a way to select images from the servers media storage (exactly like when editing the content of a CMS page and hitting "insert image...") as product image?

Unfortunately we only found the flash uploader in the image tab when editing a product but no possibility to access the server images. And we need to associate a lot of images (all together nearly 10 GB) with a lot of products and cannot do it automatically as the file names are pretty much random, so it would be a real waste of time to download all images just to re-upload them again (especially as it looks like Magento already has the feature but only for CMS pages...).

Thanks for any tips on how this could be done.


texts: Magento 1.9 : Product details Page error Mage_Page_Block_Html_Head::addCss()

texts:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Mage_Page_Block_Html_Head::addCss(), 0 passed in /home/app/code/core/Mage/Core/Model/Layout.php on line 348 and at least 1 expected in /home/app/code/core/Mage/Page/Block/Html/Head.php:53 Stack trace: #0 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(348): Mage_Page_Block_Html_Head->addCss() #1 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(214): Mage_Core_Model_Layout->_generateAction(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element)) #2 /home/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#3 /home//public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks() #4 /home//public_html/app/code/core/Mage/Catalog/Helper/Produc in /home/public_html/app/code/core/Mage/Page/Block/Html/Head.php on line 53


texts: Trigger JS codes when remove product from cart

texts:
I want to add a tracking code when the user remove the product from the cart. I searched on a few questions here but to no avail. Of course I can use jQuery to monitor the Remove button on mini-cart and sidebar, but I don't think it is the best practice. Here is my codes so far:

define([
    'jquery'
], function($){
    "use strict";
    $("form.form-cart a.action-delete, .minicart-items-wrapper a.delete").click(function(){
        //My tracking codes
    });
});


texts: Why isn't my attribute text showing on the front end?

texts:
Well I have this code here and I am adding it to my list.phtmlfile to try and get the attribute text for each product to display:

<?php echo $_product->getAttributeText('mileage') ?>

This code works with any attribute that has a Catalog Input Type for Store Owner value of dropdown however it does not display for attributes with the value of Text Field.

Any idea why this might be happening?

I have the setting Used in Product Listing enabled for both attributes.

Thanks


texts: I want to integrate my ERP with my magento 2.3. I would like to know the best practice to be follow. What are the requirements from ERP and magento to communicate with each other. If any one have done this kind of integration please help me out. Is there any document or anything that can give complete explanation. Is there any extension? This is something which i have come acrossed for the first time. Any help will be highly appreciated.