texts: Random Session Drop/Redirect Homepage on Final Payline Checkout Magento 1

texts:
We recently ran into a very difficult bug to diagnose.  A customer will browse the website, add items to their cart, go to the checkout, and select Payline credit card.  When they press the final "Place Order" button on the onepage checkout screen, they will get directed to "GET /payline/index/cpt/", but then randomly get redirected to the homepage.  Their entire session will be lost and they will need to completely redo the checkout process again.  We thought it was an issue with the Payline checkout screen so we setup a ton of debugging in the payline script itself, but found out that the module is never hit when the redirect is triggered.  The main observer is not loaded from what we can tell.  The user just gets redirected to the homepage and their cart/session is lost).

The redirect SHOULD go to the Payline secure online checkout screen (similar to PayPal).

All the items we have checked:

Session Validation Disabled
Form key disabled
Disabled optimization on the onepage checkout
No discernible pattern of browsers: Chrome/Firefox on Mobile/Desktop/Tablets, on Laptops/tablets/mobile phones.
No errors in any of the Magento logs (exception/system) nor in any of the webserver logs.

The question would be what steps should we try to trace the calls to the module.  Any other suggestions as to what else the issue might be?


texts: How to create a custom Adminhtml controller

texts:
I'm just trying to create a simple adminhtml controller.

#config.xml:

<?xml version="1.0"?>
<config>
<modules>
    <AD_CustomShipping>
        <version>0.1.0</version>
    </AD_CustomShipping>
</modules>

<global>
    <blocks>
        <AD_CustomShipping>
            <class>AD_CustomShipping_Block</class>
        </AD_CustomShipping>
    </blocks>

    <helpers>
        <AD_CustomShipping>
            <class>AD_CustomShipping_Helper</class>
        </AD_CustomShipping>
    </helpers>
</global>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <AD_CustomShipping after="Mage_Adminhtml">AD_CustomShipping</AD_CustomShipping>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
</config>

This is the controller:

#app/code/local/AD/CustomShipping/controllers/CustomShippingController.php
 /**
 * Class AD_Customshipping_CustomShippingController
 */
 class AD_CustomShipping_CustomShippingController extends Mage_Adminhtml_Controller_Action
 {
    /**
     * Return some checking result
     *
     * @return void
     */
     public function checkAction()
     {
         $result = 1;
         Mage::app()->getResponse()->setBody( $result );
     }
}

When I try to reach the URL https://example.com/adminpanel/customshipping/check/key/6df9ce54d9c315cbdf9484dc54dfcd678/ it shows me 404 Error.

What am doing wrong?


texts:
How to remove the line below

in Magento_SalesRule/cart/totals/discount.html

var config = {
    'config': {
        'mixins': {
            'Magento_SalesRule/js/view/cart/totals/discount': {
                'XXX_YYY/js/view/cart/totals/discount': true

            },
        }}};

define([
    'Magento_Checkout/js/view/summary/abstract-total',
    'Magento_Checkout/js/model/quote'
], function (Component, quote) {
    'use strict';alert("cart");

    return function (target) {
        return target.extend({
            defaults: {
                template: 'XXX_YYY/cart/totals/discount'
            }});
    }
});

And remove the line in this template, But I can not get the template in UI


texts: Magento: frontend user login not working till 24 hours

texts:
A newly registered user is not able to log in to Magento site. Magento version is 1.9.4. I tried many methods but none of them works.

Initially, the store has version 1.9.1 but it was upgraded to 1.9.4 and everything works for around 8-10 months. Now the newly registered user is not able to log in. All old user those have registered 24 hours before from current time are able to login. I don't understand what is the problem

Tests

1) Registered a user with some dummy credentials. Then go to PHPMyAdmin in customer_entity table and changed the created_date to a day before. It works, but I don't understand why?

2) My site is running with https and www. So I changed the cookie domain to

i) .www.example.com
ii) www.example.com
iii) .example.com
iV) example.com

None of them is working.

3) Tried after changing the timezone, nothing happens

4) Checked out the code and seems to be OK.

5) Taken help from more developers but they are also not able to find a solution.

Now I am helpless issue got more than 1 week and I do not know what should I do now. It will be great full if someone can help me out


texts: Promotion Conditions Combination possible?

texts:
I'm pretty new in the world of SE and indeed Magento so please do let me know if I need to re-format my question or add more information.

I'm trying to create a promotion where if a customer adds multiples of 3 different products to the cart and applies a specific coupon code, they get a set amount discount per set of 3 products.

For example:-

Customer added 1 x product1, 1 x product2 and 1 x product3 to the
cart they would receive a discount of £6 after entering the code.
Customer added 2 x product1, 2 x product2 and 2 x product3 to the
cart they would receive a discount of £12 after entering the code.
Customer added 2 x product1, 2 x product2 and 1 x product3 to the
cart they would receive £6 discount after entering the code.

Each set of 3 must consist of one of each product.

So my question is, is it possible to implement this rule within the Shopping Cart Price Rules in Magento Admin or does it need to be applied programmatically?

Thank you in advance


texts: product not saving after upgrading to Magento 2.3

texts:
Recently I upgraded My Magento 2.2.6 to 2.3, After upgrading I configured Multi Source Inventory, It is working as expected while creating new products (and products created after upgradation). But it is throwing error while updating old products (which were created before upgrading to 2.3).

Below error is thrown by system while saving old products-

  The stock item was unable to be saved. Please try again.

In exception.log there is below log for the error-

  main.CRITICAL: The stock item was unable to be saved. Please try
  again. {"exception":"[object]
  (Magento\Framework\Exception\CouldNotSaveException(code: 0): The
  stock item was unable to be saved. Please try again. at
  /magento_root/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187,
  Magento\\Framework\\Exception\\CouldNotSaveException(code: 0): Could
  not save Source Item at
  /magento_root/vendor/magento/module-inventory/Model/SourceItem/Command/Handler/SourceItemsSaveHandler.php:78,
  Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity
  constraint violation: 1452 Cannot add or update a child row: a foreign
  key constraint fails (magento_db.inventory_source_item, CONSTRAINT
  INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
  FOREIGN KEY (source_code) REFERENCES inventory_source
  (source_code) ON DEL), query was: INSERT INTO inventory_source_item
  (source_code, sku, quantity, status) VALUES (?, ?, ?, ?) ON
  DUPLICATE KEY UPDATE quantity = VALUES(quantity), status =
  VALUES(status) at
  /magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235,
  PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint
  violation: 1452 Cannot add or update a child row: a foreign key
  constraint fails (magento_root.inventory_source_item, CONSTRAINT
  INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
  FOREIGN KEY (source_code) REFERENCES inventory_source
  (source_code) ON DEL) at
  /magento_root/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"}
  []

Does anyone have idea about this issue?


texts:
When i try to access

  https://www.example.com/index.php/api/v2_soap/index/

It always gives

<SOAP-ENV:Envelope xmlns:SOAP-
   ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
     <SOAP-ENV:Fault>
       <faultcode>Sender</faultcode>
       <faultstring>Invalid XML</faultstring>
     </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

but

  https://www.example.com/index.php/api/v2_soap?wsdl=1

gives right output. Don't know .Please help me out. Thanks in Advance.


texts: Checkout Error magento 1.9, can't continue to shipping information

texts:
I know there are multiple topics concerning this subject but I can't get my error fixed. I was on magento 1.8, everything was working great but suddenly I got the problem that in the checkout module, I can't continue to Shipping Information.
Continue just doesn't do anything. Unless (and now the fun part starts) I use Ship to Different adress (bottom option). Then it DOES continue. I have upgraded to 1.9 but same problem. I can't find any errors (not in the log, in magento or apache and not in the JS, f12 in chrome), it works using the default template but my template only has the files in the checkout folder:

success.phtml
cart.phtml
onepage/login.phtml
multishipping/success.phtml
multishipping/shipping.phtml
multishipping/overview.phtml
multishipping/billing.phtml

cart/some irrelevent files i guess

My template realy doesn't do that much i recon!

I know this isn't a really high quality post but is there anyone who can point me in the right direction?


texts: Magento 2 Delta Migration : Delta Delivering Failed Give Error

texts:
When we perform delta migration then give the following error. For more information check the below screenshot.

  [ERROR]: Deltalog for catalog_category_entity is not installed


texts: Add event listeners to content of a custom tab

texts:
I've tried many things but it always gives an error because the element isn't loaded yet.

Jquery I've tried last:

$('#draggable-holder').on('mousedown', '.dxy', function() {
  //do something
});

How I render the content:

$output = "";

$children = Mage::getModel('catalog/category')->getCategories($categoryId);

$output .= "
";
foreach ($children as $category) {
    $output .= "
" . $category->getName() . "
";
    $output .= "
";
}
$output .= "
";

return $output;

So I'm tryig to add the mousedown event to the class dxy.
Any suggestions?


texts:
Fatal error: Call to a member function setEmailValue() on boolean in
  /home/babyesse/public_html/app/code/core/Mage/Customer/controllers/AccountController.php
  on line 703

hi am getting this error when the customer are trying to reset their password in magento ver Magento ver. 1.9.0.1

basically it will not event redirect them to the reset account form...
below is the line 703 in the AccountController.php

i followed the error path and can't figure out what is wrong there

public function forgotPasswordAction()
{
    $this->loadLayout();

    $this->getLayout()->getBlock('forgotPassword')->setEmailValue(
        $this->_getSession()->getForgottenEmail()
    );
    $this->_getSession()->unsForgottenEmail();

    $this->_initLayoutMessages('customer/session');
    $this->renderLayout();
}

i am new to magento please help how can i fix it ?


texts: Magento 2 Country Name not get translated when using countryFactory

texts:
My Magento site have about 10 different websites and one for each country. I have set the correct Locale corresponding to each country (storeview).

I'm getting Country Name by using countryFactory, the problem is, when switching Storeview, it doesn't get me the country name translated according to the Locale i configured in the admin.

public function __construct(
        \Magento\Directory\Model\CountryFactory $countryFactory
    )
    {
        $this->countryFactory = $countryFactory;
    }

    public function getCountryName($code)
    {
        $_country = $this->countryFactory->create()->loadByCode($code);
        if($_country)
        {
            return $_country->getName();
        }

        return false;
    }

How do I get country name translated when switching the storeview?


texts: Cannot delete var/cache folder magento 2

texts:
Hi for some reason I cannot delete the var/cache folder. Because of it I cannot switch between production > developer mode.
When I do get the following:

  "The directory "fullurl/var/cache/" cannot be deleted Warning!rmdir(fullurl/var/cache/): Device or resource busy

I tried commands:

umount /var/cache > not permitted

rm -rf var/cache/ > Device or Resource busy.


texts: How to set Direction RTL for PDF invoices Magento 2?

texts:
I'm using Magento v2.1.3 with two languages. The default language is English and the other one is Arabic. Everything is working properly in frontend for the Arabic Language. In the backend, I'm trying to print the invoice in the Arabic language with direction Right to left. But I'm not getting the way to change the Direction for PDF invoice to RTL. Can you please help me to change the direction for the Arabic language?

Thanks in advance...!


texts:
I want to know if there are some best practices to use Magento 2 as a headless E-commerce solution.

A typical E-commerce in 2017 is to have an omni-channel solution which includes

E-commerce
CMS
Multiplatform
Tier system integration (ERP, ...)

I want to know how involve Magento 2 API with this kind of solution.

My approach:

Use a different frontend framework (such as angular) for
desktop/mobile webapp and mobile app
Only use Magento 2 API in order to retrieve or interact with
E-commerce data/action
Only use CMS API in order to retrieve CMS data.

Pro: Only API's, omnichannel

Cons: Limitation for performance/features/formatting

Some questions for this approach :

Who is responsible for formatting data, for example prices. Magento API
and frontend framework?
Who is responsible for resizing product images and cache them? Because in the native Magento 2 API there is no resize or cache system.
Do I need to create new custom isolated API or extend native for
future upgrade purpose?
Do you recommend to use an extra layer in order to combine CMS and
Magento API?

I appreciate you to share your return in experience.

Moreover, I found this approach: http://fbrnc.net/blog/2015/10/super-scaling-magento

Usefull links :

https://blogi.lamia.fi/verkkokaupat/headless-ecommerce/
http://www.magetitans.it/headless-new-buzzword-magento-2-sander-mangel/
https://www.youtube.com/watch?v=6OuzAtqtWRE
https://pantheon.io/blog/headless-websites-whats-big-deal-decoupled-architecture
http://buytaert.net/the-future-of-decoupled-drupal
https://creately.com/diagram/example-v2/ihbyjjkf/Example%20Headless%20Architecture
https://www.lullabot.com/articles/should-you-decouple
https://alankent.me/2016/12/14/headless-magento-and-extensions/

EDIT :

I found a good bootstrap in order to create your own cache logic for your Magento 2 API :
https://github.com/magespecialist/m2-MSP_APIEnhancer

EDIT :
A nice open source project in order to use Magento 2 as a headless E-commerce with VueJS PWA : https://github.com/DivanteLtd/vue-storefront

EDIT :
The official Magento 2 PWA tools based on React : https://github.com/magento-research/pwa-studio


texts: Product page and category page disappeared

texts:
Developed on developer mode and everything is OK, just set production mode, home page and admin panel is OK but category page completely disappeared and shows a blank page and also product page is gone and just shows description title.
what should I do? use Magento 2.1.


texts: Magento 2.2.6: Programatically updating product custom options

texts:
I am working on custom script to update product custom options.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface')->get($sku,true);
$customOptions = $objectManager->get('Magento\Catalog\Model\Product\Option')->getProductOptionCollection($_product);
if(isset($customOptions) && !empty($customOptions)){
    foreach($customOptions as $customOption):
        if($customOption->getTitle()=='Custom'){
            $customOption->delete();
        }
    endforeach;
}
$_product->save();

When We save product to update it shows error below error -

PHP Fatal error:  Uncaught Magento\Framework\Exception\NoSuchEntityException: No such entity. in /home/dermpro/m2-customer3.dermpro.com/vendor/magento/module-catalog/Model/Product/Option/Repository.php:170
Stack trace:
#0 /home/dermpro/m2-customer3.dermpro.com/vendor/magento/module-catalog/Model/Product/Option/SaveHandler.php(56): Magento\Catalog\Model\Product\Option\Repository->save(Object(Magento\Catalog\Model\Product\Option))
#1 /home/dermpro/m2-customer3.dermpro.com/vendor/magento/framework/EntityManager/Operation/Update/UpdateExtensions.php(49): Magento\Catalog\Model\Product\Option\SaveHandler->execute(Object(Magento\Catalog\Model\Product\Interceptor), Array)
#2 /home/dermpro/m2-customer3.dermpro.com/vendor/magento/framework/EntityManager/Operation/Update.php(109): Magento\Framework\EntityManager\Operation\Update\UpdateExtensions->execute(Object(Magento\Catalog\Model\Product\Interceptor), Array)
#3 /home/dermpro/m2-customer3.dermpro.com/vendor/magento/framework/EntityManager/EntityManager.php(96): Magento\Framework\Entity in /home/dermpro/m2-customer3.dermpro.com/vendor/magento/module-catalog/Model/Product/Option/Repository.php on line 170

Any one go through this type of issue?


texts: Convert value to array label throughout frontend and admin?

texts:
So i have a form that saves customer vehicle info in the database with values representing each vehicle.

I also have this array code in my model folder which should be used to display said numbers as names;

class Maker_Modelname_Model_Options_Vehicle_Make
{
public function toOptionArray()
{
     $vmake = array(
        array('value' => 1, 'label' => Mage::helper('vehicle')->__('Alfa Romeo')),
        array('value' => 2, 'label' => Mage::helper('vehicle')->__('AMC')),
        array('value' => 3, 'label' => Mage::helper('vehicle')->__('Aston Martin')),
        array('value' => 4, 'label' => Mage::helper('vehicle')->__('Audi')),
        array('value' => 5, 'label' => Mage::helper('vehicle')->__('Austin')),
        array('value' => 6, 'label' => Mage::helper('vehicle')->__('BMW')),
        array('value' => 7, 'label' => Mage::helper('vehicle')->__('Buick')),
        array('value' => 8, 'label' => Mage::helper('vehicle')->__('Cadillac')),
        array('value' => 9, 'label' => Mage::helper('vehicle')->__('Chevrolet')),
        array('value' => 10, 'label' => Mage::helper('vehicle')->__('Chrysler')),
        array('value' => 11, 'label' => Mage::helper('vehicle')->__('Citroen')),
        array('value' => 12, 'label' => Mage::helper('vehicle')->__('Daihatsu')),
        array('value' => 13, 'label' => Mage::helper('vehicle')->__('Dodge')),
        array('value' => 14, 'label' => Mage::helper('vehicle')->__('Ferrari')),

    );
return $vmake;
}
}

i modified the order view in the admin panel to display the customer vehicle info. I used this code to display it, but its outputs the word "array" which means its not reading the array properly.

<?php $vmake = Mage::getModel('vehicle/options_vehicle_make')
                                    ->toOptionArray(); echo $vmake[$this->htmlEscape($_order->getVehicleMake())] ?>

but i need the model array to convert the values to labels.

Can someone tell me how to do this?


texts: Not working to upgrade a custom module CMS page

texts:
I followed this guide to register my custom module as a CMS page using the UpgradeDataInterface

For some reason, the version it uploaded was an older one (cached or something maybe?) so I tried deleting it from the content > pages menu. Now, I can't seem to be able to register it again. I have tried using UpgradeData and changing the version on my Module.xml (as per the guide above), and also used the InstallDataInterface via this guide.

I am using the php bin/magento setup:upgrade function and not seeing any results. Could this be a cacheing issue? Any idea on what steps to try to fix?


texts: How to call a function from a custom module on checkout page in magento 2

texts:
Guys I'm learning how to create modules in magento 2, and I have a doubt, how do I call a function that is in my controller in magento 2 ?.
In the controller I defined a function that does one thing, but I need to call that function on the checkout page, how can I proceed?


texts:
I would like to use Google Customer Reviews on my webshop, and I have received a snipplet that I am to insert on my succes page.

The snipplet is here:

<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>

<script>
  window.renderOptIn = function() {
    window.gapi.load('surveyoptin', function() {
      window.gapi.surveyoptin.render(
        {
          "merchant_id": XXXXXXXXX,
          "order_id": "ORDER_ID",
          "email": "CUSTOMER_EMAIL",
          "delivery_country": "COUNTRY_CODE",
          "estimated_delivery_date": "YYYY-MM-DD"
        });
    });
  }
</script>

But I dont know which values to put in these fields:

      "order_id": "ORDER_ID",
      "email": "CUSTOMER_EMAIL",
      "delivery_country": "COUNTRY_CODE",
      "estimated_delivery_date": "YYYY-MM-DD"

Can you help me?


texts: How can i add multiple shipping and billing addresses in Magento2

texts:
In magento REST API - I am getting only one shipping and billing addresses. but I want to add more than one shipping and billing addresses. Is there any way to do so?

And I want to all the list of addresses of user can I get using REST API?


texts:
I have the following in requirejs-config.js

var config = {
    "map": {
        "*": {
            "jquery/easing": "./js/jquery.easing.1.3",
            "jquery/mobile/customized": "./js/jquery.mobile.customized.min",
            "camera": "./js/camera.min"
        }
    },
    "shim": {
        "jquery/easing": ['jquery'],
        "jquery/mobile/customized": ['jquery'],
        "camera": ['jquery', 'jquery/easing', 'jquery/mobile/customized']
        }
    }
};

And the following code in a Block:

require(['jquery', 'jquery/easing', 'jquery/mobile/customized', 'camera'], function(jQuery) {
    console.log('test');
});

The js files are loaded, but the callback function never gets called.
Do I need to do further modifications to the js files to be compatible with RequireJs?


texts: Add Top Links on condition basis in magento

texts:
I am little bit stuck with adding top links in my custom phtml. I removed the links block in my XML <remove name="top.links"/>, now after some condition become true, I want to add this block again. When I use this code for top menu it works but not for links :

$block = Mage::getSingleton('core/layout');
echo $block->createBlock('catalog/navigation')->setTemplate('catalog/navigation/top.phtml')->toHtml();

This works and display top menu. But the below code doesn't show anything.

$block = Mage::getSingleton('core/layout');
echo $block->createBlock('page/template_links')->setTemplate('page/template/links.phtml')->toHtml();

Any help?


texts: Override Magento Class Community Code Pool

texts:
I need to add two methods in two separate Mage/core models. I'm trying to create my own methods in the local code pool, but without any success.

I'm sure the problem lies in my XML file (can't find any reference documentation). The core Mage files reside here:

app->code->core->Mage->Customer->Model->Address->Abstract.php
app->code->core->Mage->Customer->Model->Resource->Customer.php

My own files reside here:

app->code->local->Jongosi->Base->Model->Address->Abstract.php
app->code->local->Jongosi->Base->Model->Resource->Customer.php

My config.xml file looks like this:

<config>
    <global>
        <models>
            <customer>
                <address>
                    <rewrite>
                        <abstract>Jongosi_Base_Model_Address_Abstract</abstract>
                    </rewrite>
                </address>
            </customer>
        </models>
        <models>
            <customer>
                <resource>
                    <rewrite>
                        <customer>Jongosi_Base_Model_Resource_Customer</customer>
                    </rewrite>
                </resource>
            </customer>
        </models>
    </global>
</config>

Could anyone tell me what I'm doing wrong please?


texts:
I'd like to have a (if possible) free magento 2 extension to deal with EU Cookie Compliance (RGPD).

This module must allow the user to customize it's cookies.

Which one would you recommand ?


texts: How to set List Mode(backend configuration) programmatically for category page magento 2?

texts:
Actually i want to set list/grid mode(List Mode) configuration values
  for category page programmatically not from magento admin backend.if
  anyone have any idea please guide me.


texts: Unable to Patch SUPEE 5344 on v 1.12.0.2

texts:
I have a website using Magento v1.12.0.2 and it does not have shoplift patched yet. I want to apply the patch SUPEE-5344 but I'm unable to patch it successfully.

Without SUPEE-5344, patches SUPEE-6788 and SUPEE-7405 are not being recognized by the Magento checker service.

Have any of you guys faced similar problem in past and provide and helpful info?


texts: Missing Account Links in Mobile Menu Magento 2

texts:
I am not getting how the contents of my account links are not displaying when viewed as mobile format. You can see in the image there is no links under account tab.
I'm using porto theme

    <referenceContainer name="after.body.start">
        <block class="Magento\Newsletter\Block\Subscribe" name="porto_newsletter_popup" template="subscribe_popup.phtml" before="-"/>
        <block class="Smartwave\Porto\Block\Template" name="porto_custom_notice" template="html/custom_notice.phtml" after="-"/>
        <block class="Smartwave\Porto\Block\Template" name="porto_sidebar_sticky" template="html/sidebar_sticky.phtml" after="-"/>
    </referenceContainer>

    <referenceContainer name="page.wrapper">

        <block class="Smartwave\Porto\Block\Template" name="porto_header" template="html/header.phtml" before="main.content">
            <block class="Magento\Framework\View\Element\Html\Links" name="header.links">

                <arguments>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
            </block>

            <block class="Smartwave\Porto\Block\Form\Login" name="header_customer_form_login" ifconfig="porto_settings/header/login_popup" template="Smartwave_Porto::html/login.phtml"/>

            <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/>

            <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" />

            <block class="Smartwave\Porto\Block\Template" name="custom_block" template="html/header_custom_block.phtml" ifconfig="porto_settings/header/static_block" after="-"/>

             <block class="Smartwave\Porto\Block\Template" name="header_login" template="Smartwave_Porto::html/headerlogin.phtml"/>
        </block>

    </referenceContainer>
    <move element="navigation.sections" destination="porto_header"/>
    <move element="top.search" destination="porto_header"/>
    <move element="minicart" destination="porto_header"/>
    <move element="currency" destination="porto_header"/>
    <move element="logo" destination="porto_header"/>
    <move element="skip_to_content" destination="porto_header"/>

    <move element="page.top" destination="page.wrapper" after="porto_header"/>

    <referenceContainer name="header.container" remove="1"/>
    <referenceContainer name="header.panel" remove="1"/>
    <referenceContainer name="header-wrapper" remove="1"/>

    <referenceContainer name="footer-container">
        <block class="Smartwave\Porto\Block\Template" name="footer_block" template="html/footer.phtml">
            <block class="Magento\Store\Block\Switcher" name="footer.store_switcher" template="switch/stores.phtml"/>
            <block class="Magento\Newsletter\Block\Subscribe" name="footer.newsletter" template="subscribe_footer.phtml"/>
        </block>
    </referenceContainer>

    <referenceBlock name="header.links">
        <block class="Smartwave\Porto\Block\Template" name="custom_link" before="-" template="html/custom_link.phtml" />
    </referenceBlock>

Js

$('.panel.header.header.links').clone().appendTo('#store\.links'); });


texts:
i'm trying to apply supee-11086 patch and getting following error:

    Checking if patch can be applied/reverted successfully...
-e ERROR: Patch can't be applied/reverted successfully.

patching file app/Mage.php
patching file app/code/core/Mage/Admin/Model/Session.php
patching file app/code/core/Mage/Adminhtml/Block/Api/Buttons.php
patching file app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
patching file app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php
patching file app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php
patching file app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php
patching file app/code/core/Mage/Adminhtml/Controller/Action.php
patching file app/code/core/Mage/Adminhtml/Helper/Data.php
patching file app/code/core/Mage/Adminhtml/Model/Email/PathValidator.php
patching file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php
Hunk #1 FAILED at 69.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php.rej
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Gatewayurl.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Protected.php

Magento version 1.9.3.8. I already try download clean 1.9.3.8 and replace this file, but nothing changed. How can i solve it?


texts: Dropdown for add to cart qty in Magento 2

texts:
Rather than having input box, I would like to place dropdown for product qty to add to cart. So to do this, I've done the following:

In my

  \app\design\frontend\Vendor\Theme\Magento_Catalog\templates\product\view\addtocart.phtml

I've replaced following code instead of input box.

<select name="qty" id="qty" title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
       class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>">
       <?php $i = 1 ; ?>
        <?php
         while( $i < 5) { ?>
            <option value="<?php echo $block->getProductDefaultQty() * $i; ?>"><?php echo $block->getProductDefaultQty() * $i; ?></option>
            <?php $i++; ?>
         <?php } ?>
</select>
<button type="submit"
    title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>"
    class="btn btn-orange"
    id="product-addtocart-button">
    <?php /* @escapeNotVerified */ echo $buttonTitle ?>
</button>

But it's not adding the product into the cart.

Can anyone help me to build dropbox instead of textbox for adding product to the cart?


texts: Removing log in/sign up account in my shop

texts:
I have noticed that many customers in my online store get to checkout and then are asked to sign in/create an account. They then leave the website. How can I make it easier for them? Is it possible to remove the sign in/register option so they can go straight to the payment gateway?

I am using magento version 1.7.0.2


texts: Magento 2 get keys values in rest api response

texts:
{
        "item_id": 191111111,
        "sku": "qqqqqqq",
        "qty": 1,
        "name":"asdasd",
        "price": 736.52,
        "product_type": "simple",
        "quote_id": "1111",
        "product_option": {
            "extension_attributes": {
                "custom_options": [
                    {
                        "option_id": "1111",
                        "option_value": "12131111111089"
                    }
                ]
            }
        }
    }

i want to get the option_id and vales from it Anyone can help?


texts: Magento 2.3 How to show Out of Stock Products only in Search?

texts:
My site is supposed to show out of stock products in some places in the catalogue, so the Catalog > Inventory > Display Out of Stock Products setting is set to "Yes."
But I do not want out of stock products to show up in the search. Before upgrading to M2.3, we accomplished this by overriding \Magento\CatalogInventory\Model\Plugin\Layer's  beforePrepareProductCollection() function:
 public function beforePrepareProductCollection(
        \Magento\Catalog\Model\Layer $subject,
        \Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection $collection
    ) {

        $_category = $subject->getCurrentCategory();
        if (is_object($_category) and in_array($_category->getId(), array(161, 184)))// don't apply to Recently Sold, Our Archive categories
        {
            return;
        }

        parent::beforePrepareProductCollection($subject, $collection);
        $stockFlag = 'has_stock_status_filter';
        if (!$collection->hasFlag($stockFlag)) {
            $resource = $this->getStockStatusResource();
            $resource->addStockDataToCollection(
                $collection,
                true // force
            );
            $collection->setFlag($stockFlag, true);
        }
    }

    protected function getStockStatusResource()
    {
        if (empty($this->stockStatusResource)) {
            $this->stockStatusResource = $this->stockStatusFactory->create();
        }
        return $this->stockStatusResource;
    }

Now that Layer.php is gone in Magento 2.3, I don't know where to start with trying to hide out of stock products in search. I thought maybe I could use Magento\CatalogInventory\Model\Plugin\ProductSearch, but that isn't used at all as far as I can tell.


texts: Removing modules from vendor magento 2.3

texts:
I'm trying to remove a few modules located inside the vendor folder. If i remove them manually it throws an error on the frontend.

Warning: require(/srv/public_html/vendor/composer/../amzn/amazon-pay-and-login-with-amazon-core-module/registration.php): failed to open stream: No such file or directory in /srv/public_html/vendor/composer/autoload_real.php on line 70

Fatal error: require(): Failed opening required '/srv/public_html/vendor/composer/../amzn/amazon-pay-and-login-with-amazon-core-module/registration.php' (include_path='/srv/public_html/vendor/magento/zendframework1/library:.:/usr/local/lib/php') in /srv/public_html/vendor/composer/autoload_real.php on line 70

Additionally, if I try to remove it using composer (which i thought all modules in vendor were composer installed) i get an error in terminal.

composer remove Amazon/Amazon_Core
amazon/amazon_core is not required in your composer.json and has not been removed
Package "amazon/amazon_core" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package amasty/shopby-root is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files

The module/modules i'm trying to remove are the Amazon modules show above in the command line output.

Any help would be greatly appreciated. Thank you.


texts: Magento 2 - Multiple stores with different root category

texts:
I have created two stores as below:
Store A: Root Category = Category A
Store B: Root Category = Category B

And I added the "Catelog Product List" widget in homepage. When I switch the store to store A, it shows all the products with category A and B. I cannot find any other way to configure the filter in the admin panel. Can anyone suggest how to display different category products in different stores?


texts: Magento use simple product images for configurable products

texts:
Is it possible to make magento use the image of a simple attached product on configurable products if one exists?

Aka, chose a red bike from the config options and the red image loads, however if no image is attached for the red bike, then show default configurable image


texts:
I'm having kinda serious issue with CSV product import.
When I'm trying to import only one product from CSV (for testing reasons)
I get following error:

  SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
  update a child row: a foreign key constraint fails
  (admin_knygynas.catalog_product_entity_media_gallery, CONSTRAINT
  FK_CAT_PRD_ENTT_MDA_GLR_ATTR_ID_EAV_ATTR_ATTR_ID FOREIGN KEY
  (attribute_id) REFERENCES eav_attribute (attribute_id) ), query
  was: INSERT INTO catalog_product_entity_media_gallery
  (attribute_id,entity_id,value) VALUES (?, ?, ?) ON DUPLICATE KEY
  UPDATE entity_id = VALUES(entity_id)

Got this issue first time, searched where I can, but no solutions so far, sitting on this one for hours. I see that it tries to insert VALUES(?,?,?) into product media gallery entity, and it doesn't make any sense.

I exported CSV from Magento 1.7.2 version, and trying to import to 1.9.2. But i was reading somewhere that it doesn't make any difference.
I did all the steps. Created missing attributes, imported categories with another module so everything there should be fine.


texts: How to show tier price in Magento 2 catalog listing page

texts:
Tier price is working fine on the product page, but when we try to show on the listing page then it's not working.

<?php /* @escapeNotVerified */ echo ($block->getShowDetailedPrice() !== false)
                        ? __(
                            'Buy %1 for %2 each and save&nbsp;%4%',
                            $price['price_qty'],
                            $priceAmountBlock,
                            $index,
                            $tierPriceModel->getSavePercent($price['price'])
                        )
                        : __('Buy %1 for %2 each', $price['price_qty'], $priceAmountBlock);
                ?>

Can anyone help me?


texts: Cloned Prod Web & Database Server to create staging, what next?

texts:
I am trying to correctly setup a Staging environment. I cloned both my Production Web Server and Production Database Server to replicate both in a Staging setting with their own separate droplets (virtual servers), but now I am lost.

How do I get the Staging Web server (right now is identical to prod) to look at the Staging Database server (also is identical to prod)?

Any other changes I need to make to them?

Apologies I am very new to DBA & Magento.


texts: Magento2 - How to get order id in 'sales_order_invoice_pay' observer?

texts:
Here I want to generate a Custom Invoice with Custom data and format right after default invoice generation.

So I have added an observer sales_order_invoice_pay. here I want to get Order Id but I have no idea how can I get order id in this observer.

$order = $observer->getEvent()->getOrder();
$orderId = $order->getId(); //returning NULL

$order = $observer->getEvent()->getOrder();
$incrementId = $order->getIncrementId();//returning NULL

How can I get order id in this observer?

Thanks in Advance.


texts:
I'm trying to upgrade my magento store(2.1.9 to 2.3) trough ssh using composer but i'm getting this error(multiple times):

  magento/framework 100.1.9 requires zendframework/zend-stdlib ~2.4.6 ->
  satisfiable by zendframework/zend-stdlib[2.4.13, 2.4.1
  0, 2.4.11, 2.4.12, 2.4.6, 2.4.7, 2.4.8, 2.4.9].

what can i do to solve it? :(


texts: Issues in loading and saving Customer addresses where customer is linked to many addresses (200+)

texts: My customer has 200+ addresses, the page takes a long time to respond(this is one issue),and other is when I try to save some changes,I am getting error as shown in pic.If customer has few addresses, it is (loading, saving) is working fine.I am unable to trace any thing about long time to respond and issue on Save for large no of addresses, any help, guide will be appreciated. Thanks in advance.


texts: I want to set the shipping method to each cart to free shipping without choosing the shipping method, so when customer doing checkout, the shipping method will set by default to free shipping without choosing it. How can i do it?


texts: Magento migration from localhost to cloud - Admin login not working

texts:
After migrating from a localhost magento instance to  a cloud-based server (using IP address, not a domain name yet) using the following approach, I can no longer login ad admin.

Zipped and transferred all files from localhost to cloud server
Imported the mysql database
edited the app/etc/local.xml to connect to the cloud mySQL DB
tweaked core_config_data table in phpmyadmin and replaced several values with 5. new URL (IP address)
cleared var/cache, var/session, var/report, var/log
checked all file and folder permissions.

I am simply returned to the admin console login screen.

I have tried to reset the admin password (via myphpadmin) and even create new admin users without success.

I have read it may be related to the new URL or cookies...however nothing I have tried has worked thus far.  Appreciate any input from the Pro's.

Cheers,
Damien


texts: Magento2 default Headers and Footers missing on CMS page

texts:
When I am adding a CMS Page with layout as 1column xml.
The default header and footer shows fine.

but I have some existing CMS pages which if I update the layout to 1column, it still doesn't show the default header and footers.

If I create a new CMS page and add the same contents, it works, but if delete the existing url key (of the page for which for which header and footers were not showing) -  testpage and add the same urlkey testpage to the new page, the headers and footers are removed.

for example I have a CMS page

with url key - shipping-and-returns

and I create new page with URL key shipping with the same contents it works. but If I delete the page with URL key shipping-and-returns and modify the URL key shipping to shipping-and-returns it doesn't work, means header and footers goes missing.

Need some help, what could be causing this issue.


texts: Disable / Remove link to Product Items in Cart

texts:
By default, when you go to the Cart, You see all the products you purchased on the left hand column and also all the products are linked to their individual product page.

I'd like to remove that link as some of the products in our store are not supposed to link out to their individual product pages. Been trying to locate that in my theme and store, but on luck. Any idea what file I can locate it to disable the link?


texts: How to implement different tax and currencies within a single website installation?

texts:
I work with the Magento Community Version 1.9.1. Is it possible to have different tax rates and currencies? Currently I have defined one website, one store and three store views.

I would like to have:

Store View A > Currency: Swiss Francs > Tax Rate: 8 %
Store View B > Currency: Euro > Tax Rate: 20%
Store View C > Currency: Dollar > Tax Rate: 11%

Within a Store View the tax rate should be fixed for all customers.

Is this possible or do I need to define three Websites in order to handle separate tax rates and currencies?

Thanks in advance


texts: Text next to Swatch on Layered navigation

texts:
Magento 1.9.3

Is it possible to get the name of the configurable swatch next to the swatch box in the layered navigation?
EG.

[ ] White (1)

Currently its just [ ] (1) and you can hover for the name of the swatch.


texts: how to edit existing terms and conditions

texts:
After adding term & condition in magento 2.2.6, I can't find the edit or delete option.
Tried to clear cahe, reindex, deploy static but noting working.


texts: Using stock Authorize.net gateway on Magento CE: a PCI compliant practice?

texts:
I seem to be getting conflicting answers on whether using the default Authorize.net gateway (either direct post or not) on Magento CE 1.9+ is a compliant process or not. Could someone clarify this for me?

I understand the different levels of compliance & most of what's involved in the process of becoming PCI compliant (taking the SAQs, getting quarterly scans, installing firewalls, using secure logins, practicing secure network habits, compliant hosting, etc), but I'm a little confused on the actual Magento CE payment gateway side. If everything else passes, I'd like to know: if you accept payments via Authorize.net (either Direct Post or not), is it possible to use those stock Authorize.net gateways & be PCI compliant?


texts: Extension Manager stuck on "Please Wait"

texts:
Whenever I try to access the extension manager in the admin section it goes to the "Please Wait" message and then stays there indefinitely.

There don't seem to be any errors in the developer console so I'm not sure what is happening here.


texts: How would I create 301 redirects from my old domain URLs to my new M2 site URLs?


texts: Product Url Key not working rewrite and category say url key specified store already exists

texts:
The product url keys not working, sometimes they do suddenly it goes to the original url like:
https://www.takoda.shop/nl/catalog/product/view/id/5/s/dog-tag-halsketting-messing/category/5/

and not as I prefer that is stays like this:
https://www.takoda.shop/nl/dog-tag-halsketting-messing.html

Where is that all about?

Also

When I want to change the content of the dutch store view of a category it say: URL key for specified store already exists.

So there is obviously something wrong here

Anybody got any experience with solution this sort?

Thanks a lot in advance

  The url keys for the products are alright again when I export all
  products and import them all, but that doesn't seem to be the way it
  has to work, is it ? In terms of emergency it can work like that until
  the real solution appears


texts: Magento Redis - interpreting key value results

texts:
I have installed redis and see that it is working properly. I understand that it is nosql db and the basic theory around nosql databases.

What I dont understand is that with respect to magento
1. What exactly is Redis caching ? Is it caching the regularly used items like images, text etc ?
2. In the image shown below, what exactly are the keys and tags and how do I interpret the results below.

After expanding the keys, I see output as below. How is the below to be interpreted.

This maybe a simple question for redis users, but am quite new to this and any help is appreciated.


texts:
I want to add new field on OnepageController page , the field for something I want to add  and I want to store it as value in Database table.

What is the mysql code to do this ?

Since my database name is : mage_2015

Table name : exam

Column name is : mag_info

and the value of the is $info
regards

ps : I know what I am doing so direct SQL not dangerous for my use. Because my project is only accessible for few peoples.


texts: getting error while magento composer install

texts:
[UnexpectedValueException]
  The checksum verification of the file failed (downloaded from https://repo.
  magento.com/archives/magento/google-shopping-ads/magento-google-shopping-ad
  s-3.0.1.0.zip)

Everything was running smooth untill I got this error and cannot install composer

Autoload error
Vendor autoload is not found. Please run 'composer install' under application root directory.


texts: How to edit Items text in email template of magento?

texts:
I am stuck with magento email template.

kindly refer the picture for understand my problem

thanks


texts: Magento2: How to get simple products Assosiate to configurable products

texts:
I want to get simple products Associate to configurable products in custom module using factory method.
(not using object manager)


texts: The product name in the page title is being replaced with the meta title

texts:
When a product has a meta title set this is being used as the main header eg the product name in the H1 tag on product detail. This should be the product name.
Does anyone know how to stop this from happening? As the product name and the meta title should be 2 different things


texts: Magento 2 huge number of new user registrations

texts:
My online store receives a huge number of new users creation (over 500 new users per 30 seconds)

So, I enabled captcha for new accounts, the new accounts creation have stopped but I get thousands of new captcha verification images in

  /pub/media/captcha/base

more than 113000 new image whithin 2 houres

I passed my DNS through Cloudflare and marked visitors from China, India, Russia (the source countries of the attack), they must pass the Cloudflare challenge before accessing the site, but I still receive a new account creation attempts from Hong Kong for exemple

but in case I activate the mode "under attack", it stops all those attempts but all store visitors are invited to wait 5 seconds before accessing the store (Cloudflare)

I am using Magento 2.2.5


texts:
When I try to access the Admin order grid it gives something went wrong error message.

When I opened the Excetion log I have the below

  [2019-04-26 13:23:24] report.CRITICAL: The stock item with the "2074"
  ID wasn't found. Verify the ID and try again. {"exception":"[object]
  (Magento\Framework\Exception\NoSuchEntityException(code: 0): The
  stock item with the \"2074\" ID wasn't found. Verify the ID and try
  again. at
  vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:200)"}
  []

Can anyone help fix this issue


texts: Magento 2.2.6 - Unable to set developer mode

texts:
Im am using Magento 2.2.6 and try to switch to the dev mode (before production).

I do it like described in:
https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-mode.html

rm -rf /generated/metadata/* /generated/code/*
bin/magento deploy:mode:set developer

But at point 2. i get this error:

www-data@602f3683557f:~/html$ bin/magento deploy:mode:set developer
Warning: include(/var/www/html/vendor/composer/../../generated/code/Magento/Framework/App/ResourceConnection/Proxy.php): failed to open stream: No such file or directory in /var/www/html/vendor/composer/ClassLoader.php on line 444

So, any ideas whats going on here?


texts: Category product list widget not filtering by conditions

texts:
I have added a category product list widget to home page with like this:
{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" show_pager="0" products_count="5" template="Magento_CatalogWidget::product/widget/content/grid.phtml" conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`category_ids`,`operator`:`==`,`value`:`6`^],`1--2`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`featured`,`operator`:`==`,`value`:`1`^]^]"}}

I'm trying to show all products that are in category ID 6 AND that have the Featured attribute set to Yes. For some reason it's not taking the Featured attribute into account and is showing all products from that category.
Any ideas what is wrong?


texts:
I noticed class vendor/magento/framework/Escaper.php which contains a few useful security methods used inside (mainly) templates. Some of them are quite common (escapeHtml()), but some of them are hard to encounter.

What method and escapeXssInUrl() really does?
In case of method escapeJsQuote() - what is the place where these quotes can be found? Only inline js in templates?
Does anyone has some clear explanation when all methods should be used (practical examples)?
What is a difference between escapeUrl() and escapeXssInUrl() and if second one grants us better security, why not always use second one instead escaping only html chars?
escapeQuote() should be used for example for echoing some variable in situation like this <div value="<?php echo[here?]$value?>">
?


texts: What is the folder where the images need to be for mass importing products?

texts:
What is the folder where the images need to be for mass importing products ?
I seen there in import admin panel that is var/import/images/products_images but no is not working


texts: Magento 2: How to paste remarketing code in the  section

texts: I need to add the tracking code from Google in the <body> section on each store page. Does anyone have any suggestions where to paste this code?


texts:
I am trying to get the total number of items in an order and display them in the shipment PDF.

I am using the below code but I doubles the amount of items. For example, if there is 1 item it gets displayed as 2

<?php $order = $this->getPdfHelper()->getOrder();
    if ($order->hasInvoices()) {
        $invIncrementIDs = array();
        $invItems = array();
        $total = -0;
        foreach ($order->getInvoiceCollection() as $inv) {
            $invIncrementIDs[] = $inv->getIncrementId();
            foreach ($inv->getAllItems() as $item) {
                $invItems[] = $item->getQty();
                $total = $total + ($item->getQty());
            }
        }
    }
?>

    <?php echo $this->__("Number of items:") ?>&nbsp;<?php echo $total; ?>

I'm not sure why but I'm thinking its to do with:

 $total = $total + ($item->getQty());

Could anyone assist?


texts: How to create M2 module which filters by custom product attribute?

texts:
Experimenting with Magento EE 2.1.7 and creating modules. I've created an attribute by the name of "brand" and have assigned a few products with brand data so that I can filter them by brand name/value.

I've created the boilerplate M2 module code and can confirm it's registered and loading. I'm attempting to extend \Magento\Catalog\Model\Layer so here is the code and file I'm modifying:

File: app/code/MyCompany/MyModule/Model/Magento/Catalog/Layer.php

Code:

<?php

namespace MyCompany\MyModule\Model\Magento\Catalog;

class Layer extends \Magento\Catalog\Model\Layer {

    public function afterGetProductCollection($subject, $collection)
    {
        $collection->addAttributeToFilter('brand', array('eq' => 'Ryobi'));

        return $collection;
    }

}

With the above code I'm attempting to filter my custom product attribute "brand" with the value "Ryobi". Is this the correct approach for customer product attributes?


texts: Get product collection by Country of Manufacture in Magento 2

texts:
I tried the following code but it's not working for me.

/**
     * @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory
     */
    protected $_productCollection;

    /**
     * @param Template\Context $context
     * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        array $data = []
    ) {
        $this->_productCollection = $productCollectionFactory;
        parent::__construct($context, $data);
    }

    public function getProductCollectionByUSA(){
        $collection = $this->_productCollection->create();
        $collection->addAttributeToSelect('*');
        $collection->addAttributeToFilter('country_of_manufacture');
        return $collection;
    }

Any help on this?


texts: Remove parent category from category URL - but not for all categorys

texts:
We look for a solution, to remove parent category from url.

So normally the URL is -> www.mydomain.com/specials/shoes.html

but we need it like www.mydomain.com/shoes.html
it should be work for all the subcategories of "specials"


texts: How to extend mage.catalogAddToCart widget in Magento 2.2

texts:
Tried to extend mage.catalogAddToCart by following the steps here:
http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js_practice.html

However, it didn't work


texts: Can't able to add items from admin (Magento 2)

texts:
I'm getting this below screen when I login into the admin panel(Magento 2.1.1) from India but this works good when we login from the UK.

This issue occurs after we moved the server from the US to UK.

When asked the host, they tried troubleshooting and told to uninstall unwanted extensions and this issue persists after uninstalling unused extensions(only in India).

When we login into admin Products > Catalog this (attached) screen appears.

Also, the admin panel freezes when we choose more than 3 attributes.

Please help me identify the issue.


texts: Send Order Email Copy To in order not working in magento 2

texts:
In Magento 2, Order confirmation Email is successfully sending to the customer. But Send Order Email Copy To is not working. I had given bcc as method. While searching I found that below is the file path of order confirmation mail sending:
vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php

public function send()
{
    $this->configureEmailTemplate();

    $this->transportBuilder->addTo(
        $this->identityContainer->getCustomerEmail(),
        $this->identityContainer->getCustomerName()
    );

    $copyTo = $this->identityContainer->getEmailCopyTo();

    if (!empty($copyTo) && $this->identityContainer->getCopyMethod() == 'bcc') {
        foreach ($copyTo as $email) {
            $this->transportBuilder->addBcc($email);
        }
    }

    $transport = $this->transportBuilder->getTransport();
    $transport->sendMessage();
}

This is the method. Why that bcc code is not working. Earlier it was working perfectly, but now it's not working!


texts: Set different price for each additional quantity

texts:
I want to assign a base price i.e $6 and for each additional quantity i want price to increase by $4.
E.g. If i add 2 quanity of the product than price will be :
$6 (Base) + $4 (Additional qty price) = $10 Total price
How do i achieve in Magento.

I did some R&D and all they suggest is price tier. But i think it will also change first quantity(Base) price of the product.

Can anyone please suggest the best possible way to achieve this


texts:
I'm new to Magento, and even newer to Magento 2, and am trying to get an output of all sales orders in json.

I followed the following tutorial: http://blog.i13websolution.com/magento-2-rest-api-example/

I can get this to work locally, however when I migrated to my stage server I get the following message:

  You did not sign in correctly or your account is temporarily disabled

I've checked, and the account works, I can log into it without an issue via the admin backend. It's restricted to only being able to access the Sales Orders page and this seems to work fine in the backend.

I have also created a user role with the correct permissions identical to my local environment.

The code as it is set up is as follows:

$serverip = $_SERVER['REMOTE_ADDR'];
$adminUrl='http://'.$_SERVER['HTTP_HOST'].'/index.php/rest/V1/integration/admin/token';
$ch = curl_init();
//Stage
$data = array("username" => "username", "password" => "password");

//Local
if($serverip == '127.0.0.1'){
$data = array("username" => "username2", "password" => "password23");
}

$data_string = json_encode($data);
$ch = curl_init($adminUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_string))
);
$token = curl_exec($ch);
$token=  json_decode($token);

//Use above token into header
$headers = array("Authorization: Bearer $token");

//Call all pending values
$requestUrl='http://'.$_SERVER['HTTP_HOST'].'/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=status&searchCriteria[filter_groups][0][filters][0][value]=Pending';

$ch = curl_init();
$ch = curl_init($requestUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
print_r($result);

I'm quite stumped as to why the above isn't working on an actual server. Curl is installed, the user is set up... any pointers would be appreciated.


texts: Trustpilot Magento 2 Extension causing frontend to be inaccessible

texts:
I installed the Trustpilot Extension in my M2 installation back in October and have been using it with no problems since then. On Tuesday, a colleague added a Trustbox to a page (which we have done previously with no problems), and after refreshing the Magento admin cache it leaves the whole of the frontend of my website inaccesible. The error shown on the frontend is

1 exception(s):
Exception #0 (Exception): Notice: Trying to get property 'general' of non-object in /vendor/trustpilot/module-reviews/Helper/Data.php on line 91

Line 91 reads the following

   return trim(json_decode(self::getConfig('master_settings_field', $storeId, $scope))->general->key);"

Does anyone know what could be causing this please? It seems to have come out of the blue. I have tried uninstalling the Trustpilot extension and reinstalling it (using composer) and neither of these have worked.


texts: Missing slash redirecting from http to https

texts:
we've our Magento site on a server (NGINX) behind a reverse-proxy; actually all http requests are transformed in https requests by the reverse proxy. For base url like http://www.example.com it works fine (redirect to https://www.example.com) but for url like http://www.example.com/index.php it turns in https://www.example.comindex.php missing the trailing slash
The web/unsecure/base_url e web/secure/base_url in core_config_data table are correctly set as http://www.example.com/ e https://www.example.com/
Thanks


texts: How to remove out of stock product in cart page? Magento 2?

texts:
Actually my need is, i have added some product to cart then after some months added product have out of stock position. That time delete my product from cart in magento 2. How is it?

I need to remove out of stock simple and configurable product in cart page Magento 2.

Based on login user and guest.


texts:
does someone knows how to change magento's admin login language?

I have a language package installed (es_MX and pt_PT)

Things I've tried:

1) Changed admin user language in Account Settings > Interface Locale but it only translates when the admin user is logged in, but don't translates Admin login form.

2) Changed locale in Stores > Configuration > Locale Options > Locale but it is a configuration for frontend.

Any help is appreciated, maybe this is not something relevant for a login, but I don't want to brake user experience.


texts:
I'm creating a new Magento site for a client, and one of his requirements has me thinking. It makes sense from a business standpoint, but I'm not sure how to implement this in Magento.

Many of his products will be clothing that comes in different sizes and colors. In addition, custom logos can be added - such as embroidery or screen printing. The client wants the customer to be able to choose the color and imprint method as options, and to have a separate input box for each size. If it weren't for the multiple input boxes, I would set this up as a configurable product, with size and color as the configurable attributes and the imprint method and color as the custom options.

So does this need to be some sort of configurable grouped product? If so, how do I accomplish this? Is there some easier way to do this that I'm not aware of?

Any suggestions are appreciated.


texts:
I want to customize checkout page but i am confused about calling template with knockout js. In Magento/Checkout/view/frontend/templates/onepage.phtml there is a script like this:

<!-- ko template: getTemplate() --><!-- /ko -->
<script type="text/x-magento-init">
{
    "#checkout": {
        "Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
    }
}
</script>

What is the meaning of this script?


texts: How to override crontab of existing module

texts:
I dont want Mage_Newsletter to constantly send out email, so I create a custom module inside local to take out the cron,

#/var/www/html/public_html/app/code/local/MyComp/CustomConfig/etc/config.xml
<config>
  <modules>
    <MyComp_CustomConfig>
        <version>0.1.0</version>
    </MyComp_CustomConfig>
  </modules>
  <crontab>
    <jobs>
        <newsletter_send_all>
            <run>
                <model>newsletter/observer::scheduledSend</model>
            </run>
        </newsletter_send_all>
    </jobs>
  </crontab>
</config>

Note, how I dont have tag <schedule>

then inside

#/var/www/html/public_html/app/etc/modules/MyComp_CustomConfig.xml
<config>
  <modules>
    <MyComp_CustomConfig>
        <active>true</active>
        <codePool>local</codePool>
    </MyComp_CustomConfig>
    <depends>
        <Mage_Newsletter />
    </depends>
  </modules>
</config>

I still see newsletter_send_all being execute inside table 'cron_schedule' after I clean cache. I tried to add the

<schedule>
   <cron_expr>0 3 * * *</cron_expr>
</schedule>

which run at 3AM, clear cache and refresh, but newsletter_send_all still execute immediately  in my table (not yet 3 AM). Please help, what am I missing?

Note: my server time is not UTC, it run with local timezone.


texts: Registration before checkout does not work

texts:
When I want to register before checkout, nothing happen...

After filling the fields about billing (firstname, lastname, adress...), I click on "Continue" and it goes back to the cart page.

You can check the site here : http://bit.ly/MypZMT

Why and how to fix it ?

Thanks !


texts: Magento 2 How to turn off SSL check on sending CURL request to the external API?

texts:
I am working on a module that will send CURL requests to the external APIs of a CRM. I am getting an error in my exception log like main.CRITICAL: Error Curl {"exception":"[object] (Exception(code: 0): SSL certificate problem: self signed certificate at /httpdocs/vendor/magento/framework/HTTP/Client/Curl.php:427)"} [] does anyone have any idea why is this appening? And how can I solve this issue?
request format
$url="https://sample.com:8000/burst/int/so/control/salesProcess";
      $authorization = "Authorization: Bearer vr5HmMkzlxKE70W1y4MibiJUusZwZC25NOVBEx3BD1";
      //$headers = ["Content-Type" => "application/json", "Content-Length" => "200", $authorization];
          $headers = ["Content-Type" => "application/json", "Accept" => "application/json", "Content-Length" => "200", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => 1, $authorization ,"CURLOPT_CONNECTTIMEOUT"=>120, "CURLOPT_SSL_VERIFYPEER"=>false];
      $params = ' {
    "ApiContext": {
        "application": "ecommerce",
        "applicationId": "123456789",
        "txnid": "STOCK_ISSUE",
        "txprotocol": "SYNC",
        "version": "1.0",
        "createdOn": "19-jul-20 12:06:10",
        "correlationid": "ABCD-12345"
    },
    "ApiMandatoryParams": {
        "sales_issue": '.json_encode($result).

    '},
    "ApiAdditionalParams": {}
}';

        //if the method is get
        $this->curl->get($url);
        $this->curl->setHeaders($headers);
        $this->curl->post($url, $params);
        //response will contain the output in form of JSON string
        $response = $this->curl->getBody();
       // $responseArr = $response->__toArray();
        $em  =  array();
        $this->logger->addDebug($response,$em);
    }
    catch (\Exception $e) {
        $this->logger->critical('Error Curl', ['exception' => $e]);
    }

}


texts: Benchmarking Magento performance between 2 servers

texts:
I'm looking at moving a Magento installation between 2 servers, this is in a shared hosting environment hosted by Nexcess.net
In this instance, the site will be moved from a SIP100 server to a SIP200 server (you can see the specs here: Nexcess - Magento Shared SIP Hosting Plans), pricing difference of $55. (Which is about a 120% increase in pricing).
In terms of performance, I only see the 8GB more RAM as a benefit. My main interest is the support for Redis cache & memcached. I'm going to set up the store to use redis as the primary & slow backend cache, and use memcached for sessions.
I've read some articles which suggest that Siege may not be the most accurate tool to test Magento performance.
I've tried a few options, i.e the profiler, timing scripts & using siege tests.
Are there any other efficient means of benchmarking your Magento store's performance?
P.S I'd really also like to test the backend performance.


texts: Magento 2.2 REST API get categorie in product list

texts:
When I do GET /rest/V1/products/prodID, in response (custom_attributes field) I have

{
     "attribute_code": "category_ids",
     "value": [
        "2",
        "3",
        "20"
      ]
 }

but if i do GET /rest/V1/products?searchCriteria,
and get product list,  "custom_attributes" don't have "attribute_code": "category_ids"
what can i do for have "category_ids" in magento rest api response?


texts: Which Elasticsearch version will work with Magento 2.4?

texts:
I am planning to upgrade to 2.4 CE and I was wondering will Magento work on Elasticsearch 7.8 or is it better to go to 7.0?
Anyone tested this yet?


texts: Get Payment card details then set it Magento1.9

texts: How can I get the payment method and card details from Quote and then set that payment method and card for my custom order creation work, As I want to create order item wise during place order.


texts: How can I change multiple entries in DB?

texts:
In DB I have
Rows:

ID NAME PHONE

Example:

1 Steave 33333333
2 Joe 77777

I can add and Edit any row, but I want when I click "save everyone"  I rewrote all phones on DB
example:

1 Steave 33333333
    2 Joe 77777

click "edit Joe"
- >>> XML Form
rewrote phone on "555555"
Click "save everyone"
- >>> Controller\Adminthml\Slider\SaveEvryone.php

- DO THIS

but how?
If I want to rewrote one item,  I create model

 $model = $this->userFactory->create();

after

$id = $this->getRequest()->getParam('user_id');
        if ($id) {
            try {
                $model = $this->sliderRepository->getById($id);
            } catch (LocalizedException $e) {
                $this->messageManager->addErrorMessage(__('This slider no longer exists.'));
                return $resultRedirect->setPath('*/*/');
            }
        }
$model->setData($data);
$this->sliderRepository->save($model);

but dont know how rewrite some models :[


texts:
I have used solr search in Magento but not find how to add specific attributes in search by Best Match.

I have tried to give it with bellow code in Solr\Block\Catalogsearch\Autocomplete.php in SEARCH_TYPE_STRING_COMPLETION but it is not working.

It works on if I search like "testsku" best match product should be first. If I search with "custom product" than best match of both word should be come first.

I have tried to find out solution but didn't found any.

Also I have shown that if I search with "customize" than Irrelevant product comes.

Need for specific attributes only.

Thanks for your time in advance.


texts: Automatic 301 redirects for disabled products

texts:
I'm trying to add automatic redirects for a custom Product Type (Event) in Magento 1.7.  When an event date has passed, I am marking the product as disabled so users don't go to the wrong page, and I also want to redirect to the list of future classes so I don't have a plethora of 404 errors on my site.

Is there a way to listen to an event for getting the product where the 404 would get thrown, or should I look for a free extension for this somewhere?  I've been searching for a while and haven't seen any extensions that work well.


texts: Location of the code of the currency switcher

texts:
The getSwitchCurrencyUrl() method creates a link like this:

http://myshop//directory/currency/switch/currency/USD/uenc/aHR0cDovL...

Where can I find the currency switch code which is called when I open the link?


texts: I want to show the catalog search in the admin same as in the frontend of the Magento 2 and the results should be the same on the front and admin. I need to know how can I implement this.


texts: Menu contents not displaying on mobile on Main page only

texts:
Magento 2 Mobile menu issue.

My content of my menu on my mobile page (containing my navbar links) does not appear in the expanding menu on the mobile version of my site. All that I get is a black background.

This issue only occurs on the main page of my site, any secondary pages display this menu perfectly.

When I inspect the element everything shows as being present an when I add a z-index of -1 to the background in my dev console and then deselect it, I see my contents for a split second before it's gone again.

Anybody experienced this? Possible solutions?


texts: Export customers from a Mondo shop to Magento?

texts: Is there a way to import Mondo customer data including passwords into Magento? I seachred the net for a while but came up with nothing.


texts: Getting array_replace_recursive(): recursion detected on magento2.2.2

texts:
When i tried to save config data it show me error like

Something went wrong while saving this configuration: Warning: array_replace_recursive(): recursion detected in D:\wamp64\www\mage222\vendor\magento\module-config\App\Config\Type\System.php on line 158

Screensho

any one please guide on this


texts:
when i do

 return $this->_scopeConfig->getValue("config/user/email", \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

Gets the value of the cache and is not correct. How can I make it skip the cache?


texts: How to add New payment method (credit card) in magento 2

texts:
I wish to add new payment method for credit cards.
How do I add Credit card as a new payment method in magento 2.
Please Provide me a solution to customize payment methods


texts: Add No-Required params to custom REST API

texts:
I made a custom REST API on Magento 2. I want some params to be required and other to be no required or accept null. I have the next code:

Api/Order/ShippingInterface

  /**
* API00004. Envío de Pedido
* Url Path: /rest/V1/orders/sap/shipping
* Se mandará a este servicio la información cuando un pedido ya ha
* sido enviado.
*
* @api
* @param string IdPedido
* @param string ControlNumber
* @param string UrlFile
* @param string DecodeFile
* @param string[] Trackings
* @return string JSON con Mensaje de Confirmación o Error.
*/
public function set(
  $IdPedido = null,
  $ControlNumber = null,
  $UrlFile = null,
  $DecodeFile = null,
  $Trackings = null
);

Model/Api/Order/Shipping.php

/**
* API00004. Envío de Pedido
* Url Path: /rest/V1/orders/sap/shipping
* Se mandará a este servicio la información cuando un pedido ya ha
* sido enviado.
*
* @api
* @param string IdPedido
* @param string ControlNumber
* @param string UrlFile
* @param string DecodeFile
* @param string[] Trackings
* @return string JSON con Mensaje de Confirmación o Error.
*/
public function set(
  $IdPedido = null,
  $ControlNumber = null,
  $UrlFile = null,
  $DecodeFile = null,
  $Trackings = null
){ ... }

But when I send a Json like:

  {"IdPedido":null,"ControlNumber":null,"UrlFile":null,"DecodeFile":null,"Trackings":null}

It returns me the next error:

  message":"One or more input exceptions have occurred.","errors":[{"message":"%fieldName is a required field.","parameters":{"fieldName":"IdPedido"}},{"message":"%fieldName is a required field.","parameters":{"fieldName":"ControlNumber"}},{"message":"%fieldName is a required field.","parameters":{"fieldName":"UrlFile"}},{"message":"%fieldName is a required field.","parameters":{"fieldName":"DecodeFile"}},{"message":"%fieldName is a required field.","parameters":{"fieldName":"Trackings"}}]

How can I do this?

Thanks.


texts: catalog_product_save_after Event for Massaction

texts:
I'm using the event catalog_product_save_after to trigger some action after a product has altered/saved. This event does not work when a massaction is used to change the product as this is done without calling save().

Is there another event that can be used to monitor product changes?
Is there a recommended way to get all product changes?


texts:
In cart Price rule I need for example Buy X get y rule Means
I need to select for Buy X(specifice cetegory and SKU ) for get Y(specific cetegory and sku)
I need to select specific category and SKU for X products and specific category and SKU for Y products
How acheive this?


texts: Disable sort/filter for existing grid column

texts: Is it possible to disable filterable/sortable for an existing grid column via observer or layout update?


texts: Magento 2 : Show Icons for Each Category in Mega Menu

texts:
Is there a way to check If category has image? I want to show icons for each category individual in Mega Menu.

I want to dynamic add categories in mega menu.
Please see attached screenshot.

Any help would be greatly appreciated!


texts: Magento 2 - Environment dependent configuration

texts: I'm developing a custom module that access external API. The base URL of the API will be different for different environments. In my case, dev and prod. Is there a way to make a environment dependent configuration in Magento 2?


texts: Extension attribute values not being passed in post when Zero Subtotal Method activated

texts:
I am facing problem with the extension attributes:
extension_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
       <attribute code="student_name" type="string" />
   </extension_attributes>
   <extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
       <attribute code="student_graduation" type="string" />
  </extension_attributes>
</config>

These attribute values are not being posted when order total zero and zero checkout payment method is selected. It is working fine with another payment method. Did anyone face this issue before?
FYI: I am using Magento2.2.1


texts: Magento Bug Bounty - New Admin XSS Vulnerability

texts:
Is the Magento 1 bug bounty still active?  I've found a new obscure XSS vector that will allow attackers to take control of administrator sessions and would like to submit the procedure, yet I don't see the form on the Magento site anymore.

If the bounty isn't running anymore, that would be a bummer...and if that's the case, then what is the preferred method of contact?

Thanks!


texts: How I can display custom attribute on product view page under description Magento2?

texts:
I have tried couple of ways that are already mention on Stack, but none worked for me.

What i have done so far is here....

First i have created attribute in the back-end and assigned it to
default attribute set. attribute code is youtubevideo
I put following piece of code in catalog_product_view.xml

<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.video" template="product/view/video.phtml" group="detailed_info">
<arguments>
    <argument name="at_call" xsi:type="string">getYoutubevideo</argument>
    <argument name="at_code" xsi:type="string">youtubevideo</argument>
    <argument name="css_class" xsi:type="string">youtubevideo</argument>
    <argument name="at_label" xsi:type="string">none</argument>
    <argument name="title" translate="true" xsi:type="string">Video</argument>
</arguments>

its not working with this way , the video.phtml file is copy of attribute.phtml file. which is present on the same path.

Its work if i change in xml video.phtml to attribute.phtml , But it shown on under tab. I don't want to show it in tab.

I'm working on Magento 2.0.9

What else way to shown it on product page somewhere else.

Any help would be appreciated Thanks


texts: Product's price messing with multiple stores

texts:
I have 2 websites in my Magento, each website has it store view with an specific language, currency, etc. All products are in both websites but with different prices (I changed the scope and defined each product price for each website).

One of my products (let's say product X) is a configurable product which has products A, B and C as options (these last 3 are simple products). Product X price is $50 but if I choose option C, I have a discount of $10.

So, inside Product X, in the tab Associated Products, I have products A, B and C, having C with -10 in the price field.

Everything was working fine before, but after adding a new website and setting these products to show in both stores, this discount seems to be duplicated. When I go to the product's list page, Magento shows As low as $30 for product X, but should be $40.

Any ideas?

Ps.: I tried to explain the situation as better as I could, but feel free to ask more details.


texts: which mode is to be set on live the website after development in magento?

texts: which mode is to be set on live the website after development in magento..? I'm a newbie to magento, I had read about modes on magento docs website. but i'm not still clear with it.  Anyone tell about this briefly guys.


texts: Magento 2: How to refresh payment method on some condition

texts: Like I have applied a checkbox on payment page for using it as credit score inspite of money. There is problem when my credit is 100 % used i.e. by using credit score grand total becomes 0. In that case Zero checkout payment should come but its not coming and when i reload the page that zero checkout payment method comes is there any way to refresh payment method list on my checkbox click. You can check in below image what i am talking about.


texts: Magento 2 Layered navigation not showing

texts:
No matter what I did I couldn't get the layered navigation showing. I have several categories with different product attributes, most of them are dropdowns and still no luck.

Steps I took:

  The attributes I want to be included in the layered navigation are all dropdowns.
  Filterable with results option is selected.
  Use in Search Results Layered Navigation option is marked as yes.
  all the categories are marked as anchors.
  All my categories are under the default category.
  Tried the luma and the blank theme.
  Re-indexed and flushed the cache several times.

I have various products with different attributes but still no layered navigation block is showing.

Could you please help me with this. Am I missing something or maybe I have a faulty installation.

Thank you in advance.


texts:
I added some columns to my Order grid (Product SKU, name and quantity and shipping method) but since that some filters in my grid doesn't work like Purchased and Total Qty (It redirects to Dashboard).

Sometimes it shows me the error message : Error log record number: 756025165

Is there a solution for that ?

Thank you for advance


texts: How to get store credit in magento 2 EE?

texts:
I want to get customer balance(store credit) by customer id in custom collection.

I am loading credit memo collection, so i want to show remaining customer balance with that.


texts: After Update to 2.2.1 'href' is not allowed

texts:
After I updated magento with composer to 2.2.1 in frontend shows following error:

  1 exception(s):
  Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'link', attribute 'href': The attribute 'href' is not allowed.
  Line: 33

How can I fix this? I can't locate the error.


texts: Magento 2: Command returned non-zero exit code during submission on marketplace

texts:
I have submitted a module to the marketplace, I have tested it by all cases. I have switched to production mode but I am not getting any errors. However, I am getting a failure on submission with the below errors.

  Enabling maintenance mode Starting compilation Something went wrong
  while compiling generated code. See the error log for details.
  Disabling maintenance mode Command returned non-zero exit code:
  /usr/bin/php -f /var/www/html/bin/magento setup:di:compile

Environment: PHP 7.1.22 Magento 2.3 CE
php bin/magento deploy:mode:set production


texts: magento 2.3 product hide and category hide for guest customer

texts: i am using magento 2.3 and i want to products and category hide , if customer not login means i want to hide product and category page hide for guest customer and must be redirect to login page


texts: Display size and color attributes in filter div

texts:
I want to display my product size and color attributes in my filter div. How should i get all size and color attribute?

<?php
$categories = $this->getCurrentChildCategories();
$count = is_array($categories)?count($categories):$categories->count();
$product = Mage::getModel('catalog/product')->load(9); // not loading the product - just creating a simple instance
?>

<?php if ($count): ?>

            <?php echo $this->__('Sub Category'); ?>

                <?php foreach ($categories as $category): ?>
                    <?php if ($category->getIsActive()): ?>

                            <a href="<?php echo $this->getCategoryUrl($category); ?>" <?php if ($this->isCategoryActive($category)): ?>class="current"<?php endif; ?>>
                                <?php echo $this->escapeHtml($category->getName()); ?>
                                <?php echo $category->getProductCount(); ?>

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

        <?php echo $product->getResource()->getAttribute('size')->getFrontend()->getValue($product);?>


texts:
Someone changed my php version for my magento 2 website to 5.6 and I changed it back to 7.0 and now I'm getting this error when I try to run the major magento commands such as compile and system:upgrade

    The file "/var/www/vhosts/ooples.com/httpdocs/var/generation/Composer/Console/ApplicationFactory.php"
    cannot be deleted
    Warning!unlink(/var/www/vhosts/ooples.com/httpdocs/var/generation/Composer/Console/ApplicationFactory.php):
    Permission denied#0
    /var/www/vhosts/ooples.com/httpdocs/lib/internal/Magento/Framework/Filesystem/Driver/File.php(405):
    Magento\Framework\Filesystem\Driver\File->deleteFile('/var/www/vhosts...')
    1 /var/www/vhosts/ooples.com/httpdocs/lib/internal/Magento/Framework/Filesystem/Driver/File.php(403):
    Magento\Framework\Filesystem\Driver\File->deleteDirectory('/var/www/vhosts...')
    2 /var/www/vhosts/ooples.com/httpdocs/lib/internal/Magento/Framework/Filesystem/Driver/File.php(403):
    Magento\Framework\Filesystem\Driver\File->deleteDirectory('/var/www/vhosts...')
    3 /var/www/vhosts/ooples.com/httpdocs/setup/src/Magento/Setup/Console/CompilerPreparation.php(68):
    Magento\Framework\Filesystem\Driver\File->deleteDirectory('/var/www/vhosts...')
    4 /var/www/vhosts/ooples.com/httpdocs/lib/internal/Magento/Framework/Console/Cli.php(74):
    Magento\Setup\Console\CompilerPreparation->handleCompilerEnvironment()
    5 /var/www/vhosts/ooples.com/httpdocs/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
    6 {main}

  PHP Fatal error:  Uncaught Error: Class 'Cli' not found in
  /var/www/vhosts/ooples.com/httpdocs/bin/magento:31 Stack trace:
  0 {main}   thrown in /var/www/vhosts/ooples.com/httpdocs/bin/magento on line 31

  Fatal error: Uncaught Error: Class 'Cli' not found in
  /var/www/vhosts/ooples.com/httpdocs/bin/magento:31 Stack trace:
  0 {main}   thrown in /var/www/vhosts/ooples.com/httpdocs/bin/magento on line 31

What can I do to fix this error?

UPDATE: Here are the results when I run rm -rf var

rm: cannot remove ‘var/di/setup.ser’: Permission denied
rm: cannot remove ‘var/di/webapi_rest.ser’: Permission denied
rm: cannot remove ‘var/di/frontend.ser’: Permission denied
rm: cannot remove ‘var/di/global.ser’: Permission denied
rm: cannot remove ‘var/di/adminhtml.ser’: Permission denied
rm: cannot remove ‘var/di/crontab.ser’: Permission denied
rm: cannot remove ‘var/di/webapi_soap.ser’: Permission denied


texts: Change success message on applying coupon code

texts:
In Magento 2.x, By default, we can set coupon codes from Marketing->Cart Price Rules.

I've added a test code and it's working as expected. When I added the code in cart page (mysite.com/checkout/cart) ,

I see the success message as follows:-

You used coupon code "TestCode1".

How to change this message to include whatever text I need to put?


texts: How to bypass CSRF validation for certain requests like payment gateway webhook?

texts:
I am trying to integrate CC avenue payment method with Magento 2.3 however once payment is processed, user is navigated back to website with error "Invalid Form Key. Please refresh the page."

Upon debugging, I found that CSRF validation fails when CC avenue posts response on return URL. While I also tried solution mentioned on the post : Magento 2.3 upgrade breaks HTTP POST requests to custom module endpoint, still the error persists. Possible reason could be that interface mentioned in above post is not being used rather it gets into Magento\Framework\App\Request\CsrfValidator class which implements Magento\Framework\App\Request\ValidatorInterface.

Possible workaround is to override class - Magento\Framework\App\Request\CsrfValidator as follows:

public function validate(
        RequestInterface $request,
        ActionInterface $action
    ): void {
        try {
            $areaCode = $this->appState->getAreaCode();
        } catch (LocalizedException $exception) {
            $areaCode = null;
        }
        if ($request instanceof HttpRequest
            && in_array(
                $areaCode,
                [Area::AREA_FRONTEND, Area::AREA_ADMINHTML],
                true
            )
        ) {
            //Custom code
            if ($request->getRequestUri() == 'custom/uri')
            {
                $valid = true;
            }
            else {
                $valid = $this->validateRequest($request, $action);
            }
            if (!$valid) {
                    throw $this->createException($request, $action);
                }
            }
    }

Question is - how do I override this class? I tried writing dependency injection but did not work!


texts: how to get admin user access level in magento?

texts:
Is there a way to know the access level of the current logged in user to see if the user is granted with "all" or "customized" access role?

i can get the user role data but i can't seem to understand/find the access level so that i can apply some logic to my code (collection).

Mage::getSingleton('admin/session')->getUser()->getRole()->getData();
above statement prints:

Array
(
    [role_id] => 34
    [parent_id] => 0
    [tree_level] => 1
    [sort_order] => 0
    [role_type] => G
    [user_id] => 0
    [role_name] => Demo
    [gws_is_all] => 1
    [gws_websites] =>
    [gws_store_groups] =>
)

how can i get the information here on access level (all, customized) of the assigned role to the user?

much appreciated.

ps: i posted the same question on stackoverflow but this seems to be the specific place for magento.


texts: Has anyone else had trouble saving categories with a lot of products?

texts:
We have a category with around 12,000 products and when I try and save it, the page just spins for a few minutes then I get an internal server error.
The errors are connection is reset or timeout errors. But I can't imagine that it should take this long to save the category.

Update to this: It seems to time out with any category we have tested so far with at least 4000 products. It doesn't even have to be a category with 4000 direct products, even a category that has sub-categories with products totaling 4000+ won't save. The default category will save though, which is odd.
Has no one else had this issue?


texts: How to get to know the XML file and its path for that template Path Hint in Magento 2

texts: As we can enable template path hints in settings along with blocks but there is no option to show from which xml file it is coming in the frontend. How should I know which xml file to write to move, remove and add template to that location. Sometimes it become very difficult to find the file related to that template path because there are so much files presented in the folder.


texts: I am using magento's default file uploader in my custom modules. How can I hide the image thumbnail shown in image below?


texts: Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in Magento 1.9.2

texts:
Error is coming on product detail page in Magento 1.9.2.
Error is for custom options only.

<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php endif;?>

Complete error is :
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in public_html/dev123/includes/src/Mage_Catalog_Block_Product_View_Options_Type_Select.php on line 62

I think error is coming due to my product detail page not by magento default core files.

My php version is 5.6.3


texts:
I am using cron job in magento which runs for every 2 minutes. And I have set the ubuntu cron job to run magento's cron.sh for evey 5 minutes. The cron job of magento is initiating fine, it can be track down in the cron_schedule table which is in pending status.

The problem is, the cron job is not running either its not changing the status.

After some time it is going to the missing status http://prntscr.com/7o4zwv  with the following message

exception 'Mage_Core_Exception' with message 'Too late for the schedule.' in /var/www/html/sports/app/Mage.php:595
Stack trace:
#0 /var/www/html/sports/app/code/core/Mage/Cron/Model/Observer.php(293): Mage::throwException('Too late for th...')
#1 /var/www/html/sports/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#2 /var/www/html/sports/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#3 /var/www/html/sports/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#4 /var/www/html/sports/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#5 /var/www/html/sports/cron.php(76): Mage::dispatchEvent('default')
#6 {main}

Is there anything am i missing here?


texts: Magento 2: How to delete all categories at once?

texts:
We have been experimenting with syncing our existing database(not Magento) to Magento 2.

In the process, we have created over 1000 categories, but then we rearranged all the IDs to sync with our system. The problem is that I can no longer import the new categories as I get the error "URL key for specified store already exists." and we are getting duplicate categories now.

I think the best solution would be to clear them all out and import fresh. I found this tutorial for 1.9

https://gist.github.com/jklance/9664371

When I look at the new database I notice small differences

entity_type_id is in all the old category tables but none of the new ones.
new database has an additional table catalog_category_product_index_tmp

My questions are these,

can I use that code I found and modify to remove entity_type_id
and add TRUNCATE TABLE catalog_category_product_index_tmp;
or is there more I need to modify?
or can you provide me a clean script to remove all categories?

we only have 1 test product in the system, so no need to worry about them


texts: Hi I am looking for the extension to make Indian cities dropdown based on state selected in magento 2


texts: Our company have installed the Magesolution Product Video extension but it only works in the frontend when the site is set to default theme. When a different theme is set, the extension does not show on the frontend, what would you recommend that I do so that the extension works even on the non-default theme? Thanks!


texts: How save custome data and add new cart item instead of update quantity when product add to cart in Magento

texts:
I want to save custom data in to cart item and add new cart item instead of update quantity when product add to cart in Magento.

I have added below code in Observer.php file

    public function checkoutCartProductAddAfter(Varien_Event_Observer $observer){
    try {
        $data = $this->_getRequest()->getPost();
        $item = $observer->getQuoteItem();
        $product = $item->getProduct();

        if(isset($data['customize_data'])){
            $results['data'] = $data['customize_data'];
            $productModel = Mage::helper('productcustomizer')->getCustomizeData($product->getId());
            $results['price'] = $productModel->getCustomizePrice();
        }

        if(isset($data['customize_image'])){
            $file_name = $item->getProduct()->getId()."-".time()."-".rand(0,999).'-'.$item->getProduct()->getUrlKey();
            $path = Mage::getBaseDir()."/media/productcustomizer/customize_image/";
            $url = Mage::getBaseUrl()."media/productcustomizer/customize_image/";
            $new_file_name = Mage::helper('productcustomizer')->save_base64_image($data['customize_image'],$file_name, $path);
            $image_data = array(
                'url' => $url.$new_file_name,
                'path' => $path,
                'name' => $new_file_name
                );

            $results['image'] = $image_data;
        }

        if(isset($results)){
            $item->addOption(array(
                  "product_id" => $product->getId(),
                  "product" => $product,
                  "code" => "customizer_data",
                  "value" => serialize($results)
            ));

            if(!empty($results['price']) ){
                $finalPrice = $product->getPrice();
                $qty = $item->getQty();

                $price = ($finalPrice + $results['price']) * $qty;

                $item->setCustomPrice($price);
                $item->setOriginalCustomPrice($price);
                $item->getProduct()->setIsSuperMode(true);
            }
            $item->collectTotals()->save();
        }
    }
    catch (Exception $e) {
        Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
    }
}

It is saving custom data into cart item but when i add same product in to cart then it is updating quantity. I want to add new item instead of update quantity.

I want to add separately because "customization data" and "price" of the product is different every time when add item into cart.


texts: Set value in core config table Magento 1.9 issue

texts:
I am going to set the core_config_data table value for flat catalog products via code but when I print in log it always shows wrong values.

Mage::getConfig()->saveConfig('catalog/frontend/flat_catalog_product', '0', 'default', 0);
Mage::log("Flat Catalog Disbale After ... ".Mage::getStoreConfig('catalog/frontend/flat_catalog_product',0),null,'apply.log',true);
Mage::getConfig()->saveConfig('catalog/frontend/flat_catalog_product', '1', 'default', 0);
Mage::log("Flat Catalog Enable After ... ".Mage::getStoreConfig('catalog/frontend/flat_catalog_product',0),null,'apply.log',true);

Kindly suggest, I need to disable then enable for some code segment but it returns wrong values.