texts: How to add filter product search result by product attribute in magento 2

texts: i want add a filter in search result page, filter by attribute. How to make it? Thanks all


texts: "There has been an error processing your request" - Errors displayed on frontend even though display_errors = 0

texts:
Magento is displaying the MySQL query and a stack trace on catalog pages.

I can't figure out where it's coming from. DB queries should not be displaying on the frontend, for security reasons.

Do you have any idea how I can turn this off?


texts: How to change stock status Instock permanently in magento2.3?

texts:
Please shown below image.

If quantity is 0 aur greater than 0 select Instock only. No need to select out of stock if quantity below 0.

Can i change this functionality through admin panel or need to do some code.

How to do that ?


texts: Magento 2 checkout Shipping Prices missing

texts:
I am trying to get the shipping price to display on my checkout.  It's accessed via knockout.js in the template Magento_Checkout/web/template/shipping.html (this is the standard shipped with Magento)

  <td class="col col-price">
      <!-- ko foreach: $parent.getRegion('price') -->
      <!-- ko template: getTemplate() --><!-- /ko -->
      <!-- /ko -->
  </td>

I have two shipping methods set up - free and flat rate.  The method and carrier titles show but the price is missing.  See screen shot...

I haven't made any changes to the checkout_index_index.xml file.  For the flat rate shipping I have a price of 3.99.

Are there any suggestions how I can begin to investigate why this isn't working.  I'm completely new to knockoutjs and relatively new to Magento.  Thank you.


texts: Customer can not login in frontend with secure url....after ssl configuration

texts:
I configured SSl in magento. login url and checkout url....
But its login is not working....
My setting are

In system web option
Auto-redirect to Base URL----> NO
Use Secure URLs in Frontend-----> yes
Use Secure URLs in Admin  ----->  NO
Use SID on Frontend------------> YES
Cookie Domain---------------> site base url(http://example.com)
Use HTTP Only------------->yes

Now Problem is this When I login by frontend its not redirecting....also not login ...


texts: Remove column from Order grid based on condition

texts:
I want to remove status column from Magento admin panel order grid.
I use below code to remove the status column in my sales_order_grid.xml file. Reference
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="status">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="componentDisabled" xsi:type="boolean">true</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

It removes status column successfully but I want to remove it based on a condition, value of a configuration field from Stores > Configuration section.
Is there any way I can add a condition on componentDisabled, or any other way to achieve my requirements?


texts:
I want to know what is app emulation in magento...
I saw its forcefully set store id ....in store...but why this is use in magento..
I use this in my project..but i want to know Detail about App Emulation..

$appEmulation = Mage::getSingleton('core/app_emulation');

    $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation(0);
    $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);


texts: Image color shift after uploading to Magento admin

texts:
When I upload any product image, that images change his saturation and color
This is the original image:

This is the image post uploaded:

I'd searched on Google about this error, and the most response said to change of lib GD2 to ImageMagick, and run the command bin/magento catalog:images:resize and clear the cache. I execute all solutions found but nothing resolves the problem, then I create this question to resolve.
Can anyone help me?


texts: How to display Attribute Group Name on compare page?

texts:
I used this guide and was able to display the attribute group name on the product page, but I'm wondering how to do the same on the compare page ? I'm using magento ce 1.9.2.1 with custom Porto theme if that is important.
Thank you


texts: WorldPay Payment Integration using PHP and direct XML method curl API return blank page in Magento 2

texts:
I m  trying to implement worldpay on a PHP site using XML direct method but whenever I try to connect I get blank pag.. Can you tell me were you testing the payment gateway on live site.
Code:

    $url = 'https://secure.worldpay.com/sso/public/auth/login.html?serviceIdentifier=merchantadmin';
  $ch = curl_init();
  curl_setopt( $ch, CURLOPT_URL, $url );
  curl_setopt($ch, CURLOPT_USERPWD, "username
:password");
  curl_setopt( $ch, CURLOPT_POST, true );
  curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
  curl_setopt( $ch, CURLOPT_POSTFIELDS, $xml );
  $result = curl_exec($ch);
  // curl_close($ch);
  // echo json_encode($result);
  // exit;
return $this->_pageFactory->create();

How to solve it?
Anyone can help me to solve this
i was used this payment-gateway .


texts: How can I disable other downloadable products checkboxes?

texts:
I have a music album as a downloadable product type, which lists all songs and the whole album as zipped. So the customer can buy individual songs or just select the whole album. I want to disable individual songs if the customer selects the full album, Like in this music store when you click on "Entire Release" JunoDownload

Please see my screenshot for what I have at the moment. Screenshot


texts:
I have created one module in magento 1.9. There is a requirement to save data from outside the root folder. Can any one help me in solving this. I have connected this using the following code.

include 'app/Mage.php';
umask(0);
Mage::app();

Thanks for the support.


texts: Remove space between currency and price Magento1.9

texts:
When I switch the stores from English to Dutch or any other I got spaces between currency and prices. It's on the whole site so I think some theme related issue.I recently updated Magento from 1.9 to 1.9.3. I tried by getting prices on the product page with custom code but no luck. I am sharing the screenshot of the issue.

This space coming on RWD and Default themes too.


texts: Magento 2.3.4 upgarde returns some security updates and features notification

texts:
I'm working on Magento2.3.3. So I have planned to upgrade the Magento version from 2.3.3 to 2.3.4.

After the successful upgrade, the magento version was changed to 2.3.4.

But I got some notification related to security updates and features. Please refer to the below image.

Refer to the below image which shows in the admin notification message.

While referring to some suggestions, they reported about the applied.patches.list ( reference link )

I'm not seeing any applied.patches.list in my app/etc/ folder.

How can able to get whether all the patches are applied successfully or not.

I can't able to check the successful patch installation using https://shoplift.byte.nl. Because of the upgraded code on my local.

Any solution here.


texts: Magento1.9 : SSH command for apply catalog price rule

texts:
I have 50k products in my magento store and whenever I try to apply catalog price rules it goes to 504 gateway timeout error, and I don't get is the process complete or not.

Is there any SSH command to apply catalog price rule in magento1.9?

Or any other way to apply catalog price rules?


texts: Retrieve multiselect values for all products

texts:
I need to retrieve all values of some multiselect attributes that each of my products have. I found related posts but none of them seems to solve my problem.

For example I found the code

echo $_product->getResource()->getAttribute('car_options')->getFrontend()->getValue($_product);

But I don't know where should I get $_product from. I guess it's a simple task, but I am pretty new to Magento and I'm still discovering how it works.

I am using Magento 1.7. Any help is much appreciated :-)


texts: How to update the mini-cart proceed to checkout according to customer login in magento 2?

texts:
I Want to check the user login status in mini cart and redirect the customer to the login page when click the proceed to checkout button in mini-cart.

How to edit the minicart.js file to achieve this?

  vendor\magento\module-checkout\view\frontend\web\js\view

'url': {
            'checkout': window.checkout.checkoutUrl,
            'update': window.checkout.updateItemQtyUrl,
            'remove': window.checkout.removeItemUrl,
            'loginUrl': window.checkout.customerLoginUrl,
            'isRedirectRequired': window.checkout.isRedirectRequired
        },

How to use the if condition to check the user is logged or not logged?

I want to forcefully redirect to the customer (registered or guest) to the login page and after logged mini cart proceeds to checkout, the button should redirect to the checkout page.

Update

I did following changes to minicart.js

define([
'uiComponent',
'Magento_Customer/js/customer-data',
'Magento_Customer/js/model/customer',//Added this line
'jquery',
'ko',
'underscore',
'sidebar',
'mage/translate',
'mage/dropdown'
], function (Component, customerData, customer, $, ko, _) { //Passed argument customer
'use strict';

//checked the customer logged or not.
if(customer.isLoggedIn()){
        alert("yes");
        var urls = window.checkout.checkoutUrl;
    }else{
        alert("no");
        var urls = window.checkout.customerLoginUrl;
    }

esidebarInitialized = true;
    miniCart.sidebar({
        'targetElement': 'div.block.block-minicart',
        'url': {
            'checkout': urls,
            'update': window.checkout.updateItemQtyUrl,
            'remove': window.checkout.removeItemUrl,
            'loginUrl': window.checkout.customerLoginUrl,
            'isRedirectRequired': window.checkout.isRedirectRequired
        },
................... rest of the code of the file

Unfortunately customer.isLoggedIn() this return always not logged.
How to check a customer is logged or not logged?


texts:
I have set Save Log, Days to 15 days. However, I checked my log tables (e.g. log_customer), there are a lot of very old entries, back to 2010. I manually run log.php from shell - php -f log.php clean --days 1

Those old entries are still there afterwards. Any idea?

Edit:

Looks like only the following log tables not cleaned:

log_customer
report_viewed_product_index
report_compared_product_index
report_event
catalog_compare_item

They all have very old entries. Is there any purpose for this? Can I truncate them safely?


texts: Unable to extend Orders Rest Api of Magento

texts:
I am trying to extend Orders rest api in magento. For e.g To create a new update method. For doing this, I have created a new class in the local copy:
The file I am trying to override is :
app\code\core\Mage\Sales\Model\Api2\Order.php

But when I try to access the new method then I get a "Resource method not implemented" error message. I believe, the rewrite does not work in this case.

Similarly, I attempted to rewrite products rest api but over there rewrite method works correctly.

Just for your reference, I have pasted the code for Update Orders Rest Api below.

\app\code\local\MyModulename\Sales\Model\Api2\Order.php

class MyModulename_Sales_Model_Api2_Order extends Mage_Sales_Model_Api2_Order
{

    protected function _update(array $data)
    {
      echo 'in update function';
    }
}

\app\code\local\MyModulename\Sales\etc\api2.xml

app\code\local\MyModulename\Sales\etc\config.xml

Please note, this module is in active mode.

Any help would be appreciated. Thanks


texts: I'm currently working on a large scale API for a project and I've wondered if it's possible to split the wsdl.xml needed into several parts. It's getting problematic to find my way around the file due to it's large size.


texts: Css not working after Magento 2 installation on AWS

texts:
I've installed Magento 2 on AWS, however, the admin page is appearing like this:

What should I do?

Thanks!


texts: Remove custom Product Attribute from 'Default' Attribute Set

texts:
I added a custom product attribute to the default attribute set in Magento 2, but now when I try to remove it, by dragging the property to 'Unassigned Attributes' list, nothing happens. Its not clear how to remove a custom product attribute, once you added it to an attribute set.

I also tried this with a new custom product attribute set, added the custom attribute by dragging it to the Product Details group, saving the changes, and then trying to remove it again, but it does not seem to work.

I am using Magento 2.0.7.


texts: How to change product price with Plugin in Magento 2?

texts: How to change product price with Plugin in Magento 2 after saving product ?


texts: I have getting some error display in console but category search page is working properly and this error comes every time in console if any one know regarding this error reply me.


texts: Magento updates an order as paid after invoicing.I guess,that's the default behaviour. However, in Cash of Delivery orders, we need to send the invoice along with the shipment while the order is still unpaid. How can we generate an invoice while the order is still unpaid. We want to generate invoice before payment.


texts:
I am getting the following error when trying to get customer data from the one step checkout to send to a custom payment gateway:

  ERR (3): Recoverable Error: Argument 1 passed to MYMODULE_Helper_Data::getContactData() must be an instance of Mage_Sales_Model_Order, instance of Mage_Sales_Model_Quote given

This is called here:

  called in /var/www/vhosts/MYSITE/app/code/community/MYMODULE/Model/Method/Abstract.php on line 183 and defined  in /var/www/vhosts/MYSITE/app/code/community/MYMODULE/Helper/Data.php on line 117

The module is still getting the required data, but this error is creating issues when users use developer mode.

Unsure what I can do to fix this.


texts: The total label is not being displayed when the grid is exported through CSV

texts:
I have displayed total of columns in my magento grid.However when I export the content to CSV it does display the total but it do not display the label that is been placed.

public function getTotals()
{
    $totals = new Varien_Object();
    $fields = array(
        'total_no_of_orders' => 0,
        '
    );
    foreach ($this->getCollection() as $item) {
        foreach($fields as $field=>$value){
            $fields[$field]+=$item->getData($field);
        }
    }
    //First column in the grid
    //$fields['created_at']='Totals';
    $totals->setData($fields);
    return $totals;
}

And this is the code to display the word total

 $this->addColumn('created_at', array(
      'header'    => Mage::helper('partialpayment')->__('Date'),
      'align'     =>'center',
      'width'     => '50px',
      'index'     => 'created_at',
      'type'    =>'datetime',
      'format'    => 'MM-dd-Y',
      'totals_label'  => Mage::helper('partialpayment')->__('Total'),
   ));


texts: Magento 2 : Show all categories of a product

texts:
Actual state:
My products are in several categories.
Thus, when I call a product from an over category or by searching out, only the following is displayed in the breadcrumb:

"Start > ProductName " Although the product is in: "Start > Category1
Category2 > ProductName"
And"Start > Category3 > Category4 > ProductName" is contained.

Target state:
I would like to display all categories of the respective product on the product page.
It doesn't matter if it's breadcrumb or in the left sidebar.

I hope you can help me. :)

Current System:
Ubuntu 18.04
MariaDB
Magento 2.3.1


texts:
I have been trying to access a REST API end point that results in a 404 Not Found. I have come across documentation that explains the endpoints have to be configured in the webapi.xsd file. I have looked in all the directories under the ISS installation and can't find the file.

The documentation says "By default, this file is in app/code/<VENDOR>/Webapi/etc/webapi.xsd." but this directory doesn't exist.

Under app/code I only have "community" and "core"? Where is this file?

HELP!


texts: Change order status from pending to processing in Admin

texts:
I'm not much experienced in Magento. I'm working on a legacy Magento codebase where we use Magento 1.7.
Currently the status is changed from pending to processing using API calls. And it works perfectly. But I've got a requirement where we need to achieve the same from Magento Admin panel itself.
I've read in a lot of places that the status can be changed by adding a comment in order page. But the comment dropdown is limited to showing only pending option. I've looked at the code and I can't find the code for fetching order statuses (getStateStatuses) being overwritten anywhere.
I'm not sure what other details are needed to debug this. If you can ask me in comments, I can add the details.


texts:
I have following issue: I have a multistore installation where I have

a main store (example.com)
a second store for members only (sub.example.com), which has the login page as the start page on that store, and then has a more extensive product offering.

When a customer lands on example.com, we have a banner which informs (and link to redirect) the club members to use sub.example.com. However, when registered users of sub.example.com try to login on sub.example.com (after being redirected), they face the issue that they can't login and no error message is displayed.

My research leads me to believe that this is a cookie problem, stemming from the fact that the example.com cookie is set, and then causes problems when the user is redirected to sub.example.com

login works on all browsers after cookies and cache is cleaned, except for IE and safari. Users still can't login.

Session cookie management settings are:

Cookie Lifetime: 31536000
Cookie path: /
Cookie domain: (empty)
Use HTTP only: No
Cookie restriction Mode: No

I tried setting the cookie domain ".example.com", that didn't work either

Does anyone know how to solve that general cookie problem or what can be done so that IE and Safari users can login?


texts:
I wanna set this number 100000000000 to my product price but Magento change it to 100000000 and it doesn't save it correctly

how can I fix it?

magento version 1.9


texts:
I was tasked with extending Magento ACL functionality and allowing one user to hold more than one role.

I have been jumping from blog to blog and file to file for the last week - all I can find says only about isAllowed() method - this is nothing to do with what I'm looking for.

Why? If I log all calls to isAllowed() I get different results for admin and user - system already knows for which resources isAllowed() must be called.

I'm trying to create additional tables that holds user_id and role_id
ACL would be combine for all your roles.

I'm looking for a place in code when ACL matrix is contracted:
I narrowed my suspects to:

/app/code/core/Mage/Admin/Model/Resource/Acl.php

loadAcl();
loadRoles();
loadRules() ( $acl->allow() and $acl->deny() )

but I couldn't find any user-specific queries or methods
How system know you can access resources or not?
Am I looking in the right place?

Also:
checking files I found this comment:

//@FIXME: stupid fix of previous multi-roles logic.

in /app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php saveAction() aprx. Line 142

Looks like that functionality was available in previous versions - is there any existing code I could use?

Thank you in advance for any info that can help me to move that forward.

Best Regards,


texts:
I want to create static block in Magento 2.3.5 and call that block in footer content. please anyone can have idea then please share with me.

Thank you in Advance.


texts:
In log file i see error:

SELECT `e`.*, IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) AS `is_active`, IF(at_include_in_menu.value_id > 0, at_include_in_menu.value, at_include_in_menu_default.value) AS `include_in_menu`, `core_url_rewrite`.`request_path` FROM `catalog_category_entity` AS `e`
 INNER JOIN `atalog_category_entity_int` AS `at_is_active_default` ON (`at_is_active_default`.`entity_id` = `e`.`entity_id`) AND (`at_is_active_default`.`attribute_id` = '42') AND `at_is_active_default`.`store_id` = 0
 LEFT JOIN `catalog_category_entity_int` AS `at_is_active` ON (`at_is_active`.`entity_id` = `e`.`entity_id`) AND (`at_is_active`.`attribute_id` = '42') AND (`at_is_active`.`store_id` = 1)
 INNER JOIN `catalog_category_entity_int` AS `at_include_in_menu_default` ON (`at_include_in_menu_default`.`entity_id` = `e`.`entity_id`) AND (`at_include_in_menu_default`.`attribute_id` = '67') AND `at_include_in_menu_default`.`store_id` = 0
 LEFT JOIN `catalog_category_entity_int` AS `at_include_in_menu` ON (`at_include_in_menu`.`entity_id` = `e`.`entity_id`) AND (`at_include_in_menu`.`attribute_id` = '67') AND (`at_include_in_menu`.`store_id` = 1)
 LEFT JOIN `core_url_rewrite` ON (core_url_rewrite.category_id=e.entity_id) AND (core_url_rewrite.is_system=1 AND core_url_rewrite.store_id='1' AND core_url_rewrite.id_path LIKE 'category/%') WHERE (`e`.`entity_type_id` = '3') AND (`e`.`entity_id` IN('4', '3', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '54', '59', '58', '53', '61', '48', '55', '47', '51', '50', '56', '57', '5', '6', '49', '60', '80', '81', '82', '83', '84', '85', '86')) AND (`e`.`entity_id` NOT IN('5', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '60', '80', '81', '82', '83', '84', '85', '86')) AND (IF(at_is_active.value_id > 0, at_is_active.value, at_is_active_default.value) = '1') AND (IF(at_include_in_menu.value_id > 0, at_include_in_menu.value, at_include_in_menu_default.value) = '1')

but i not know what this error? in another server magento working, after move, not working, how i can solve this problem?


texts:
I am not able to open the Magento Connect Manager.

The backend is working fine, but after the login to access the Magento Connect panel I get redirected to this url showing me a blank page:

http://XX.XXX.XXX.XXX/XXXXXXX/downloader/?return=http%3A%2F%2FXX.XXX.XXX.XXX%2FXXXXXXX%2Findex.php%2Fadmin%2F#

My server is running openSuse 11.4, my Magento version is 1.8.1.0.

I have also tried to run the Magento clean up tool but nothing changed.


texts: Magento2 - Google Pagespeed Insight : any idea why it takes account of desktop css?

texts:
My question might not be magento specific, but I'm curious, as I couldn't find the answer elsewhere (or failed to find the correct terms).

When I use Google Pagespeed Insight on a magento 2 website with a template based on the basic one (or Luma), it says :

Remove unused CSS

…css/styles-l.min.css

But the code for the link to this CSS is :

<link  rel="stylesheet" type="text/css"  media="screen and (min-width: 768px)" href="https://www.magento2-website.com/static/versionxxxx/frontend/Template/base/fr_FR/css/styles-l.min.css" />

So it's supposed to be only use if width is more than 768px.

Any idea why Pagespeed thinks it have to be taken account ?

Thanks !

Edit : add Insight to be more specifis. The problem is not with mod_pagespeed, but with the fact that Pagespeed Insight takes account of a file that it shouldn't


texts: CSV Import with multiple categories and commas in category names

texts:
I have a CSV of products to import and each product has multiple categories, some with commas in the category name. To import a product and asign multiple categories, I would usually add a CSV column for _catagory and give a comma separated list of categories enclosed with double quotes:

sku,name,_category
1,Product 1,"Category 1,Category 2, Category 3"

However, if the category names have commas in them, how should I denote this in the CSV?

Category, 1
Category, 2
Category, 3

Perhaps escape the comma in the category name?

sku,name, _category
1,Product 1,"Category\, 1,Category\, 2, Category\, 3"

Or perhaps the only way to do this is to use the category ID rather than the name?


texts: How do you manage inventory for a grouped product?

texts:
Let's say that you sell tickets for an event, and you have the following constraints:

A max of 40 tickets can be sold for a given event slot
You have 5 different price tiers but you can accomodate different inventory levels per each of these.  (Ex: you can have 8 price tier A and 8 price tier B, or also 10 price tier A, 6 price tier B).

What would be the best way to manage this inventory?  If you could set maximum quantities per price tier that would be ideal, but if not, just being able to set inventory per the group would be good.

UPDATE: Initially I wanted to make the question more generic, but in the interest of being more accurate.  Specifically, the "event" is a boat trip.  You only have 40 slots in a given boat trip and there is some flexibility to the quantity of the price tiers (adult tickets are one tier, child tickets are another tier, etc.).


texts: How to avoid online orders sending stock into negative

texts:
I'm trying to figure out how to avoid stock going into negative in the ERP. Problem as follows;

Customer online orders certain items we do not keep in stock. Stock goes into -1,-2 etc.
I then order the items to fulfil the order via the purchase ordering, Upon delivery stock goes back to "0"
This action does not release the order from Stockless to Full stock orders. I then have to manually change the mass stock editor to reflect the needed changes.

Can you please help?


texts:
I'm trying to save some information using sales_order_place_after. But only when customer is new.
I discovered that Mage_Sales_Model_Quote::getCheckoutMethod(TRUE) should return register and so this is my work...

<?php
public function subscribeCustomer(Varien_Event_Observer $observer)
{
    if ($observer->getOrder() instanceof Mage_Sales_Model_Order) {
        Mage::log("sales_order_place_after");
        $order = $observer->getOrder();
        Mage::log("quoteId={$order->getQuoteId()}");
        $quote = Mage::getModel('sales/quote')->loadByIdWithoutStore($order->getQuoteId());
        Mage::log("checkoutMethod={$quote->getCheckoutMethod(true)}");
        if ($quote->getCheckoutMethod(true) == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER) {
            $subscription = Mage::getModel('mydaily/subscription');
            $subscription
                ->setCustomerId($order->getCustomerId())
                ->setIsSubscribed(1)
                ->save();
        }
    }
}
?>

The problem is when I'm ordering through backend.
How can I identify when customer is new in backend orders?


texts: Configurable product not linking simple products when using Magmi

texts:
I am using the following headers, which I believe are fine:

  sku|attribute_set|type|super_attribute_pricing|simple_skus|configurable_attributes|var_sku

  test11|Medlinev01|simple||||1

  testconf11|Medlinev01|configurable|test11,test22,test33|var_sku||

The issue, I believe, relies on the fact that Magento tries to add already linked products, so when I manually go into the configurable product menu, within the associated products tab, and hit the reset button they appear to work just fine.

However, when I try to associate them directly from the Magmi file, they dont work. The products are all created (both the simple and the configurable).


texts:
It is not working in .phtml template

                $types = array('full_page');
                foreach ($types as $type) {
                    $cacheTypeList->cleanType($type);
                }
                foreach ($cacheFrontendPool as $cacheFrontend) {
                    $cacheFrontend->getBackend()->clean();
                }


texts: Add custom fileds for Category in admin panel magento 2

texts:
I want to add One custom section in my Magento admin panel for categories. like https://prnt.sc/rf34k5.

And in that section, I want to add 3 text fields like https://prnt.sc/rf34nz.
How can I add custom fields for categories in Magento 2


texts: how to round up the product weight custom FedEx shipping method?

texts:
I used the FedEx custom shipping I send the weight of the product to the API for shipping rate calculation
but I want to round up weight at a time send in FedEx request weight like that 3.1 to 4.0 in Magento 2.3.


texts: Magento 1.9.2.4 : Theme installation error

texts:
I am trying to install a theme to my Magento store 1.9.2.4 but unfortunately i am getting the following error.

can anyone help me to fix this please.

  SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'masport1_mag.magentothem_blog' doesn't exist, query was: SELECT
  COUNT(*) FROM magentothem_blog AS main_table  LEFT JOIN
  magentothem_blog_store AS store_table ON main_table.post_id =
  store_table.post_id  LEFT JOIN (SELECT
  magentothem_blog_comment.post_id, COUNT(IF(status = 2, post_id,
  NULL)) AS comment_count FROM magentothem_blog_comment GROUP BY
  post_id) AS comments_select ON main_table.post_id =
  comments_select.post_id WHERE (main_table.created_time

Regards
M Niyaz


texts: Magento 2: programatically enable/disable Livereload inside theme

texts:
I've installed livereload and have it working inside of my theme, but there's a problem if I want to use this theme on another server.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/mystyle.css" />
        <script src="http://{myipaddress}:35729/livereload.js" src_type="url"></script>
    </head>
</page>

{myipaddress} = the IP address of the server.

How can I programmatically enable/disable livereload and change the IP address based on the server address. I know I can use $_SERVER['SERVER_ADDR'], but where and how can I insert this logic?

EDIT

I've added the following to my default.xml body.

<referenceContainer name="after.body.start">
  <block class="Myvendor\Mytheme\Block\Js\Livereload" name="livereload-config" template="Myvendor_Mytheme::js/livereload.phtml"/>
</referenceContainer>

And then created the corresponding block and template file. Fairly simple, but I just didn't think of it.


texts: How do I determine if a shopping cart contains items with custom prices as well as discounts from a shopping cart rule?

texts:
We have a number of items which use a discounted custom price for logged-in customers (part of an older promotion).  We're looking at running a new promotion that will automatically discount prices for everyone.  However we don't want the two promotions to be additive, we want the customer to get one discount or the other (the item's custom price, or the shopping cart rule)--whichever is greater.

How would I determine that a cart contains items with custom prices and also qualifies for a shopping cart rule?


texts: Get product collection from Pager / Product List block

texts:
I'm adding a custom block that will reside on frontend pages which contain a Product List (catalog_category_view, catalogsearch_result_index, etc).  The block needs to know which products are being displayed to the user.

I hoped to find an equivalent of the current_product registry item that's used on a product page; however so far I haven't found where I can readily retrieve this.

At the moment I'm handling the core_block_abstract_to_html_after event and then getting the collection from the Pager block:

public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
{
    $block = $observer->getEvent()->getBlock();
    if (!$block instanceof Mage_Page_Block_Html_Pager) {
        return;
    }

    /** @var Mage_Page_Block_Html_Pager $list */
    $list = $block;
    $products = $list->getCollection();

    Mage::register('current_products', $products);
}

Have I reinvented the wheel?  Is there a built-in option, or a better approach?


texts: Set Ship Bundle Items to default to "Separately"

texts:
Is there any way I can set the setting for bundle items "Ship Bundle Items" to "Separately" by default when new bundle products are created? Currently, it automatically sets this option to Together.

In eav_attribute table, I found the shipmnet_type and set default value to 1, but it did not have any effect.


texts:
I want to set the root category of a new batch created store.

I'm looking for something like :

$store->setRootCategory($rootCategoryId);

But it looks like it does not exists, despite there is a $store->getRootCategory() method.

I found a method in the Category Model: $category->setStoreId($storeId) but since a Category may be used by several stores as root category, it's probably not the right way do it ? is it ?

I'm a bit lost on that case, any help would be appreciated !


texts:
I am trying to override following file

  module-bundle/view/adminhtml/layout/sales_order_creditmemo_new.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_items">
            <block class="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="sales/creditmemo/create/items/renderer.phtml"/>
        </referenceBlock>
    </body>
</page>

I override it by creating same name layout file in my module

  Vendor_App/view/adminhtml/layout/sales_order_creditmemo_new.xml

<referenceBlock name="order_items">
    <block class="Vendor\App\Block\Adminhtml\Sales\Order\Items\Renderer" as="bundle" template="Vendor_App::sales/creditmemo/create/items/renderer.phtml"/>
</referenceBlock>

But my class and template are not overridden. I have created the class and phtml in my module.

I tried to override it using di.xml by adding following code.

<preference for="Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer" type="Vendor\App\Block\Adminhtml\Sales\Order\Items\Renderer"/>

And this works, but the problem is, on clicking Update Qty's button, it  fetches my template instead of its own template as the layout for Update Qty is different.

I tried above thing with Configurable and simple product both works perfectly, only bundle type is creating issue.


texts: Magento2 - Is it possible to get specific store url in cms block?

texts:
I am trying to get store URL or base URL for a specific store in cms block.

I have tried {{store _store="1"}}

Also, {{config path="web/secure/base_url"}}

I wanted to know if this is going to work or is there any solution for this


texts: Magento 2, send magento emails via Mailchimp

texts:
In Magento 2, i wants to send all emails(like Customer creation, order creation etc...) via Mailchimp.

Please suggest me is there any script, please navigate me.

Thank you


texts: Changing frontname in config.xml does not change url

texts:
I am trying to change the URL structure for a third party extension. I have changed the frontName attribute in config to "sellers" and cleared cache but when I access www.mysite.com/sellers I still receive a 404 page. The old name of the URL "mpsellerlist" still works though. Is there somewhere else I should be looking to change it? Here is my config.xml where I have made changes:

<frontend>
        <layout>
            <updates>
                <mpsellerlist module="Webkul_Mpsellerlist">
                    <file>mpsellerlist.xml</file>
                </mpsellerlist>
            </updates>
        </layout>
        <routers>
            <mpsellerlist>
                <use>standard</use>
                <args>
                    <module>Webkul_Mpsellerlist</module>
                    <frontName>sellers</frontName>
                </args>
            </mpsellerlist>
        </routers>
    </frontend>

Note: I am not sure if this is affecting it, but we do have static pages set up one level below "sellers" - ex: www.mysite.com/sellers/how-to-sell.html. Would that cause /sellers to be unavailable for a frontName attribute?


texts: How I can make Magento 2 sidebar sticky like cart sidebar when scroll to down?

texts:
I am a beginner to Magento 2 and want to make a sticky sidebar when scrolling down like a cart page summary. I try using jQuery but not working for me. Can anyone help me?
https://i.stack.imgur.com/w9L0I.png


texts: Magento 2 Cart Price Rule Coupon Specific Coupon Does not Apply for some porducts in Admin Order

texts:
There is an issue which I am not sure if it's a bug and I hope someone can tell me, the bellow screen shoot were taken from an order:

As you can see the product in red circled didn't apply the discount, however it was deducted from Subtotal (by the way shipping isn't included)

So:

  84.96 - 10% = 76.464

  74.96 + 19.99 = 96.454 ( which is correct) round Floor() php I assume.

Now Total Paid was Charged £103.45 * Which is WRONG* From Customer account also was taken £103.45 which isn't good.

And the reason is I think is because it this one product was not added 10% on which 69.99 should have been 6.99 Discount Amount but instead is 0.00

Any one any help appreciate


texts: Indian Rupee Symbol not showing only for Windows OS

texts:
I was spend few hours on googling for showing the ₹ instated of Rs.. I have found mostly a common answer. And try each of theme but its not worked for me.
My approached  :
First I have followed the following answer
How to change Rs to Indian rupee symbol
Its showing ₹ symbol on Linux system but not showing on Windows system. Then I tried an alternative method.

Download this JS file from here and upload to root/js folder.

Open file app/design/frontend/default/YOUR THEME/layout/page.xml

And add a new line <action method=”addJs”><script>rupee.js</script></action> after  <block type=”page/html_head” name=”head” as=”head”>.

Open a file lib/Zend/Locale/Data/root.xml
and find code < symbol >Rs < /symbol > and replace it with < symbol >Rs. < /symbol >

And also use < symbol >₹< /symbol > instead of < symbol >Rs< /symbol >
But finally I'm failed
I will be Appreciate for your help.


texts: Magento 2: Sort/Reorder checkout form fields

texts:
Is there a way to reorder/sort magento 2 checkout form fields from admin. In admin I just find to display/hide fields for checkout form.
I want to sort like ( Move firstname to bottom or move any other field to another place )
So is there any option to sort the checkout form fields in magento admin or I have to go with coding.


texts: Magento 2 - Compare product Count and Compare product URL Not working?

texts:
In Magento 2, I am not getting compare product count on adding the product to compare list even it does not redirects when I click on compare product button in header location.
Kindly Suggest.


texts: How to display only configurable products count in the catalog?

texts: I set to show only configurable products on my catalog. The problem is the product count displayed in the product list toolbar. It shows total count of simple products not configurable what I think is more important for the customer. How to display "correct" count?


texts: How can I increase the number of related products shown on product detail page in Magento 2?

texts: I am running Magento 2.3.3 and currently show 4 products on the product detail page. Where do I go to increase that number to 6? I have found nothing in the admin panel.


texts: How to debug: "HEADER ALREADY SENT" and GD2?

texts:
I have an annoying HEADER ALREADY SENT error in system.log.

It is not easy to debug it, what I could do was to improve the logging to isolate the source of the issue (has described here):

Cannot send headers; headers already sent in lib/Varien/Image/Adapter/Gd2.php, line 133

Line 133 of Gd2.php:

call_user_func($this->_getCallback('output'), $this->_imageHandler);

And it is part of the method display:

public function display()
    {
        header("Content-type: ".$this->getMimeType());
        call_user_func($this->_getCallback('output'), $this->_imageHandler);
    }

How to go on ?


texts: Extra column in catalog_product_entity_tier_price not saving/updating in observer in Magento 2.3

texts:
Trying to get this working in Magento 2.3

Extra column in catalog_product_entity_tier_price not saving/updating in observer

Progress so far

https://bitbucket.org/DominicWatts/tierpricing

Can get column to show but will not save.  Also if you manually edit in db value is wiped on next save if you change price or quantity.

Has anyone got this change working in Magento 2.3?


texts:
I need to modify the content of this div.
To be exact, I need to change the conntent where it says <?php echo $html ?>
However, I don't know where to find the content.
The file path is:

src/app/design/frontend/website/default/template/serializedproduct/catalog/product/view/configurable.phtml

Also, not very clear about what getChildGroup() means?

this is the code:

                    <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>

<?php echo $this->__('Details') ?>

                        <?php $itemprop = 'itemprop="description"' ?>
                        <?php foreach ($detailedInfoGroup as $alias => $html): ?>
                            <div <?php echo $this->__($itemprop); ?>class="info-content"><?php echo $html ?>

                            <?php $itemprop = ''; ?>
                        <?php endforeach;?>
                    <?php endif; ?>

Your help will be highly appreciated.

Thanks.


texts:
Is it possible to turn off Concurrent Sessions?

We had a pen test and it flagged concurrent sessions.

  Weak Session Management - Concurrent Sessions Allowed


texts: Add custom knockout component to checkout sidebar in Magento 2

texts:
I'd like to know what is the best approach to add a custom knockout component to the checkout sidebar in Magento 2, an example assuming we already have a custom module would be great

UPDATE:
As I needed a placeholder different than the "summary", I followed Sohel's answer and also did those steps
Override sidebar template in module's requirejs-config.js:
var config = {
    map: {
        '*': {
            'Magento_Checkout/template/sidebar.html': 'SR_MagentoCommunity/template/sidebar.html',
            sidebar: 'SR_MagentoCommunity/js/sidebar'
        }
    }
};

Add a new region called "timer" in the new overriden sidebar.html template:

Update checkout_index_index.xml to place the component in the new region:
<item name="sidebar" xsi:type="array">
    <item name="children" xsi:type="array">

        <item name="timer" xsi:type="array">
            <item name="component" xsi:type="string"> SR_MagentoCommunity/js/timer</item>
            <item name="displayArea" xsi:type="string">timer</item>
            <item name="config" xsi:type="array">
                <item name="template" xsi:type="string"> SR_MagentoCommunity/timer</item>
            </item>
        </item>

    </item>
</item>

And this is the final result:


texts:
This is my query:

SELECT `main_table`.* ,
  CONCAT (`main_table`.`name`, " (", count(*), "x)") as `total`
FROM `sales_flat_order_item` AS `main_table`
WHERE (`order_id` = '145375')
GROUP BY `main_table`.`name`

This is my collection right now:

$orderItems = Mage::getModel('sales/order_item')->getCollection()
            ->addFieldToFilter('order_id', $row->getData('entity_id'));

I want to add the concat condition and group by condition. How can I do that ? thx


texts: Magento 2.1.3 : URL key For Specified Store Already Exists When Saving Categories

texts:
I searched for this kind of issue and saw many others experiencing this thing like me. I tried those fixes that they recommend but it's not working on my end.

Maybe you guys can suggest what is the best thing or any recommendations how to fix this one.

Any ideas on the best solution to fix this bug?

Thanks!


texts:
I need some suggestions. We have very large database for our production and staging instance which consuming so much space.

Can we delete some log tables or extra tables from staging so that we can make some space. Please let us know the table names which could be truncated apart from products and customers. We have clear the orders already. So is there something else which could be cleared.

Thanks


texts: Programmatically create a wysiwyg editor for frontend magento 2.3

texts:
I don't see any examples in frontend of magento for this case. Wonder how to add editor field from php class instead template

When try to call wysiwygConfig->getConfig() in my block class i got error message from core files

  Exception #0 (BadMethodCallException): Missing required argument $variablePluginConfigProvider of Magento\Cms\Model\Wysiwyg\CompositeConfigProvider.

Below is my code for generate field editor but i think this is legacy way and can't use anymore in 2.3

public function getHtmlEditor()
{
    //Refactor this line later
    $object_manager = \Magento\Framework\App\ObjectManager::getInstance();
    $wysiwygConfig = $object_manager->get('\Magento\Cms\Model\Wysiwyg\Config');
    $configwysiwyg =  $wysiwygConfig->getConfig();
    $configwysiwygData = $configwysiwyg->getData();
    $configwysiwygData["settings"]["theme_advanced_buttons1"] = "bold,italic,|,justifyleft,justifycenter,justifyright,|,fontselect,fontsizeselect,|,forecolor,backcolor,|,link,unlink,image,|,bullist,numlist,|,code";
    $configwysiwygData["settings"]["theme_advanced_buttons2"] = false;
    $configwysiwygData["settings"]["theme_advanced_buttons3"] = false;
    $configwysiwygData["settings"]["theme_advanced_buttons4"] = false;
    $configwysiwygData["settings"]["theme_advanced_statusbar_location"] = false;
    $configwysiwygData["height"] = "250px";
    $configwysiwygData["add_variables"] = false;
    $configwysiwygData["plugins"] = false;
    $configwysiwygData["add_widgets"] = false;
    $configwysiwygData["add_images"] = false;
    $configwysiwygData["files_browser_window_url"] =false;
    $configwysiwygData["no_display"] =true;
    $configwysiwygData["toggle_button"] = false;
    $configwysiwyg->setData($configwysiwygData);
    $elementId = "custom_wysiwyg_content";
    $config = [
        'label'     => __('Content'),
        'name'      => 'wysiwyg_content',
        'config' => $configwysiwyg,
        'wysiwyg' =>  true,
        'style' => 'width:100%; height:250px;',
        'required'=> true,
        'class' => " required-entry",
        'value' => '',
        "validation" => [
            "required-entry" => true
        ]
    ];
    $form = $object_manager->get('\Magento\Framework\Data\Form');
    $editor = $object_manager->get('\Magento\Framework\Data\Form\Element\Editor')->setData($config);
    $editor->setForm($form);
    $editor->setId($elementId);
    return $editor->getElementHtml();
}

in template i only need to call this method

 echo $block->getHtmlEditor();

Is there a right way to do this ? Prefer no js way only php code

UPDATE

Currently i found the way to solve problem
Add new di.xml in etc folder inside module

etc/frontend/di.xml with content

<type name="Magento\Cms\Model\Wysiwyg\CompositeConfigProvider">
    <arguments>
        <argument name="variablePluginConfigProvider" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Variable\Model\Variable\ConfigProvider</item>
        </argument>
        <argument name="widgetPluginConfigProvider" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Widget\Model\Widget\Config</item>
        </argument>
        <argument name="wysiwygConfigPostProcessor" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Cms\Model\Wysiwyg\DefaultConfigProvider</item>
        </argument>
        <argument name="galleryConfigProvider" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Cms\Model\Wysiwyg\Gallery\DefaultConfigProvider</item>
        </argument>
    </arguments>
</type>

This approach same as admin do but for frontend area


texts:
I am using Magento 2.3.3 here I am facing the issue of sales order email when I place order the order placed successfully but I don't receive any email and in Magento order view it show's email was not sent. But when I trigger manually from the order view page click on send email button then I got the order confirmation email but after placed order from the frontend, I don't get an email I have to manually click on send email button from Magento admin backend for getting email. What may be issue any hint will be appreciatable.

When I checked log I got the below error may it be an issue with email sending :

main.CRITICAL: No such entity with customerId = 'id {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with customerId = 'id' at /vendor/magento/framework/Exception/NoSuchEntityException.php:50)"}

Thanks in advanced


texts: Unable to enable the Apache2 user www-data

texts:
After completing the Magento 2.0.0 rc and creating the user 'www-data' for the root installation drive /var/www/html I was unable to run the following command.

Enable Apache user ->sudo chsh -s /bin/bash www-data
Set the user’s password -> sudo passwd www-data
Trying to take ownership of my Magento2 files using 'www-data' user -> chown -R www-data .

Received a very large list of errors either Operation not permitted or Permission denied

Thanks in advance.


texts: Magento 2 - Saved Billing Address is not passed on COD

texts:
When trying to place an order on the mode of COD for the already existing Address, the order is not placed throws 400 bad request issue. On reviewing the console, we found that the billing address is not passed. Refer the below screenshot.

  Default API URL:
  https://www.domain.com/rest/english/V1/carts/mine/payment-information

But for Newly added address the orders are placing.

Can anyone help me to sort out this issue?


texts: How to filter Mage::getResourceModel('catalogsearch/fulltext_collection') by custom attribute

texts:
I want to apply some custom filter on $collection = Mage::getResourceModel('catalogsearch/fulltext_collection') search collection.

For this I have created a custom module and override Mage_CatalogSearch_Model_Layer getProductCollection function.

How to apply ->addAttributeToFilter('custom_attribute',array('in' => $array))?

When I try to apply above filter to catalogsearch collection then it returns error :

Column not found: 1054 Unknown column 'e.custom_attribute' in 'where clause', query was: SELECT FLOOR((ROUND((e.min_price) * 1, 2)) / 100000) + 1 AS `range`, COUNT(*) AS `count` FROM `catalog_product_index_price` AS `e`
 INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id AND search_result.query_id='33'
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2' WHERE 1=1 AND ( final_price >= "10000" AND final_price <= "145268" ) AND (e.custom_attribute IN(190, 1247, 2862, 2863, 2864)) AND ( e.website_id = '1' ) AND ( e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY FLOOR((ROUND((e.min_price) * 1, 2)) / 100000) + 1 ORDER BY FLOOR((ROUND((e.min_price) * 1, 2)) / 100000) + 1 ASC

->addAttributeToFilter('custom_attribute',array('in' => $array)) it returns unknown column e.custom_attribute error.

How to resolve this error?


texts: How to update image on customizable option change

texts:
In my site I need to change product's main image on customizable option change.

I have a text field customizable option. When it updates, I make a call to some URL and that URL returns me an image.

I need to set this image as main image for the current product, just for preview. I don't need to save the image in  Magento. I just need to get the image as main image by adding it before other images of the product.

Is there any way I can do this?


texts: Column not found: 1054 Unknown column 'x' in 'where clause'

texts:
The whole error message is

Column not found: 1054 Unknown column 'root_category_id' in 'where clause'", query was: SELECT `main_table`.* FROM `amasty_menu_item_order` AS `main_table` WHERE (`root_category_id`) = '2') ORDER BY sort_order ASC

I tried many things to solve this...

I deleted all generated files and cache files:

grunt clean
rm -rf generated var/cache/* var/view_preprocessed pub/static/*

Then I executed php bin/magento setup:upgrade && php bin/magento setup:di:compile

but it does still throw the error.


texts: Magento 1.9.2. - Delete all second images of the products

texts:
During an import of all the new products in the "media gallery" section of each product, a second image path has been added for error.
I want to avoid manually deleting all the second images of each product. Is there a way to automatically delete all the second images of each product without touching the main image with "order: 1"?

Thanks for any help


texts: Load times for files in pub/static/ are extremely variable and often painfully slow

texts:
On Magento 2.3.3 I'm seeing extremely variable load times for files served from Magento's pub/static directory. This happens in both developer and production modes, and I can't understand what's causing it.

Main symptoms are pages which take a huge amount of time to load, especially on first visit and especially when the FPC is disabled. But I don't just mean "a few seconds extra" - I'm talking minutes of load time.

pub/static resources (mainly JS files) take several seconds each to reach TTFB i.e. there's tons of "waiting" for files in the browser. This causes a massive amount of request blocking as the browser waits.

Even if I load up the URI of a single JS file in the browser the load times are insanely variable: first time I request a file directly it might take 4 seconds to load, then I refresh a couple of times and it loads instantly, then I refresh again and it's back to 4-5 seconds. And this is on a machine which has zero net traffic other than my own testing.

The hardware I'm using is a 32-core CentOS-based machine with 128GB RAM and SSDs so this should not be a hardware issue. I'm running httpd, MariaDB, php-fpm, redis/memcache for page cache and session storage. I've set up Varnish in the past but would prefer to get Magento running acceptably before resorting to using aggressive caching as a crutch.

My php-fpm config looks like this:

listen = /var/run/php-fpm/website.sock
listen.owner = magento
listen.group = www
listen.mode = 0660
user = magento
group = www
pm = static
pm.max_children = 500
pm.start_servers = 30
pm.min_spare_servers = 30
pm.max_spare_servers = 50
pm.max_requests = 500
php_admin_flag[log_errors] = on
php_admin_flag[zlib.output_compression] = On
php_value[memory_limit] = "4096M"
php_value[session.gc_maxlifetime] = "86400"
php_value[opcache.memory_consumption] = 512MB
php_value[opcache.max_accelerated_files] = 60000
php_value[opcache.consistency_checks] = 0
php_value[opcache.revalidate_freq] = 0
php_value[opcache.enable_cli] = 1
php_value[opcache.interned_strings_buffer] = 64

Any ideas?


texts: URL rewrite for category in layered navigation to external URL

texts:
I'm trying to do a URL rewrite for 3 categories on the layered navigation to external URLs. I tried doing 301 redirects in the .htaccess file--that didn't work. I tried using Magento's URL rewrite management tool--that didn't work.

The link on the layered navigation is shows: http://dev.morrisononline.com/index.php/shop/petroleum-brands/76.html

I tried using this link, and it's category ID to do the rewrites and neither worked.

Help!


texts: Checkout Not Working on Windows 8 Mobile

texts:
I'm running Magento 1.702 with Ultimo theme.

Recently a customer told me he couldn't progress past entering his billing details on a Windows 8 mobile phone.

Note: I have combined steps 1 and 2 of the One Page Checkout, so billing details is presented as the first step - logging in or registering functionaility is now combined with the billing address form via Skip Checkout Step 1 plugin.

At first, I assumed the above plugin was the problem, but I found someone else having the same issue in comments under the Ultimo theme on ThemeForest:

  One page checkout doesnt work on a mobile device. I am using Windows Phone 8 and the checkout doesnt advance further after I select Checkout as Guest.

To which the theme's developer replied:

  Checkout is Magento’s core functionality not related to the theme, the checkout process wasn’t modified in our theme (checkout was only styled with CSS), so if you see an error this is not from the theme.

This seems to rule out the theme being the problem, and the Skip Checkout Step 1 plugin, as the author of the above comment refers to the default checkout behaviour not working in a windows 8 mobile. I can also confirm this behaviour existed before I installed the plugin, as (according to google analytics) windows 8 phones have generated zero income since the site launched.

My questions:

Has anyone else noticed this behaviour? (Might be worth checking your own analytics data, or perhaps you have a windows8 phone and have trouble checking out on other magento-based sites?)
Does anyone know what might be causing the issue? Does the Windows 8 mobile browser handle javascript differently to desktop Internet Explorer?
Where is the cart javascript stored by default? In my case, billing.save() isn't working, but I would assume all .save() functions aren't working (as confirmed by the comment quoted above) - If I'm going to fix this, I assume this is the file that needs checking and editing?


texts:
I'm using Magento 2. I have updated the products price including Tax value. I want to show all product price value with included tax at the cart page.
Please help me to solve this problem.


texts:
I need to disable certain blocks to some user agents. The question may sound vague, but any hint will be very helpful.

I have this code and I think I have to modify something here.

final class Rand_Page_Model_Observer_HideBlocksObserver
{
    /**
     * Hide Header and Footer from cms page for "sg-mobile-app"
     * user-agent (handles event "controller_action_layout_load_before")
     */
    public function hideBlocks(Varien_Event_Observer $observer)
    {
        /* @var $layout Mage_Core_Model_Layout */
        $layout = $observer->getEvent()->getLayout();
        $handles = $layout->getUpdate()->getHandles();

        $req = Mage::app()->getRequest();
        $userAgent = $req->getHeader('User-Agent') ?: null;
        $hideContainers = f\nullable('boolval', $req->getQuery('hide-containers'));
        if ($hideContainers === false) {
            return;
        }

        if ($this->canExcludeHandle($handles) && ($userAgent === 'sg-mobile-app' || $hideContainers)) {
            $layout->getUpdate()->addHandle('hide_blocks');
        }
    }

    private function canExcludeHandle(array $handles): bool {
        $handlesToExclude = ['cms_page', 'sales_guest_form', 'sales_guest_view'];
        return f\any(c\inArray($handlesToExclude), $handles);
    }
}

Do you have any idea on how to do it?


texts: Looking at converting entire site to https (SEO)

texts:
I'm looking to make my site entirely secure for 2 reasons. 1. Google has indicated that this will become a ranking factor and 2. I've invested in a EV SSL certificate and would like to show visitors that are browsing that the site is 100% legitimate.

Question 1: Is it enough to set the Unsecure Base URL's to https://www.mysite.com/ and is there additional settings needed to be carried out in the .htaccess file?

Question 2: Does the magento caching system work with https? Is there a FPC that will work efficiently with https?

Question 3: After the urls become https, is it necessary to then update the sitemap to reflect the new protocol or will this be handled by the url rewrites?

Thank you kindly in advance!


texts: Varien_Data_Tree_Node - Position nav menu items

texts:
Digging into the 1.9 RWD nav menu, I am fiddling with Varien_Data_Tree and Varien_Data_Tree_Node - I haven't worked with these classes directly before and they seem unfinished as there are several empty methods in the classes.

Using an observer on the page_block_html_topmenu_gethtml_before event, I am able to add a new item to the menu using:

    $event = $observer->getEvent();
    $menu = $event->getMenu();
    $nodeData = array(
        'name'      => 'My Node',
        'id'        => 'my_node',
        'url'       => 'My-Url.html',
        'is_active' => false
        );
    $node = new Varien_Data_Tree_Node($nodeData, 'my-node', new Varien_Data_Tree());
    $menu->addChild($node);

As expected, I see a new nav menu item on the front-end listed after any other nav items already built; however, I would like to position this node so that it is shown before or after any other items (such as how before="-" after="-" are used in layout XML).

How can I adjust the position of items added to the nav menu in this fashion?


texts: Magento 2 Allowed Memory exhausted error when compile code

texts:
I have error when i add module..

Please re-run Magento compile command

so i run below command but also display error that below when run command from root,

php magento setup:di:compile

Compilation was started.
%message% 0/7 [>---------------------------]   0% 1 sec 37.0 MiB%message% 0/7 [>
---------------------------]   0% 1 sec 37.0 MiBProxies code generation... 0/7 [
>---------------------------]   0% 1 sec 37.0 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% 47 secs 43.5
MiB
Repositories code generation... 1/7 [====>-----------------------]  14% 47 secs
43.5 MiB
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate
 24 bytes) in D:\xampp\htdocs\linsenwelt\vendor\zendframework\zend-code\src\Scan
ner\FileScanner.php on line 36

How to fix ?


texts: magento add field dependency in admin form using a javascript function

texts:
In an custom admin form,  I have added a custom tab and some custom fields to it. here I need to add field dependency for the fields as described below.

  if the field zipbasedprice_isrange is set to yes, then I need to show other two fields & if it is set to no, then only one field should be shown.
  How can I implement this using below form?

  Field dependencies should be between zipbasedprice_isrange, zipbasedprice_zip, zipbasedprice_zip_from_zip & zipbasedprice_zip_to_zip.

I tried default field dependencies, but it did not work. Help me, how to implement this using a javascript function?

  $isRange = $fieldset->addField('zipbasedprice_isrange', 'select', array(
    'name' => 'zipbasedprice_isrange',
    'label' => Mage::helper('zipbasedprice')->__('Is Range?'),
    'values' => array(
        array(
            'value' => false,
            'label' => Mage::helper('zipbasedprice')->__('No'),
        ),
        array(
            'value' => true,
            'label' => Mage::helper('zipbasedprice')->__('Yes'),
        )
    ),
   'value' => false,
   'onchange' => 'onIsZipRangeChange()',
   'required' => false,
   'style' => 'width:275px',
  ));

$fieldset->addField('zipbasedprice_zip', 'text', array(
    'name' => 'zipbasedprice_zip',
    'label' => Mage::helper('zipbasedprice')->__('Zip Code'),
    'class' => 'input',
    'required' => true,
    'style' => 'width:268px',
    'value' => '*',
    'maxlength' => 6,
 ));

 $fieldset->addField('zipbasedprice_zip_from_zip', 'text', array(
    'name' => 'zipbasedprice_zip_from_zip',
    'label' => Mage::helper('zipbasedprice')->__('Zip Code From'),
    'class' => 'input',
    'required' => true,
    'style' => 'width:268px',
    'value' => '*',
    'maxlength' => 6,
 ));

  $fieldset->addField('zipbasedprice_zip_to_zip', 'text', array(
    'name' => 'zipbasedprice_zip_to_zip',
    'label' => Mage::helper('zipbasedprice')->__('Zip Code To'),
    'class' => 'input',
    'required' => true,
    'style' => 'width:268px',
    'value' => '*',
    'maxlength' => 6,
 ));


texts: Magento 2 - Removing swatches.css from theme

texts:
Its a pretty simple and straightforward question, at the moment my theme seems to be pulling through the following:

  Vendor/default/en_GB/Magento_Swatches/css/swatches.css

this isn't in my theme, and Magento_Swatches folder doesn't exist, its obviously pulling from the core.

But i don't want this, i've written my own styles for it and dont want it there. I tried in the following way:

  Vendor/default/Magento_Theme/layout/default_head_blocks.xml

<remove src="Magento_Swatches/css/swatches.css" />

or

<remove src="css/swatches.css" />

Neither seems to work. Does anyone know?


texts: How do I limit number of rows in the admin form in magento

texts:
down vote
favorite
I have following code in my Form.php

$fieldset->addField('name', 'textarea', array(
    'label' => Mage::helper('module')->__('Name'),
    'class' => 'required-entry',
    'required' => true,
    'name' => 'name',
));

I want to restrict the number of rows to display it like a single row, the code: 'rows' => 1 doesn't work here.


texts:
my site some time in a day go down and debug show me this error:
{"0":"Warning: SessionHandler::read(): The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in \/var\/www\/vhosts\/xxxx.com\/httpdocs\/vendor\/magento\/framework\/Session\/SaveHandler\/Native.php on line 22","1":"#1

How can I solve this issue?
Thanks


texts: you created new theme with html and css and integrated in all pages in magento 2?

texts:
I have worked on HTML and CSS. I completed the page designs on HTML and CSS.

How to integrated all pages in Magento 2 ?


texts: check if product attribute exists in upgradeData.php

texts:
I have a custom product attribute named additional_cost. Now I want to delete this additional_cost attribute or I want to update it. In order to do this both I need to first check if this attribute already exist.

I want to check the attribute in UpgradeData.php script. So how can I solve this problem

    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->removeAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'additional_cost'
    );

The removing code is ready. What will be the if statement?


texts: Magento 1.9 SOAP product update - out of stock

texts:
I manage to update products by SOAP api, but after update my products have 'Out of stock' label. It looks like Magento bug, because I am not updating stock inventory and I don't use this feature in my shop.
I found that after update when I go to backend and open and resave product 'out of stock" disappears. I empty cache and reidnex everything, still no success.
Please help how to fix it ?
I am using 'catalog_product.update'


texts: Show attribute data anywhere on the website using product ID

texts:
What I want to do is show the price of a particular configurable product using its ID anywhere on the website?

I'm learning as I go.


texts: 503 error when ajax cart order is larger then stock

texts:
When i try to add more products then the stock to the shopping cart with the extention ajax cart by cmsmart the page returns a 503 error. Their should be an error msg  saying the order is to large.

This is the error log thats returned:

here has been an error processing your request

De gevraagde hoeveelheid voor "Natural Tech Energizing Gel 150 ml" is niet beschikbaar.

Trace:
#0 /home/users/beaxmftp/beautyballoon.nl/includes/src/__default.php(10138): Mage::throwException('De gevraagde ho...')
#1 /home/users/beaxmftp/beautyballoon.nl/app/code/local/Cmsmart/AjaxCart/controllers/IndexController.php(154): Mage_Checkout_Model_Cart->addProduct('130', Array)
#2 /home/users/beaxmftp/beautyballoon.nl/app/code/local/Cmsmart/AjaxCart/controllers/IndexController.php(67): Cmsmart_AjaxCart_IndexController->tryaddAction(Object(Mage_Catalog_Model_Product), Array)
#3 /home/users/beaxmftp/beautyballoon.nl/includes/src/__default.php(14015): Cmsmart_AjaxCart_IndexController->indexAction()
#4 /home/users/beaxmftp/beautyballoon.nl/includes/src/__default.php(18432): Mage_Core_Controller_Varien_Action->dispatch('index')
#5 /home/users/beaxmftp/beautyballoon.nl/includes/src/ArtsOnIT_OfflineMaintenance_Controller_Router_Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#6 /home/users/beaxmftp/beautyballoon.nl/includes/src/__default.php(17962): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /home/users/beaxmftp/beautyballoon.nl/includes/src/__default.php(20759): Mage_Core_Controller_Varien_Front->dispatch()
#8 /home/users/beaxmftp/beautyballoon.nl/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /home/users/beaxmftp/beautyballoon.nl/index.php(89): Mage::run('', 'store')
#10 {main}

Can anyone help me how to resolve this?


texts:
Today I have upgraded my store to 1.9.2, but it is giving an error page.

I have try to cross check the same using error log.

it is giving me below error.

2014-09-17T08:36:59+00:00 ERR (3): Notice: Undefined index: script_name  in /home/Store_name/public_html/errors/processor.php on line 445


texts: Manage customers in different stores - Magento 2.3.1

texts: I am using 3 stores on my same website, how can I restrict access to customers to different stores? I would like that customers can only buy at a particular store, not at all. It's possible?


texts:
I tired to delete an extension and now getting:

There has been an error processing your request
Plugin class Aheadworks\OneStepCheckout\Plugin\App\FrontController\CoreBridgeInitializer doesn't exist

Deleted the files from /code directory
Deleted associated databases.
Deleted module from setup_module table.
Deleted module entry from app/etc/config.php file.

Still this error is showing...


texts: Call to a member function setId() on boolean issue in Magento 1

texts:
I receiving this error:

  Fatal error: Uncaught Error: Call to a member function toHtml() on boolean in ...

This is how my block is declared:

    <blocks>
        <emailtester>
            <class>Yireo_EmailTester_Block</class>
        </emailtester>
    </blocks>

This is my block from where the error occurs:

 class Yireo_EmailTester_Block_Form extends Mage_Adminhtml_Block_Widget_Container
 {
...

    protected function _toHtml()
    {
        $this->setChild('check', $this->getCheckBlock());
        $rt = parent::_toHtml();
        return $rt;
    }

    protected function getCheckBlock()
    {
        return Mage::app()->getLayout()->createBlock('emailtester/form_check')->setId('check');
     //   return $this->getLayout()->createBlock('emailtester/form_check')->setId('check');
    }

Whatever string I type instead of emailtester/form_check I still get this error message. Any idea what could cause this issue? thank you in advance for any idea


texts: Magento 2.3.4: How to remove unnecessary script?

texts:
I tried to bundle the script using some known commands, but still having to much scripts.
Help me too boost my site.
some of google


texts: Quantity selector does not work in magento2

texts:
We have configured single products in grouped products. The quantity selector does not work with the minus and "+" signs.
See the Screen shot https://prnt.sc/ojpqi1


texts: Display of "Not visible individually" for a simple product in mini cart in Magento 2

texts:
I want to display not visible individually simple products in the mini cart section.

This product displays inside the cart page, but it doesn't display inside the top minicart section.


texts:
i have override "revokeCustomerToken" mutation & tried to add input "page data" to it, but it seems "revokeCustomerToken" does not support input attributes
https://devdocs.magento.com/guides/v2.4/graphql/mutations/revoke-customer-token.html.

Is their any way we can pass some data in "revokeCustomerToken" mutation ?
like
mutation {
  revokeCustomerToken {
    result
    pagedata
  }
}

I doubt it does not support input parameters.
Any thoughts on this ?


texts: How to display options of custom attribute product magento 2?

texts: I have created a custom attribute for product and I can add options dynamically as well. But the problem now I'm facing is that I want to display just the option relative to the current product, so when I proceed to create the configuration according to this attribute I will just find the options relative to this product so how to do that please and thanks in advance.


texts: To range date filter issue in Shopping Cart Price Rules grid in magento 1.9

texts:
IF module's field type is date, then in module's grid if I filter with date, to date value's record are not shown as result in grid.

For example I have generated 3 shopping cart price rule, with date range of 2nd October to 4th October start date.

If I filter with From date 2nd October and To date 4th October , How ever 4th October has result. It is not shown in grid.

This issue happens in magento 1.9 's Shopping Cart Price Rules grid. I have not add any extension for this promotion rule.

If any one has solve this issue, can you please help me?


texts: finding location of $this->getLinks() in template

texts:
I have a phtml template that has the following code in it:

<?php $links = $this->getLinks(); ?>

    <?php foreach ($links as $name => $group): ?>
        <?php if (!empty($group['handle'])): ?>
            <?php
                $class = "";
                $anchorText = "";
                switch ($group['css_class']) {
                    case "facebook":
                        $class = "facebook";
                        $anchorText = "Facebook";
                        break;
                    case "twitter":
                        $class = "twitter";
                        $anchorText = "Twitter";
                        break;
                   case "google-plus":
                       $class = "google";
                        $anchorText = "Google+";
                        break;
                }
            ?>

                <a href="<?php echo $this->escapeUrl($group['url'].$group['handle']) ?>" class="social-link <?php echo $class; ?>" target="_blank"><?php echo $anchorText; ?>

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

I need to modify the links to remove google+ but I can't find where $this->getLinks() is coming from. Any pointers for where to look would be appreciated.


texts: Magento 2 : How to set the different product price to Storeview?

texts:
I have this Extension StoreViewPricing, you can set product price in store views, but in Layered Navigation when I'm applying price filter it's not showing proper results as expected. Here's the screenshot.

https://prnt.sc/peto54

I'm trying to set the product price in store views but It's showing below error. I've made the plugin for Magento\Catalog\Model\Layer class.

  di.xml

<type name="Magento\Catalog\Model\Layer">
        <plugin name="custom_product_model_layer" type="Vendor\Module\Plugin\Layer" />
    </type>

  Layer.php

<?php

use Magento\Framework\App\RequestInterface;

class Layer
{
    /**
     * @param \Magento\Catalog\Model\Layer $subject,
     * @param \Closure $proceed
     */
    public function aroundGetProductCollection(
        \Magento\Catalog\Model\Layer $subject,
        \Closure $proceed
    ) {
        //Get Object Manager Instance
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $request = $objectManager->get('\Magento\Framework\App\Request\Http');
        $result = $proceed();

        //Price Filter
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $productCollection= $objectManager->create('Magento\Catalog\Model\Product')->getCollection();
        $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
        $storeId = $storeManager->getStore()->getId();

        $joinConditions = 'u.entity_id = e.entity_id';
        $productCollection->getSelect()->join(
            ['u' => $productCollection->getTable('custom_view_pricing')],
            $joinConditions,
            ['*']
        )->where('u.store_id = '.$storeId);
        try {
            foreach ($productCollection as $customProducts) {
                $data = $customProducts->getData();
                foreach ($result->getData() as $resultProducts) {
                    $productId = $resultProducts['entity_id'];
                    if ($data['entity_id'] == $productId) {
                        $price = $data['price'];
                        $productFactory = $objectManager->get('\Magento\Catalog\Model\ProductFactory');
                        $product = $productFactory->create()->setStoreId($storeId)->load($productId);
                        $product->setData('price', $price);
                        $product->save();
                    }
                }
            }

        } catch (Exception $e) {
            $e->getMessage();
        }

        return $result;
    }
}

I've tried below code as well it's giving the same error as shown in the  image.

$product->setPrice($price);
$resultProducts['price'] = $price;
$product->setData('price', $price);

If anyone has a solution let me know.


texts: how to add custom field in order grid magento 1.9

texts: I want to add the custom field in  order grid page in Magento Backend.


texts: custom phtml code not working in cms home page

texts:
here is my code which i have used in cms home page and created phtml in app/design/frontend/theme/template/catalog/product/displayed.phtml

{{block type="catalog/product_displayed" name="product_displayed" as="product_displayed" template="catalog/product/displayed.phtml}}


texts: isSalable() / isAvailable returning unexpected result for bundle product

texts:
I've got a bundle product, which I'm loading as follows:

$product = Mage::getModel('catalog/product')->load($product_id);
if ($product->isSaleable()){
    echo "Is saleable!";
}
else{
    echo "Not saleable!";
}

P.S. isSalable() & isSaleable both refer to the same method.

I've double, tripple & quadruple checked and the product definitely is saleable. I've flushed every single cache & reindexed everything possible.

This method is still not returning the accurate result. Am I missing something?


texts: How do I change Magento search to bring up products no matter what order the search terms are in?

texts:
I have a problem with Magento search. The search terms have to be in the exact order the way they are listed in the title.

Example: If I search for "Big Green Truck" I get product results but if I search for "Green Big Truck" nothing comes up. There has to be an easy code fix for this. Please help, I am a new-bee

Thank you


texts: $productAttribute->getSource() is throwing an error in admin grid

texts:
The line $productAttribute->getSource() in app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php throws an error: Call to a member function getSource() on a non-object

This is the concerning function

foreach ($attributes as $attribute) {
    $productAttribute = $attribute->getProductAttribute();
    $productAttribute->getSource();
    $this->addColumn($productAttribute->getAttributeCode(), array(
        'header'    => $productAttribute->getFrontend()->getLabel(),
        'index'     => $productAttribute->getAttributeCode(),
        'type'      => $productAttribute->getSourceModel() ? 'options' : 'number',
        'options'   => $productAttribute->getSourceModel() ? $this->getOptions($attribute) : ''
    ));
}

I assume a certain attribute didn't get created and this is causing the issue. But how can I debug it, find out which attribute is causing the issue? I tried to var_dump $attributes and $productAttribute but that results in a blank page. Nothing in log files.

Thanks!


texts: Magento 2: remove the category image and description from the corresponding XML file

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

I need to eliminate the category image and description, more exactly the

 element from the category page.

The file to edit, if I am not wrong, is app/design/frontend/Company_Name/Theme_Name/Magento_Catalog/layout/catalog_category_view.xml.

What is the piece of code I have to edit in order to eliminate the category image and description?

Thank you!


texts: how to display product image in sales/order/view/ page

texts:
I am trying to customize sales order view page and I want to show product image in order view page how can we achieve this. and the path of the file  is

vendor\magento\module-sales\view\frontend\templates\order\items.phtml


texts: How to create an attribute within an attribute in magento?

texts:
I have a product that is about baby bedding set, customers can choose options.

First option is "FITS IN" and second one is "ITEM" however in every FITS In option I have different option of ITEMS and every ITEMS have different FITS in option. How to make product like that option with different options?


texts:
I am new to Magento 2. Need help to understand the concept of the knockout.js.

Why Magento 2 has used knockout.js?  I did try to understand it and did check this useful articles:

How knockout.js works

But still not getting anyhint why it has been implemented in Magento and what's the use of it?

Please help me to understand the concept of the knockout.js.


texts:
I need to set some url rewrites for different pages. But when I started my CLI script, I had some issue "Request Path for Specified Store already exists."
That's why I need to delete this url rewrite before. How can I do it programmatically.

Option to find this URL must be "Request Path", because ID of this url can be different on the test server and live site.

Please provide me, how can I do it.


texts: Magento2: Get attribute code & attribute details from attribute Id in magento2

texts:
Helllo All,

I want to retrieve attribute code and attribute details from attribute id. In magento1, I am doing it as:

$attrCode = Mage::getModel('eav/entity_attribute')->load($attributeId)->getAttributeCode();

How can we get this in magento 2.

Thanks in advance :)


texts: Module JS - Mismatched anonymous define module

texts:
I've tried adding my module JS file to Magento2 but for whatever reason it seems to return this error:

  Error: Mismatched anonymous define() module: function($)

My view/frontend file structure:

|-frontend
|-----layout
|---------default_head_blocks.xml
|-----requirejs-config.js
|-----templates
|---------helloworld.phtml
|-----web
|---------js
|-------------main.js

  requirejs-config.js

var config = {
    deps: [
        'js/main'
    ]
};

  web/js/main.js

define(
    ['jquery'],
    function($)
    {
        "use strict";
        console.log('hello world');
    }
);

  layout/default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="js/main.js" />
    </head>
</page>

What am I doing wrong in including my JS?


texts: custom attributes not saving in back end or importing unless certain option is set

texts:
I have programmatically created some custom product attributes as part of an import routine.  These have been assigned to an attribute set and they appear as expected in the admin alongside the appropriate products.  However, the values will not save either in the admin OR programmatically via a script.  That is, until I set "visible on product view page on front-end" to true.

Why should that make a difference?  Does setting that trigger some additional setting up of the attributes that I may have missed in the creation process? Once a value has been saved - I can switch off that option and it still works. Oddness.

Here is the function that is used to create the attributes

public function  newMagentoAttribute($name=null,$set=null,$sortOrder=null,$details=null,$productType="simple,grouped",$atttributeType="text"){
    /*with reference to code found here: http://pradeepkumarrcs.blogspot.co.uk/2011/12/creating-new-attribute-and-adding-to.html [jh]*/
    $attr_data = array(
                'attribute_code' => $name,
                'is_global' =>1,
                'frontend_input' => $atttributeType, //'boolean',
                'default_value_text' => '',
                'default_value_yesno' => '0',
                'default_value_date' => '',
                'default_value_textarea' => '',
                'is_unique' => '0',
                'is_required' => '0',
                'apply_to' => array($productType), //array('grouped')
                'is_configurable' => '0',
                'is_searchable' => '1',
                'is_visible_in_advanced_search' => '0',
                'is_comparable' => '0',
                'is_used_for_price_rules' => '0',
                'is_wysiwyg_enabled' => '0',
                'is_html_allowed_on_front' => '0',
                'is_visible_on_front' => '0',
                'used_in_product_listing' => '0',
                'used_for_sort_by' => '0',
                'frontend_label' => array($name)
            );
    $model = Mage::getModel('catalog/resource_eav_attribute');
    $model->addData($attr_data);
    $model->setEntityTypeId(Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId());
    $model->setIsUserDefined(1);
    if(is_numeric($sortOrder)){
        $model->setPosition($sortOrder);
    }
    try {
        $model->save();
        $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
        //-------------- add attribute to set
        $attribute_set_id=$setup->getAttributeSetId('catalog_product', $set);
       // $attribute_group_id=$setup->getAttributeGroupId('catalog_product', $attribute_set_id, $group_name);
        $attribute_id=$setup->getAttributeId('catalog_product', $name);
        $groupId = $this->createGroupInSet($attribute_set_id,"AE");
        $setup->addAttributeToSet('catalog_product',$attribute_set_id,$groupId, $attribute_id);

        $this->existingAttrs[$name] = "";
    } catch (Exception $e) {
        $this->echoOut( 'ERROR: Sorry, error occured while trying to save the attribute. Error: '.$e->getMessage() );
    }
}

Ideally I  am looking for a "what might be going on is..." or "it doesn't work because..." type answer here - I want to understand the process.  Maybe it is the simple act of editing the attribute in the admin that triggers something to be set somewhere that makes it "complete"?

* EDIT *
Turns out I do not even have to change any of the attribute settings - I just need to load it then save it the admin.  Ideas?

Thanks


texts: After Migration no route page content display on every product page

texts:
I have done migration from magento 1.9.3.1 to 2.1.3 by migration tool 2.1.3. Every things is working except one thing.

Every product page called first no-route page after product details is displayed. both page (404page + product detail )content display together , juts like this image.

There is in console i have seen first request is pass with product url like : "Network Error: 404 Not Found - http://localhost/georeef/lps-coral/fire-ice.html" , after that all request passed.

Anyone have the idea why happen this?


texts: Remove "You will be redirected to the PayPal website."

texts:
How can I remove this line?

It appears by default under the Paypal option in checkout form.


texts: Magento2 sign-in link move to the search box Near

texts:
How can i move account creation link and sign in link after the search box in header.

Need help.


texts: Display Payment Gateway result in Magento 2 Success Page

texts:
I just developed a Payment Gateway module and I'm finding it hard to display the success page. A brief of the transaction flow:

Customer selects the payment gateway and gets redirected to the payment gateway where payments is made. On redirecting back to the magento site, the payment gateway posts back the transaction id to the returnurl. The transaction is supposed to be used to query the payment gateway so as to get the transaction status and other details. My questions are:

I have been able to get the transaction id in a controller on the merchants site but I/m having difficulting in displaying the successpage and also querying the payment gateway with the transaction id, kindly assist

My code so far...

Block OnePage Controller to query payment gateway

class Success extends \Magento\Checkout\Block\Onepage\Success

public function scopeCon()
    {
        return \Magento\Store\Model\ScopeInterface::SCOPE_STORES;
    }

    public function getGatewayStatusUrl(){

        return $this->_scopeConfig->getValue('payment/payment-method/trxStatus_url', $this->scopeCon());

    }

    public function getTransactionStatus(){
        $this->_logger->info("I'm here");
        $url = $this->getGatewayStatusUrl();
        $tranxId = $this->_checkoutSession->getSessionId();

         -----make get request to payment gateway--------
         ------return json result----------
      }

frontend/template/payment/order/success/[html

/** @var $block \Vendor\Module\Block\Success */

            TRANSACTION RECEIPT
                <?php
                //if(isset($_POST['tranxId'])){
                    $result = $block->getTransactionStatus();
                    foreach($result as $key=>$row){
                        echo "
" . $key . "	" . $row . "
";
                    //}
                }
                ?>

frontend/layout/checkout_onepage_success.xml

<?xml version="1.0"?>

    <referenceContainer name="order.success.additional.info">
        <block class="Vendor\MyModule\Block\Success" name="order.success" template="Vendor_MyModule::order/success.phtml" after="-">
        </block>
    </referenceContainer>
    <referenceBlock/>


texts: Magento 2 Write to CSV within Controller

texts:
I have the following code:

protected $_fileSystem;
protected $_directoryList;

public function __construct(
    \Magento\Framework\Filesystem $fileSystem,
    \Magento\Framework\App\Filesystem\DirectoryList $directoryList
) {
    $this->_fileSystem = $fileSystem;
    $this->_directoryList = $directoryList;
    parent::__construct($context);
}

public function execute(){
    $this->writeToCSV();
}

private function writeToCSV(){

    try{
        $media = $this->_fileSystem->getDirectoryWrite($this->_directoryList::MEDIA);
        $media->writeFile('text.txt', 'test');
    }
    catch(Exception $e){
        echo($e->getMessage());
    }

}

However, this doesn't seem to be writing anything to the text file that exists within the same folder as the controller.


texts: Get product custom attribute in observer that listens to x specific event

texts:
Anyone know how to get product custom attribute in observer? In  my case event is controller_action_predispatch_checkout_cart_add.

My current code is giving me:

  Uncaught Error: Call to a member function getProduct() on null in

 $product = $this->productRepository->getById($observer->getItem()->getProduct()->getId());
        $attr = $product->getData('product_customattribute');

Also I tried this (same error):

 $product = $observer->getEvent()->getProduct();
   $attr = $product->getProduct()->getAttributeText('product_customattribute');

UPDATE

My module redirect after click add to cart (with adding to the cart)

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch_checkout_cart_add">
        <observer name="myvendor_mymodule_observer_redirect" instance="MyVendor\MyModule\Observer\Redirect" />
    </event>
</config>

and my Observer

<?php
namespace MyVendor\MyModule\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
//use Magento\Store\Model\StoreManager;
//use Magento\Framework\App\ObjectManager;

class Redirect implements  \Magento\Framework\Event\ObserverInterface
{
    /**
     * @var \Magento\Framework\App\ActionFlag
     */
    protected $actionFlag;

    /**
     * @var \Magento\Framework\App\Response\RedirectInterface
     */
    protected $redirect;
    protected $resultRedirect;

    public function __construct(
    //    \Magento\Framework\App\ActionFlag $actionFlag,
        \Magento\Framework\App\Response\RedirectInterface $redirect,
    //    StoreManager $storeManager,
        \Magento\Framework\Controller\ResultFactory $result,
        \Magento\Framework\App\ActionFlag $actionFlag
    )
    {
        $this->redirect = $redirect;
       // $this->actionFlag = $actionFlag;
        $this->resultRedirect = $result;
        $this->_actionFlag = $actionFlag;
      //  $this->storeManager = $storeManager;
    }
    public function execute(\Magento\Framework\Event\Observer $observer) {
        $controller = $observer->getControllerAction();
        $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
        $url = 'https://domain.com/url.html';
        $controller->getResponse()->setRedirect($url);
    }
}

I want change $url  with custom attribute.
I was able to get product data using catalog_product_save_after but redirect wasn't working. Maybe I could connect somehow this two observers.

UPDATE 2

On this event I get custom attribute

  checkout_cart_add_product_complete

 public function execute(\Magento\Framework\Event\Observer $observer) {
        $product = $observer->getProduct();
        $customAttribute = $product->getCustomAttribute('custom_attribute');
       $this->_logger->log(100,print_r( $customAttribute, true));
}

On this I get redirect after add to cart

  controller_action_predispatch_checkout_cart_add

    public function execute(\Magento\Framework\Event\Observer $observer) {
            $controller = $observer->getControllerAction();
            $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);
          $url = '/cart';  //should be custom_attribute

            $controller->getResponse()->setRedirect($url);
}

But I can get this values in one observer. I tried to connect them but not sure what should I use? Cache? register? to pass data from one observer to another.


texts:
If I observe customer_save_after event I can get information about the customer with $customer = $observer->getEvent()->getCustomer();.
However, if dispatching my custom event instead of customer_save_after I get
Error: Call to a member function getDataModel() on null

when I try to get it like $customerData = $customer->getDataModel();
I think this is because I can't even get getCustomer() in an custom event.
Is there anything I could do to get the same data as from customer_save_after?
Edit: custom dispatch
public function afterAddCustomer()
    {
        $this->eventManager->dispatch(
            'myname_customer_save_after',
            ['block' => $this]
        );
    }

Edit2: Changed the dispatcher but now I get
Error: Call to undefined method Vendor\Module\Plugin\Model\EventCompanyAccount::getDataModel()

I think getDataModel() method can be found in \Magento\Customer\Model\Data\AttributeMetadata.php but extending my class does not fix the error.


texts: magento : Your password reset link has expired

texts:
I have an issue when I click on the reset password link url :

I have four website in one magento platform  like : domain.com, domain.com/us/
domain.com/it/ domain.com/ca/

On my main site (domain.com) when I click on forgot password I get the email with reset password link . When I click on the reset password link I am successfully redirected to reset password url .

But when I follow same process with my other sites like domain.com/us , I am getting the forgot password email but when I click on the reset password link I am redirect on the Forgot password link (domain.com/us/customer/account/forgotpassword/) instead of reset password link and I am getting an error message stating "Your password reset link has expired".


texts:
So were using this third party catalog thing which I don't like much at all. I won't get into all the details of my disliking but for starters it runs in an iframe. Now if a customer is browsing inside this iframe and they find a product they like and attempt to add it to cart it ask's them to (standard behavior) login. Now a modal window login pops up and asks you to login but you're also still inside of the iframe.
After login (still in the iframe) your product is added to the cart and you're logged in but it doesn't show the item in the cart nor does it show that you're logged in because of this dumb iframe not capturing the sessions/caching. So now you close the iframe and are back on the site but you still don't see the item in your cart or that you are logged in until a page refresh or a click on any other link. Now it shows you that you are logged in and with the item you selected while inside the catalog iframe.
Option A:
Is there a way to fix this issue so once you login inside the iframe it shows you you're logged in inside the iframe?
Option B: If there is no way to show that you are logged in after logging in inside the iframe can we at least update the website when you close the iframe asynchronously or something so you don't have to refresh the page again or click through to another link?


texts: How to remove customer account validation in Magento2?

texts:
While creating an account , I want remove "email already exist validation" from CreatePost.php file

Path: \vendor\magento\module-customer\Controller\Account\createpost.php


texts:
I am using some translation packages from Packagist (magento2translations/*) and I have some translation files in my theme at app/design/frontend/Mytheme/mytheme/i18n. On the PHP side, they all work flawlessly. But in client-side code, the translations aren't working at all.

I tracked the problem down to the generated js-translation.json files. They are all empty (i.e. the only contain an empty array "[]").

I found some people having the same problem here and on GitHub and some (very different) solutions, but none of them have worked for me. Every time I run bin/magento setup:static-content:deploy <locale>, the deployed JSON file is still empty.

Edit: the js-translation.json is only populated in languages that I have language packages installed for, but not for languages I translated in app/design/frontend/Omv/omv/i18n.

Also, the translations from app/design/frontend/Omv/omv/i18n aren't present in js-translation.json - not even for languages I have a language pack for. Is this intended or a bug?

Edit 2: The js-translation.json files are not empty in my local development environment. I have no idea why.