texts: Unable to call the controller function from js file using Ajax in Magento 2

texts:
Path of js file-

  app/code/Company/Configuration/view/adminhtml/web/js/test.js

code in js file -

define(['jquery', 'mage/validation', 'mage/template'], function ($, _, template) {
    function main(config, element) {
        var $element = $(element);
        var path = config.AjaxUrl;
        $(document).ready(function() {
            $("#lock").click(function(){
                var value1  = $('#value1').val();
                var value2      = $('#value2').val();
                var param = 'ajax=1';
                $.ajax({
                    /*showLoader: true,*/
                    url: path,
                    data: param,
                    type: "GET",
                    dataType: 'json'
                }).done(function (data) {

                    alert(data);

                });
            });
        });
    };
    return main;
});

And code in phtml file to ajax call

<script type="text/x-magento-init">
    {
        "#lock": {
            "Company_Configuration/js/test":{
                "AjaxUrl":"http://127.0.0.1/magento2/admin/configuration/admin/settings/doSomeAction", "method":"get"
            }
        }
    }
</script>

Where settings is controller file Settings.php and doSomeAction() is function which I want to call.

Thanks.


texts: What can I do to fix this onestep checkout / paypal express problem?

texts:
Here is the problem:

at this page: http://www.domain.com/onestepcheckout/
The customer fills out the fields on the onestep checkout page, select their country as "United States" from the drop down menu, which displays a new dropdown list called "County" which contains all of the states in the US.

The customer picks one of the states, chooses their shipping method, selects paypal as the payment method and then clicks "Place order now" button.

Instead of going to the paypal website to complete the payment, the customer is redirected back to http://www.domain.com/checkout/cart/

The checkout works correctly when using other countries which do not have a dropdown for "county" / state.

What can I do to fix this problem?


texts: When I apply a discount to a specific group, everyone can see it

texts:
I have a problem. I want a group of customers to be able to view and buy at a discounted price. To do this, create a group of clients and add me to that group (me). Call it "Wholesalers = Mayorista".

Create the price rule for the catalog for that group and apply it but all customers can see it, even those who are not logged in.
*Note that the dates of the rule have been from the test I carried out days ago.

In the same way, use the option "ADVANCED PRICING" but the same thing happened, everyone can see the discount.

What am I doing wrong?
I attach images. Thank you.


texts: Getting Error in email notification on magento 2.2.6

texts:
I am facing this error on my mail in magento 2 (Currently using version 2.2.6)

On email notification I am getting this error (screenshot). Either it will be a newsletter email or success order email or anything else.

Screenshot Url:

https://prnt.sc/l2ek3a


texts: How to show related products Magento 2.3.5

texts:
I want to show related products on product page only from my custom module.
I am not sure if I can or is it possible to do it.
I am doing a check by if my attribute is enable I will change the outcome of Is saleable function.
I want to show related products on my phtml can anyone show me how to do this or tip


texts: How to set default value of ZIP/Postal code in checkout page - Magento 2.0.1

texts:
In Magento Checkout Cart page under Estimate Shipping and Tax, we can see text field ZIP/POSTAL CODE.
Already we store ZIP/postal code in checkout session.
My question is I want to display ZIP/postal code text field from checkout session.

Please help me to find solution.


texts: How to add more tabs for product images at Product gallery area in Product detail page magento2

texts:
I want to add two more tabs at the product gallery area.
Those two tabs will display more images of products. Like model photos and some environmental photos.

I also have to provide some configuration at backend. Have to add more image attributes to manage those two tabs images.
And need some code for frontend to display these images exactly the same as product images. Just needs to add different tabs.
If anyone has an idea then please let me know.


texts: EComDev PHPUnit get and set session data

texts:
How do you test setting and getting a session variable in PHPUnit/EComDev? This is what I've so far in my test method:

$checkoutSession = $this->getModelMock('checkout/session');
$checkoutSession->expects($this->any())->method('getData')->with('number')->will($this->returnCallback(array($this, 'getNumber')));
$checkoutSession->expects($this->any())->method('setData')->will($this->returnCallback(array($this, 'setNumber')));

In the test class, I've defined the following:

protected $_number = 5;

public function getNumber()
{
    return $this->_number;
}

public function setNumber()
{
    $args = func_get_args();
    $key = $args[0];
    $value = $args[1];

    $this->_number = $value;
}

This works in the code being tested:

$checkoutSession = Mage::getSingleton('checkout/session');
$number = $checkoutSession->getData('number'); //5
$checkoutSession->setData('number', $number+1);
$number2 = $checkoutSession->getData('number'); //6

However, getting the variable with Magento's magic method does not:

$number = Mage::getSingleton('checkout/session')->getNumber();//this is null

How does one mock Magento's magic methods?


texts:
I want to use code such as shown below to create my customer groups programmatically. However I have a requirement to set the Customer IDs to a specific ID numeric range. So if I create 100 customer groups their IDs need to start at 1000 and end with 1100. Is there a way to force the numbering of the ID like I want to do?

<?php
require_once 'app/Mage.php';
umask(0);
/* not Mage::run(); */
Mage::app('default');

//Create Customer Group
Mage::getSingleton('customer/group')->setData(
     array('customer_group_code' => 'Partners','tax_class_id' => 5))
->save();
?>


texts:
In magento 2.3.1 I have this code:

public function encrypt($params)
    {
        return base64_encode($this->encryptor->encrypt(serialize($params)));
    }

    /**
     * Decrypt tracking key
     *
     * @param string $key
     * @return array
     */
    public function decrypt($key)
    {
        $serializedParams = $this->encryptor->decrypt(base64_decode($key));
        return unserialize($serializedParams);
    }

It is from a module which tracks newsletters. But I get error

  Notice: unserialize(): Error at offset 0 of 48 bytes in myfile.php on
  line 51

Which is

return unserialize($serializedParams);

Can anyone help me with the right syntax of this please?


texts:
I added new attribute and new column to Order Grid :

[vendor]\[module]\view\adminhtml\ui_component\sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="sales_repesentative" class="[vendor]\[module]\Ui\Component\Listing\Column\Status">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="sorting" xsi:type="string">desc</item>
                    <item name="filter" xsi:type="string">text</item>
                    <item name="sortable" xsi:type="boolean">false</item>
                    <item name="label" xsi:type="string" translate="true">Sales Representative</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

[vendor]\[module]\Ui\Component\Listing\Column\Status.php

<?php

namespace [vendor]\[module]\Ui\Component\Listing\Column;

use \Magento\Framework\Api\SearchCriteriaBuilder;
use \Magento\Framework\View\Element\UiComponentFactory;
use \Magento\Framework\View\Element\UiComponent\ContextInterface;
use \Magento\Sales\Api\OrderRepositoryInterface;
use \Magento\Ui\Component\Listing\Columns\Column;

class Status extends Column
{
    protected $_orderRepository;
    protected $_searchCriteria;

    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        OrderRepositoryInterface $orderRepository,
        SearchCriteriaBuilder $criteria,
        array $components = [],
        array $data = []
    ) {
        $this->_orderRepository = $orderRepository;
        $this->_searchCriteria = $criteria;
        parent::__construct($context, $uiComponentFactory, $components, $data);

    }

    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as &$item) {
                $order = $this->_orderRepository->get($item["entity_id"]);
                $dealer = $order->getSalesRepresentative();
                $item[$this->getData('name')] = $dealer;
            }
        }

        return $dataSource;
    }
}

But when I want to Filter or Sort the grid base on new column, I get this error:


texts: Correct procedure for making edits of 'pages.xml'

texts:
Apologies if this is kinda vague. I am attempting to edit a theme I have purchased, and I am having trouble making the changes appear on my site. I have created a child theme and would like to override some CSS attached to the header. When inspecting the header element I find there is some CSS attached:

.cms-index-index .page-header.type3 {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
    background-color: rgba(0,0,0,.5);
    width: 100%;
    max-height: 100%;
}

When searching my the theme for this CSS, I found it twice, once in magento2\app\code\Smartwave\Porto\etc\import\pages.xml and again in the file magento2\app\design\frontend\Magento\Porto Theme\app\code\Smartwave\Porto\etc\import\pages.xml.

My assumption is that I need to create a copy of one of these files in my new child theme to override it.

My question is, which of these files should I be duplicating, and after making those edits, what would be the correct procedure for making the edits appear on my site?


texts: how to override vendor/magento/module-swatches/view/frontend/templates/product/layered/renderer.phtml in magento 2

texts:
how to override the color navigation swatch in magento 2 my code is in below but it is not working

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="Magento_Swatches::css/swatches.css"/>
</head>
<body>
    <referenceBlock name="category.product.type.details.renderers">
        <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" name="category.product.type.details.renderers.configurable" as="configurable" template="Mycustom_MultipleLayeredNavigation::layer/renderer.phtml" ifconfig="catalog/frontend/show_swatches_in_product_list" />
    </referenceBlock>
</body>


texts: alt tags for category thumbnails not working?

texts:
I am working on a Magento 1.9 E-commerce webstore and I am currently trying to add alt tags to the thumbnail images for my categories.

I found the template file that seems to generate the category icons in the cateogry pages (app/design/frontend/package/theme/catalog/category/category-banner.phtml)

In that file, there does seem to be a section that pulls the icon images and sets the alt text of the thumbnail to the category title (if I read that right), in an automated system:

    <?php
    $_imgHtml   = '';
    if ($_imgUrl = $_category->getImageUrl()) {
        $_imgHtml = '<img src="'.$_imgUrl.'" alt="'.$_helper->categoryAttribute($_category, $_category->getName(), 'name').'" />';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
        echo "<style>body { background: url('".$_imgUrl."') no-repeat center center; background-size: cover; }</style>";
    }
?>

Whether or not that is what it is supposed to be doing (again, not too sure) when I disable images from my browser, the alt text does not appear in the area where the images are located, indicating to me that the code is either not working or is non-existent if the above code is for something else.

I am not sure if there are any phtml files with direct img tags for each image, or if they are created by that generator php function. Any advice? Would be happy to provide more info as needed.

Thank you very much!


texts:
What is the mean of this security patch.
SUPEE-6285_CE_1.9.0.0 - 1.9.1.1

Is it compatible from version 1.9.0.0 to 1.9.1.1
or
Is it compatible with only 1.9.0.0 - 1.9.1.1


texts:
On login, my magento 1.9 site is redirecting to a specific product

Specifically, when a user logs in from the login page, from the checkout page, any login I have been able to test always goes to the same individual product

It happens in live and in beta (i can print out or console log to beta without customers being affected)

I have no mod/plugin/addon designed to redirect user on login. I have redirect off (to profile page) in the admin back-end

I really just need to know where to look in the code for what is happening... I have done a grep search for setBeforeAuthUrl and $this->_redirect, along with a few other choice terms (including the key and id of the product and product category)


texts:
Im using configurable products, and i'd like to show simple products' stock when it is under 24.

so i created new  for showing stock.
and it works so well.... but the problem is, some specific products show its stock even though is over 24...

The simple products that show its stock more than 24, keep showing its stock even though i deleted and recreated configurable products, and un-associated and re-associated simple products.

i coded in 2 different ways. but neither of this works. plz help me

sol1)

<td class="only<?php echo $hidden_super_val=''.$productVal['info']['prod_id'].'_'.$att['attribute_id'].'';?>" >

                   <?php if (Mage::getSingleton('customer/session')->isLoggedIn() == 1) :?>
     <?php if ($productVal['info']['qty'] <= 24): ?>
       <?php echo "ONLY LEFT" ?>

       <?php echo $productVal['info']['qty']; ?>
                                 <?php else: ?>
                                  <?php echo '' ?>

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

sol2)

<?php $kbstock = number_format(Mage::getModel('cataloginventory/stock_item')->loadByProduct($assc_products)->getQty()); ?>
<td class="only<?php echo $hidden_super_val=''.$productVal['info']['prod_id'].'_'.$att['attribute_id'].'';?>" >

                    <?php if (Mage::getSingleton('customer/session')->isLoggedIn() == 1) :?>
                                  <?php if ($kbstock <= 24): ?>
                     <?php echo "ONLY LEFT" ?>

               <?php echo $$kbstock; ?>
                                 <?php else: ?>
                                <?php echo '' ?>

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


texts: Magento 2 . Add custom success message on successful checkout

texts:
I am working on Magento version 2.1.10 and created an observer for event "sales_order_place_after", I need to show custom success message after successful checkout on checkout success page.

following is my current code:

namespace Vendor\Module\Observer;
use Magento\Framework\Event\ObserverInterface;

class Customsuccess implements \Magento\Framework\Event\ObserverInterface
{
    protected $_messageManager;

    public function __construct(\Magento\Framework\Message\ManagerInterface $messageManager )
    {
        $this->_messageManager = $messageManager;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $this->_messageManager->addSuccessMessage(__('This is a success message'));
    }
}

But I am getting the error on checkout.


texts:
I want to create an API point where the admin user can update their password, but I don't know what encrypt method used to encrypt the admin password and save it in the database, roughly what I want is like this:

$data = array(
          'user_id' => '1',
          'password' => 'magento2',
          'firstname' => 'Jane'
        );

$user = Mage::getModel('admin/user')->load($id);

if(isset($data['password')) $data['password'] = $this->encryptPassword($data['password']);
$user->addData($data);
$user->save();


texts:
I am using custom option for image uploading . when product ordered and i gets downloadable link in order.
But if you enable System -> Cofiguration -> Web -> Url options -> Add store code to urls than  not able to download that image in order.its redirect me on dashboard.

Is there any permanent solution for it ? or every time when i want to download that image i need to disable this option .

Thanks


texts: Conditionally loading content for adaptive design server-side with WURFL

texts:
Trying to figure out the best way to only serve content that is needed in a responsive design (as opposed to just hiding hundreds of elements in CSS).

I notice at /lib/Zend/Http/UserAgent/Features/Adapter there are some files for device detection like WurflApi.php - does Magento have the ability to just load content with an if statement via WURFL already? If not, can anyone advise of any tools that can cater for this?

I wrote more about our requirements for this here.

Link to WURFL for more info.


texts: magento 2, is it possible in custom theme set 1-column layout for category list page if it's first level category

texts: Wondering how to remove sidebar from topl level category list page that parent is Default Category through code not admin panel? Considering after setting template categories are going to be created, so no info about their ids.


texts: How to Bypass Admin Area Authentication for Testing

texts:
I want to speed test Magento admin area with some 3rd party tool. However I can't do it as Magento admin area requires authentication.

Is there any way to disable it?


texts:
How do I programmatically set the locale information of a store view?

I don't know how to set this value, although I can get it using:

echo Mage::getStoreConfig('general/locale/code', $store_view->getId()) ;

Here it follows the code I use to programmatically create the store view:

$store_view = Mage::getModel('core/store');
$store_view->setCode($english_store_code)
                    ->setWebsiteId($storeGroup->getWebsiteId())
                    ->setGroupId($storeGroup->getId())
                    ->setName('English')
                    ->setIsActive(1)
                    ->save();


texts: Magento 2 brocken css on frontend backend

texts: i have installed a lattest magento 2.3.5 but my css are brocken as am getting this.


texts: Discount fields in different quote tables

texts:
There are some discount fields like discount_amount/base_discount_amount in sales_flat_quote_item and sales_flat_quote_address. same goes for subtotal_with_discount/base_subtotal_with_discount in sales_flat_quote_address and sales_flat_quote?

why there are same fields in two tables? what do they do?

Thanks in advance:)


texts: Issue with Ajax calls in Chrome Magento 2

texts:
We are having an issue with Ajax calls in Chrome (only). The gist of it is that 1 in 50 or so calls will return a 500 error.

  If I refresh the page, it works.

It does not appear to be tied to a specific script as it happens on the backend (creating an order, for example) and the front end (like adding to cart).

Any ideas? Anyone else has this issue?

First noticed it after switching hosting providers, but this could be a red herring as we've been doing a lot of dev work as well.

Running Magento Ver. 2.2.0

Here's the console with two different instances:


texts: How can I calculate tax using a product's "price" instead of its "special price?"

texts: So, for example, let's say I have a product with a price of $10 and special price of $0, I want to calculate the tax based on the $10 price and not the $0 special price. I can't seem to find any way in Magento to do this.


texts: How to add SignOut link in My Account Dashboard listed option programmatically magento 2

texts:
Actually,
 I am trying to add signOut link in My Dashboard end of the page  where other  links are listed  programmatically using magento 2.

can any one idea related it.


texts: Is it ok to define main logic in block constructor?

texts:
I would love to be sure, if it is not a ugly practice to do the following.

In my controller I render a block template layout:

    public function saveactionAction() {
        $this->loadLayout();
        $this->rendereLayout();
    }

Render some simple HTML form for saving:

    <form action="" method="POST">
        <input name="somevar" type="text">
        <input type="submit">
    </form>

and in my block's template, I receive a form data, filter it and save it in the constructor:

 class MyModule_MyCompany_Block_SaveAction extends Mage_Core_Block_Template {

        public function __construct() {
            if($params = $this->getRequest()->getParams()){

                // custom filtering and saving to data database
            }
            parent::__constuct();
        }
    }

The question is: is it normal or should I do the logic inside the controller preferably?


texts:
I need to retrieve 1 product attribute value from 1 product, I wonder if using the product repository in this way is the most effective in terms of performances:

$productColour = $this->productRepository->get($this->getSku())->getCustomAttribute('colour');

thanks


texts: Which event to observe for building Magento Extension for fraud detection ?

texts:
Magento Version 1.9.x

Requirement

I need to build an extension to alter the checkout flow. I want to send the user info ( email, name, shipping address ) , order info ( product name, quantity ) plus the payment details ( card holder name, card number , payment method etc ) to my fraud detection algorithm. The extension should execute when user clicks the final PAY button. It will gather the required information ( user, order and payment details ) and send it to fraud detection algorithm server. The payment should proceed only if the response from the server is a "GO" else it will throw error message.

Done So Far

I have made an event observer for sales_order_save_before to do so.

class Mahadev_FraudDetection_Model_Observer
{
    public function gatherData($observer)
    {   // $payment_info from $_POST global variable at this point.
        $data = $observer->getEvent()->getOrder();
        Mage::log($data->debug(), null, "gatherData.log", true);
    }
}

I can gather the payment information from $_POST variable.

Questions

1) sales_order_save_before is the right event to use ? I need to check the order and payment details before the actual payment. If not , which event I should observe ? May be sales_order_save_before is getting triggered after the payment ( not sure yet ).

2) Will this method works with all the payment gateways? and with all kind of checkouts and payment.

3) Please suggest if I can do this in some better way. Is there any event which can give me payments information also. I do not want to gather payments information from $_POST.

4) Can you put some good link to understand advance magento development. I can't find any good resource for building these kind of extensions.

P.S. I am very new to Magento, so please feel free to correct me if I am wrong somewhere.

Thank you.


texts: Problem starting customer session from frontend Magento 2.4

texts: I have the following problem when the client logging in from the store frontend. I can create a new client without problems and when I create it it is registered, but when I select log out and try to log in again it is not successful, it does not show any error either, I have already verified everything related to cookies and even within the tables, but without success. Any help please


texts:
I've had to downgrade a site I'm working on from 2.4 to 2.3.5 and am at the point where all pages appear as they previously did, except that going to the /store page itself results in a blank page. I'm not getting anything useful in the debug log, have checked Elasticsearch is set up properly, and have tried the change to the Validator's isPathInDirectories() function suggested in other blank page problems.
Another issue that is probably linked is that I am unable to view any product pages in the frontend, or add any to cart. I can search and browse categories fine.
The problem is identical whether I'm using my custom theme, blank or luma.
Any ideas of what I should be looking into are much appreciated!


texts:
I want to show login Magento 2 of my custom module.

I have created an index controller but it's not working for me

class Index extends \Magento\Framework\App\Action\Action
{
protected $resultJsonFactory;
protected $_helper;
protected $logger;

public function __construct(Context $context,
\Softprodigy\Opc\Helper\Data $helper,
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,\Psr\Log\LoggerInterface $logger)
{
    $this->resultJsonFactory  = $resultJsonFactory;
    $this->_helper = $helper;
    $this->_logger = $logger;
    parent::__construct($context);
}

  public function execute()
  {
    //die('dfsd');
    //$topTel = $this->_helper->getConfig('dynamicpdf/general/topTel');
    //$_thishepler = $this->_helper('namespace\moduename\Helper\Data');
    $isEnabled = $helper->getStoreConfig('namespace_module/general/enabled');

   $this->_logger->addDebug("test".$isEnabled); // log location: var/log/system.log
    $this->_logger->addInfo("test2".$isEnabled); // log location: var/log/exception.log
    $this->_logger->addNotice("test3".$isEnabled); // log location: var/log/exception.log
    $this->_logger->addError("test4".$isEnabled); // log location: var/log/exception.log
    $this->_logger->critical("test5".$isEnabled);
    print_r($isEnabled); die;


texts: Out Of Stock Product Display On Frontend and Catalog search whether System->Configuration->Inventory->Display Out of stock Set to No

texts: Hey Can you tell Me how to display out of stock product too on frontend and catalof search whether it set in cofif Display out of stock is No.Override which class for Solution.


texts: Making products available on all sites by default

texts:
I have two Sites one for GBP and one for Euro but they are both using the same root category in the catalog.

First of all, is it possible to make new products visible by default in both stores when newly created, rather than having to tick the checkbox for both for each product.

Second of all, is it possible to edit the details for products for both store views at the same time, my products all use the default values from 'All Store Views' for everything except the price so I was trying to find a solution that would avoid the dropdown for each store view just editing the default values for all stores and just two boxes for price for £+€.

Any help or ideas for this would be greatly appreciated.


texts: Can not run vendor/bin/mftf generate:tests on Command line in Magento 2.3

texts:
When I run this command line vendor/bin/mftf generate:tests in Magento root it shows me an error :

in ModuleReSovlver.php line 444:
Could not retrieve API from Magento instance <403 Forbidden>

Anyone can help me a hand, please? I do not know what the problem here?


texts: Magento Mage::registry return NULL Value

texts:
blow is my Block "Edit.php" file code.

<?php

class Matword_Students_Block_Adminhtml_Student_Edit
      extends Mage_Adminhtml_Block_Widget_Form_Container{

public function __construct(){

    $this->_blockGroup = 'matword_students';
    $this->_controller = 'adminhtml_student';

    parent::__construct();

    $this->_updateButton('save','label',$this->__('Save Student'));
    $this->_updateButton('delete','label',$this->__('Delete Student'));

}

public function getHeaderText(){

    // here i got a NULL VALUE
    var_dump(Mage::registry('matword_students'));exit;

    if(Mage::registry('matword_students')->getId()){
        return $this->__('Edit Studen');
    }else{
        return $this->__('New Student');
    }

}

}

below is my adminhtml.xml file code

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <menu>
        <matword translate="title" module="matword_students">
            <title>Matword</title>
            <sort_order>1</sort_order>
            <children>
                <students>
                    <title>Students</title>
                    <sort_order>0</sort_order>
                    <action>adminhtml/students/index</action>
                </students>
                <student>
                    <title>Student</title>
                    <sort_order>0</sort_order>
                    <action>adminhtml/student/index</action>
                </student>
            </children>
        </matword>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <matword translate="title" module="matword_students">
                        <title>Matword</title>
                        <sort_order>1</sort_order>
                        <children>
                            <students>
                                <title>Students</title>
                                <sort_order>0</sort_order>
                            </students>
                            <student>
                                <title>Student</title>
                                <sort_order>0</sort_order>
                            </student>
                        </children>
                    </matword>
                </children>
            </admin>
        </resources>
    </acl>
</config>

below is my layout config file student.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">
    <adminhtml_student_index>
        <reference name="content">
            <block type="matword_students/adminhtml_student" name="matword_students_student"></block>
        </reference>
    </adminhtml_student_index>
</layout>

where i create a mistake why i got a NULL on

  var_dump(Mage::registry('matword_students'));exit;

i follow this tutorial for create a custom grid.

Thanks


texts: Magento Index management error Please try run this process later

texts:
am trying to reindex Catalog URL Rewrites but it throws an error

  "Catalog URL Rewrites Index process is working now. Please try run
  this process later."

I Am trying to delete var/locks but there is no locks folder


texts: Magento 2. How to Generate Coupon for specific product / products Programmatically

texts: I want to generate the coupon for the specific products like I want to generate the coupon for the product with id= 20 whose price is let suppose 30$ and I want to sell it on 15$. How can I generate this programmatically? thanks in Advance


texts: How i can hide minicart in header and display when product add to cart

texts:
I have tried everything to hide the cart from my website and display it when any product added to cart by clicking on "Add To Cart" button, but it didnt work, i am using magento 2.1, any helps are really appreciated.

Thank you in advanced


texts: Best Practise to Add Custom Tab in Product Details (backend)

texts:
I would like to add an extra tab to the product details ( backend ) and I don't want to perform any override, if possible.

What is the best way to accomplish this ?


texts: How to get Order details in the model of custom module

texts:
Im creating a module to send the order details to another server's database when a order is placed in my magento server. Im using  event to point to the model class but Im not able to get the order details like product name, quantity, price etc which are all needed to write in the other database. How can I make my model to get the values and write it to the database?

This is the config.xml file Im using

       <events>
            <sales_order_invoice_pay>
                <observers>
                    <sendorder>
                        <type>singleton</type>
                        <class>xxxx_SendOrder_Model_Observer</class>
                        <method>salesOrderInvoicePay</method>
                    </sendorder>
                </observers>
            </sales_order_invoice_pay>
        </events>

and this is the code Im using to get the order details

        $event = $observer->getEvent();
        $invoice=$event->getInvoice();
        $order =$invoice->getOrder();
        $orderno=$order->getIncrementId();

I need to get the details of the order placed by customer and then push those details to another server's dd


texts:
I need to build a list of shipping number link.

I have finished build the html of the list.

But instead of rendering html. It ouputs the content including html text.

This is my code to render source for that column:

public function prepareDataSource(array $dataSource)
{
    if (isset($dataSource['data']['items'])) {
        foreach ($dataSource['data']['items'] as & $item) {
            if (isset($item['entity_id'])) {

                /** @var  \Magento\Sales\Model\Order $order */
                $order = $this->_orderFactory->create()->load($item['entity_id']);
                $trackCollection = $order->getTracksCollection();

                $str = "";
                foreach ($trackCollection as $trackItem) {
                    if ($trackItem->isCustom()) {
                        $str .= $trackItem->getNumber() . ", ";
                    } else {

                        $str .= '_shippingHelper->getTrackingPopupUrlBySalesModel($trackItem) .
                            '\',\'trackorder\',\'width=800,height=600,resizable=yes,scrollbars=yes\')">' . $trackItem->getNumber() . '';
                        $str .= '
getId() . '">
';

                        $str .= ", ";
                    };
                }
                $str = rtrim($str, ", ");
                $item[$this->getData('name')] = $str;
            }
        }
    }

    return $dataSource;
}

Is there any problem with my code ?


texts:
I have an e-commerce that runs Magento but we do not have the access to both code and server.

We want to create a new page to add some features like countdowns and a form for emails, but even adding all the code in the "Content Area", it still doesn't work.

For example: if I add <script>test</script> on the CMS Page editor and save, when accessing the page, it will just show <script>test</script> as if it is just a text and won't do the action that was supposed to do (in my case, show a countdown). Even with the correct tags and everything else, it just appears to be a text that was written.

So, how do I create a page with HTML, CSS and Script that works correctly on CMS Pages on Magento?

Thanks in advance!


texts: How do I sync supplier's live stock database into Magento 2

texts:
I am noob in Magento, my boss asks me to synchronize products, prices and quantities with the suppliers database on a daily basis.
We can have different sources.

Question is how can I access this data and integrate this into Magento 2 CE?

Thanks in advance


texts: What are the required skills to work on Magento 2 Front-end?

texts:
I am a fresh front-end developer and I want to start working with Magento 2.

I would like to know what are the required skills to start working on the Luma theme as a first step?

With what grid is Magento 2 working? CSS grid or bootstrap flex?


texts:
Due to some mistake we ended up in cached thumbnail images for old versions of our images in Magento 2.2.8 shop.

How can we detect those images? Is there a build in function for this?

We want to avoid a full cache-delete and bin/magento catalog:images:resize

So our idea would be

traverse over all images on the file system
find all the cached versions
check if a the cached version has on older time stamp than the original image

Did anybody do this already? Is there an easier solution?


texts: Magento 2 - Override title.phtml with custom attribute value

texts:
CURRENT STATE:

Custom theme installed

Title of the product in the product details page displays the product name

In backend: Made new custom attribute (brand), put it to default attribute set, added some values

DESIRED STATE:

Product title on the product details page displays BRAND + NAME

I tried changing title.phtml from vendor > magento > module-theme > view > frontend > templates > html > title.phtml but I cannot get the value of custom attribute no matter how I try (I can only set some static value instead of $title but no real/dynamic values for each product).

Thanks in advance for any help


texts: How to change order state after paypal payment?

texts:
Using standard paypal payments, after a paypal payment is made, orders are set to "processing" (Mage_Sales_Model_Order::STATE_PROCESSING). I need to set a different state/status, as follows:

$order->setState(Mage_Sales_Model_Order::STATE_HOLDED, 'payment_accepted');

However, I have been unable to find an appropriate observer, or another place to set the state/status.

How can this be achieved when paypal payment is complete?

Currently, the site uses paypal standard, but will likely migrate to a different paypal setup soon. The site will likely use this same logic for other payment methods.


texts: Two different prices - with different currency - in different countries!

texts:
Using Magento, I need some help to display two different prices for one item displayed in two different countries (currency).

The product is displayed:

in currency A with let's say a price of 100€
in another currency with a price of 50CHF?

Not only convert from €.


texts:
How to remove decimal from quantity on Catalog Admin grid of Magento2  (Product/Catalog).

I have set Qty Uses Decimals to "No", but the decimals are still there.


texts: Magento saves a wrong order total amount and put the order in Subspected Fraud

texts:
I've a problem in the order resume when a user is applying a discount code.

In fact the subtotal is 68 + 8 (shipment) and - 6.80 (discount code) = €69.2 and not €76.0 like what's written in the page.

The payment is made with paypal and the total is correct (€69.2) but magento is putting the order in Subspected Fraud - IPN "Completed". Order is suspended as its capture amount 69,20 € is suspected to be fraudulent.

Actually the problem is happening with any discount code.
How can I solve this problem?


texts: Fatal error: Cannot declare class since because the name is already in use

texts:
I have read the other articles but they still don't help.
I have a PHP page. The PHP page has a public function that is calling a private function. On the public function it has a line that says
include_once('CardConnectRestClient.php');
And then when it calls the private function  $this->createProfile();
The error I then get on the private function Cannot declare class PestJSON, because the name is already in use
in PestJSON.php
The code of the page and main function and private function are below.  The php is /app/Http/Controllers/UsersController.php
and has
include_once('CardConnectRestClient.php');
$this->createProfile();

The private function is
$client = new CardConnectRestClient($url, $user, $password);
    which is where it fails with error


texts: How to increase user session in magento 2.1.10

texts:
I want to increase my user session in magento 2.1.10 to 4 hours and after 30 min of inactivity that session is closed.
i have in the php.ini this :
session.cookie_lifetime = 14400
session.gc_maxlifetime = 14400
memory_limit = 768M
max_execution_time = 18000
session.auto_start = off

suhosin.session.cryptua = off

and in my magento admin are the same seconds.

Thanks.


texts: Store Magento media files on Google cloud

texts:
I need to store my media files on google cloud whenever i add products image or other media files. I am trying to use https://github.com/bangerkuwranger/magento2-google-cloud-storage module and i need below credentials. But as i never used google cloud storage i don't know how to get them. Can any one provide me guideline to do that.

Or you can suggest me any other module or other process to upload image and get those from frontend that.


texts: Success message is not showing while submit review form in magento 2

texts:
I am facing issue when submit review form in product detail page.when submit review then success message is not showing after reload.

But when adding product to cart on the same page then it showing correctly. When I move to another page then whole messages at time like below image:


texts:
I have the standard breadcrumbs on my page, but I want to add a second copy.

I've tried to add another block the same as defined in module-theme default xml:

<block class="Magento\Theme\Block\Html\Breadcrumbs" name="crumbs"/>

This does not display.

Should there be a template reference? e.g.

  template="Magento_Theme::html/breadcrumbs.phtml"

How do I add this to my layout?


texts: How to override button.phtml from Module_Backend in own module

texts:
I want to override following file in my custom module:

  module-backend/view/adminhtml/templates/wiget/button.phtml

How can I do that?


texts:
If I add product to a category the catalog search works perfectly. But I dont want to use category filter on this. Actually I dont use category in my project.

Edit: I want to show category-less products on catalogsearch result page. That's why I want to remove category filter.

So, how can I remove category filter on catalog search? I think It's about core code but I dont know which file I need to edit.


texts:
I installed Magento  successfully, but the Admin page gives error: 404 not found. Please suggest a solution for this.

The following is the error:

404 Not Found

nginx/1.10.0 (Ubuntu)


texts: I don't want product review to be shown on product listing page

texts:
I want product review to be shown on the product details page, but reviews should not be shown on the product listing page irrespective of they are available or not.

Kindly help me to do this.


texts: MAGENTO 2: HOW TO DISABLE MSI in MAGENTO 2.3.0

texts: How one can disable the MSI module in Magento 2.3.0 if not in use.


texts: How did you redesign a custom Magento theme to be responsive?

texts:
I have to redesign an existing Magento website (with a custom theme) to be responsive. I would like to get some ideas and advice from those who have experience in similar projects.

What is your advice on the workflow, planning, tools, responsive frameworks and anything else?

I will be working alone on this project. I have to convert the existing custom theme to a responsive theme.


texts: Magento 2 How to change the steps of checkout?

texts:
I want the customers to select a shipping method first, and then enter shipping address. How can I change the order?
Thanks.


texts: Magento 2: How to increase customer login session?

texts:
I want to increase customer login session.

Please tell me how can i do?


texts: Are there performance issues with dynamically adding text fields to System->Configuration via frontend_model?

texts:
I am writing an extension that creates a menu. The menu pulls the top-level categories of the store and displays subcategories in a dropdown menu. Also in the dropdown menu is a callout, which is actually a static block. In System->Configuration, administrators can choose a different callout for each top-level category.

The way I have done this is by writing a custom frontend_model that grabs the top-level categories for the currently selected store scope. A text field is created for each top-level category where the identifier of a static block can be entered. When the menu is being built on the frontend, if the static block exists, it will be added into the dropdown menu of its associated top-level category.

<?php
class Cbad_Shoppablemenu_Block_Adminhtml_System_Config_Form_Fieldset_DynamicCallouts extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
    protected $_fieldRenderer;

    public function render(Varien_Data_Form_Element_Abstract $element)
    {
        $html = $this->_getHeaderHtml($element);

        foreach ($element->getSortedElements() as $field) {
            $html .= $field->toHtml(); // get static field html
        }

        $store = Mage::app()->getRequest()->getParam('store');
        if($store) {
            $storeCode = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code', $store);
            $storeItem = $storeCode->getFirstItem();
            $rootId = $storeItem->getRootCategoryId();
            $rootCategories = Mage::getModel('shoppablemenu/category')->getSubCats($rootId);
            $html .= '
Custom Callouts can be used to display a promotional area in the Shoppable Menu. Enter the identifier of the static block that you want to associate to a root category. Leave blank to use default.
';
            foreach ($rootCategories as $rootCat) {
                $html .= $this->_getFieldHtml($element, $rootCat); // get dynamic field html
            }
        }
        else {
            $html .= '
Custom Callouts can only be set at the "Store" Configuration Scope.
';
        }
        $html .= $this->_getFooterHtml($element);

        return $html;
    }

    protected function _getFieldRenderer()
    {
        if (empty($this->_fieldRenderer)) {
            $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
        }
        return $this->_fieldRenderer;
    }

    protected function _getFieldHtml($fieldset, $category)
    {
        $configData = $this->getConfigData();
        $path = 'shoppablemenu/dynamic_callouts/category_'.$category->getId();
        if (isset($configData[$path])) {
            $data = $configData[$path];
            $inherit = false;
        } else {
            $data = (string)$this->getForm()->getConfigRoot()->descend($path);
            $inherit = true;
        }

        $field = $fieldset->addField($category->getId(), 'text',
            array(
                'name'          => 'groups[dynamic_callouts][fields][category_'.$category->getId().'][value]',
                'label'         => $category->getName(),
                'value'         => $data,
                'inherit'       => $inherit,
            ))->setRenderer($this->_getFieldRenderer());

        return $field->toHtml();
    }
}

Everything works. My question is if I should be worried about efficiency. A coworker thinks that administrators accessing System->Configuration may slow down the frontend of the site. I really don't think it is much of an issue but he wants to be sure.

This is on an offline development server so we don't have too many ways to test this.


texts: Product add to compare if product out of stock

texts: If any product is out of stock in inventory then that's not add to compare list. But if I click Add to Compare button then It's show a message The product PRODUCT NAME has been added to comparison list.. Then I check my compare list that say You have no items to compare . Now I need to add product compare if that out of stock. Is it possible?


texts: Join Custom Table With Admin / Sales / Order / View

texts:
Basically i'm trying to add additional data's to sales -> order -> view page.

I have a custom table named 'additional_order_info' i want to join this table with 'sales_flat_order' using 'order_id'

So far i noted that below function under app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php is responsible to get order information's like Ordered date, etc..

public function getOrder() {
    return Mage::registry('sales_order');
}

So is there way to join my custom table with other sales_order related tables ? So that i can display my custom values under every order view.


texts:
Before 2.2 I made a small plugin to sync email subscription with our provider like the following and everything is working in ect/frontend/events.xml

I created my observer like this :

<event name="newsletter_subscriber_save_before">
    <observer name="VendorName_newsletter_subscriber" instance="VendorName\ModuleName\Observer\Newsletter" />
</event>

and in my VendorName\ModuleName\Observer\Newsletter.php

public function execute(Observer $observer)
{
    $event = $observer->getEvent();
    $customer = $event->getSubscriber();
    $customerEmail = $customer->getSubscriberEmail();
    $customerName = $customer->getFirstname();
    $customerLastname = $customer->getLastname();
    $customerId = $customer->getId();
    $checkSubscriber = $this->_subscriber->loadByEmail($customerEmail);
    if ($checkSubscriber->isSubscribed()) {
        // Customer is subscribed
        //sync with Sendinblue
        ....
    }
    $this->messageManager->addSuccessMessage(__('Welcome back beloved customer %1 !', $customer->getCustomer()));
}

everything was working as expected but now I got a "null" on my $customer variable.

I didn't find anything on dev-doc about changes. Has there been an update I've missed?

Thanks


texts:
what does the below coding mean?

        !-- ko foreach: getRegion('messages') -->
          <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->


texts: What is the best size (dimensions) for product photos for front page and category pages?

texts:
Magento 1.9.1
Porto theme

I have installed the Porto theme in my Magento 1.9.1 store. I have 8 rows of products on the front page (4 products per row). Now the front page as well as all the category pages don't look very attractive because the photos of products look different sizes (dimensions). I assume there is a re-sizing mechanism within Magento and it takes the large base image and shrinks it to a specific size to be displayed on the front page (and category pages). I think the problem might be that some of my base images are not big enough (or don't have the correct ratio) to begin with. How to best correct this?

I noticed that within the Admin - there are 3 options in the Image tab:

Base Image
Small Image
Thumbnail

I guess I can make a specific size of my products' photos and save them as Small Images? in the Image tab of "Manage products". What would be the ideal size (dimensions) and where is this specified within Admin? I mean something like 300 x 400 or 300 x 500? Where is this specified and what do you recommend? Another benefit of re-sizing the images manually would be that I could decrease the actual file size for the front page (and category) images and increase the speed of the site.

I have the following settings in

  SYSTEM --) CONFIGURATION --) CATALOG --) Catalog - Product Image:

Base Image Width = 1800
Small Image Width = 210

I tried changing the Small Image Width to 410 but I didn't notice any difference anywhere...

Here is an image guide for Magento 1.9.x:

http://docs.magento.com/m1/ce/user_guide/catalog/product-image-size-type.html

It says under Small Image:

Example size:
470 x 470 pixels

Are these the right dimensions? Where is it specified?

I found this piece of code in the list.phtml file in:

  /public_html/app/design/frontend/smartwave/porto/template/catalog/product

<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
    $_image_helper = $this->helper('catalog/image');
    $store = Mage::app()->getStore();
    $code  = $store->getCode();
    $aspect_ratio = Mage::getStoreConfig("porto_settings/category/aspect_ratio",$code);
    $ratio_width = Mage::getStoreConfig("porto_settings/category/ratio_width",$code);
    $ratio_height = Mage::getStoreConfig("porto_settings/category/ratio_height",$code);

    if(!$ratio_width)
        $ratio_width = 300;
    if(!$ratio_height)
        $ratio_height = 400;
?>
<?php

Does that mean my front page images and images in categories are being re-sized to 300 x 400 pixels?


texts: Cannot update custom product attribute values

texts:
I am new to Magento and I am trying to configure search on basis of custom attibutes value. While working on it I encountered a very strange issue.

Whenever I am trying to update the value of a custom attribute from Product Information > Specification Tab It is not getting updated. It happens for all the products where attribute field type is Text Input. I can change values for dropdown fields.

Can anyone please suggest a solution ?


texts: $ (dollar) sign in front of a class method name?

texts:
In Mage_Sales_Model_Order_Payment::_void(), there is a $ sign placed like below.

$this->getMethodInstance()->setStore($order->getStoreId())->$gatewayCallback($this);

What is this doing?


texts: Magento 1.9 : getSkinUrl() displaying content as HTTP instead of HTTPS. How do I fix this?

texts:
I'm trying to get my site over to https.

But, i'm getting mixed content errors. I looked into one of them and it is an image, and that image is being used like this:

<img src="<?php echo $this->getSkinUrl('images/mgt_lazy_image_loader/loader.gif'); ?>"

How do I fix this? Shouldn't this be using my Secure Base Skin URL field from inside the Admin?


texts: Price Indexer Fluctuate the Product Count in Magento

texts:
We have been continuously facing issues of Product Fluctuation in our Production Environment.
We have our Magento backend and Front end uses React/Mobile App. We have an intermediate platform Algolia, to which we send Products to be shown in our frontend. We are using Algolia Extension for Magento and according to their recommendation, we have setup the settings.
Now, we get to know a fix pattern in our environment and when that pattern happens, our products gets deleted from Algolia (Also Magento products decreased/increased unevenly) and while we do full reindex of Algolia, they come back from Magento to Algolia. So, Even if there is no Algolia, we can still see product fluctuation in Magento itself.
We do Price Full Reindex, twice a week. In this operation, we update the price in Magento through FTP upload and run the Magento Full Price Reindex command. When we run the Price reindex command of Magento, a giant data set gets piled up in Magento Price Indexing backlog as per the data we have uploaded in sheet. To update the price in Algolia, we do a Algolia Full Reindex from Magento, while the giant backlog of Price indexer in Magento clears up, suddenly, few products gets deleted from Algolia but they should not be deleted as they are not Disabled, Out Of Stock, VISIBLE and showing in Magento website.
This same set of issues was also replicated some days ago when we had pure Magento Website. When we do price indexing, some products gets disappeared from Magento site or all of a sudden price of the products become 0. We had to do full Magento reindex to bring the price.

Resolution Tried:-

We had followed https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexer-batch.html and taken down the catalog_product_price batch size to 1000.

Does anyone here have face this issue?
What is the recommendation of Price indexing and other indexing we should follow to avoid such issues?


texts: magento 1.9 checkout/onepage back cart empty

texts:
I need to cart empty when user back from checkout/onepage.

If it is possible please help me in this.

  Or this is my plan

I have creating a checkout/onepage like this

Here i want to prevent back url in browser & when user click logo here link cart will empty


texts:
Is it possible to prevent new setup resources (e.g. acme/somemodule/sql/install-0.1.0.php) running during the end user page execution flow in Magento 1.7?

What I plan to do is copy across the new version, and then run n98magerun sys:setup:run as part of our deployment shell script. This mitigates any problems if say some data loading exceeds PHP maximum run time (i.e. large one time data loading or perhaps some WS calls), and prevents some random visitors having multiple second delays on page load, right?

If we can't do that (i.e. disable setup resource running on page load execution flow), then I thought about putting site into _maintenance mode, can someone confirm that then this won't trigger when someone loads the site? And then run n98magerun sys:setup:run and then toggle _mainteance mode back off.

How else can this be handled? I feel mightly uncomfortable with our DDL and data migration being invoked by some random unsuspecting frontend user  but I'm admittedly not from a PHP background so perhaps this is all normal?

Also should any install/upgrade scripts be idempotent? i.e. if server crashes, db becomes available, stupidly high max runtime value is exceeded, before completed and core_resources is updated it can be rerun safely. However all and every example Ive found is not idempotent (i.e. no drop statement first etc..) which is very odd.

(new to magento devops)


texts: Magento 2 Cookie Restriction Bar - css styles not applied for different stores

texts:
I am working on a Magento 2 multistore setup like this:

www.foo.com/uk
www.foo.com/us

bar.foo.com/uk
bar.foo.com/us

baz.foo.com/uk
baz.foo.com/us

I have successfully styled the cookie bar for the www.foo.com/uk & www.foo.com/us store, but when I switch to the other two it inherits the default blank theme styles instead.

Everything else works as it should, I have a subfolder for every store (bar, baz) and storeview (us, uk) and all the other theme styles are applied correctly.

bar.foo.com & baz.foo.com inherit from the www.foo.com theme.
I tried to add the _cookie.less file under the specific theme subfolder but that didn't change anything.

Any other suggestions would be much appreciated

Thanks


texts: How to add a Total row in a magento grid

texts:
I'm creating a new module that uses a order grid for  particular product(this is not the report grid) in magento admin i successfully create new order grid for that but i want to get total price for product at the end , like in sales>report.

Please see image

Any help will be appreciated,,Thanks


texts: Subject line of Transactional Emails - Custom Fields

texts:
I am working with a client who is primarily wholesale, the subject line needs to focus on things like shipping method and warehouse information than about the order id or the web URL of the store.

I am trying to find any ways of achieving this.


texts: Magento Soap V2 API - 'The requested Payment Method is not available'

texts:
I am trying to create an order using the payment method code 'checkmo' which is in the example documentation but I am receiving the error "The requested Payment Method is not available.". Please see my code below:

<?php
//*** GLOBAL VARIABLES ***//
    $client = new SoapClient('URL');
    $session_id = $client->login('User', 'Pass');

//*** CREATE ORDERS ***//
    //foreach ($line as $iLineNumber => $data_line) {
    try {
            $cartId = $client->shoppingCartCreate($session_id, 1);
            $customerList = $client->customerCustomerList($session_id, array());
            $customer = (array) $customerList[0];
            $customer['mode'] = 'customer';
            $client->shoppingCartCustomerSet($session_id, $cartId, $customer);
            $productList = $client->catalogProductList($session_id);
            $product = (array) $productList[653];
            $product['qty'] = 1;
            $client->shoppingCartProductAdd($session_id, $cartId, array($product));

            $address = array(
                array(
                    'mode' => 'shipping',
                    'firstname' => $customer['firstname'],
                    'lastname' => $customer['lastname'],
                    'street' => 'street address',
                    'city' => 'City',
                    'region' => 'Region',
                    'telephone' => 'phone number',
                    'postcode' => 'LN2 4FX',
                    'country_id' => 'United Kingdom',
                    'is_default_shipping' => 0,
                    'is_default_billing' => 0
                ),
                array(
                    'mode' => 'billing',
                    'firstname' => $customer['firstname'],
                    'lastname' => $customer['lastname'],
                    'street' => 'street address',
                    'city' => 'City',
                    'region' => 'Region',
                    'telephone' => 'phone number',
                    'postcode' => 'LN4 2FX',
                    'country_id' => 'United Kingdom',
                    'is_default_shipping' => 0,
                    'is_default_billing' => 0
                ),
            );
             // add customer address
            $client->shoppingCartCustomerAddresses($session_id, $cartId, $address);
            // add shipping method
            $client->shoppingCartShippingMethod($session_id, $cartId, 'flatrate_flatrate');

            $paymentMethod =  array(
                // 'po_number' => null,
                'method' => 'checkmo',
                // 'cc_cid' => null,
                // 'cc_owner' => null,
                // 'cc_number' => null,
                // 'cc_type' => null,
                // 'cc_exp_year' => null,
                // 'cc_exp_month' => null
            );
             // add payment method
            $client->shoppingCartPaymentMethod($session_id, $cartId, $paymentMethod);
             // place the order
            $orderId = $client->shoppingCartOrder($session_id, $cartId, null, null);
            echo 'Success: Order has been created: ', $e->getMessage(), '
';
        } catch (SoapFault $e) {
            echo 'Error: Order could not be created: ', $e->getMessage(), '
';
        }
    //}
?>

Could anybody save me here? Thank you.


texts: Magento 2.1: how to change customer notification, worming or messages?

texts:
I have limited the number of items allowed in shopping cart to 4. That I've done successfully. however I didn't like the displayed message:

The most you may purchase is 4

I want to change it, where/how can I do this?


texts: Login to Magento 2. from outside, with Guzzle, returns a invalid form_key

texts:
I'm trying to login to Magento 2, with a form which contains a "from_key". I scrape this form_key but I'm not able to successfully login. Has someone any idea how to make this work? This is my code:
        $client = new \GuzzleHttp\Client();
        $jar = new \GuzzleHttp\Cookie\CookieJar();
        $request = $client->request('GET', 'https://www.waiglobal.com/eu_nl/customer/account/login/', [
            'cookies' => $jar,
        ]);

        $content = $request->getBody()->getContents();
        $html = str_get_html($content);

        foreach($html->find('input[name=form_key]') as $rows) {
            $form_key = $rows->value;
        }

        $request = $client->request('POST', 'https://www.waiglobal.com/eu_nl/customer/account/login/', [
            "form_params" => [
                "form_key" => $form_key,
                "login[username]" => "username",
                "login[password]" => "password",
            ],
            'cookies' => $jar,
        ]);
        return $jar;


texts: Cancel order and restore products stock qty

texts:
I'm using the following code to cancel programmatically some orders in my magento website:

foreach($orderCollection as $order):
    $order = Mage::getModel('sales/order')->load($order->getId());

    $order->setData('state', "canceled");
    $order->setStatus("canceled");
    $order->addStatusHistoryComment('Order was automatically canceled');
    $order->save();

    Mage::getModel('jewelsales/order_synch')->cancelOrder($order->getId());
endforeach;

The problem is that the order's product quantities, that were decreased when order was placed, are not increased back their previous state, after order is canceled.

Can you help me fix that?

*Note: Product quantities are restored if I cancel order through magento administration. But it's not working when canceling orders programmatically.


texts: shoppingCartPaymentList() always returns empty result

texts:
I am using the following code to try to receive a list of all available payment methods:

$payments = $proxy->shoppingCartPaymentList($sessionId, $cartId);

echo '<pre>';
print_r($payments);
echo '</pre>';

While I have configured payment methods in the website configuration of the shop, only an empty array is returned. I have also set a valid store view id in my shoppingCartCreate(), so this should be fine, too.

Any ideas on this?


texts: Request for index.php times out in Magento 1.9.1

texts:
I have an EC2 instance running RHEL7 with the standard LAMP stack.  Everything was working fine when all of a sudden Magento stopped responding.  Requests for index.php hang and then time out. Apache still serves other things in the /var/www/html directory so I tried requesting index.php.sample and it gave me this error message:

"Whoops, it looks like you have an invalid PHP version.  Magento supports PHP 5.2.0 or newer."

Why would I get that error message from index.php.sample but not from index.php?

Restarted the instance and the error persists.

The PHP Version installed is 5.4.16.  Curl, mcrypt, and mysql-php are all installed and functioning.  Everything listed on phpinfo.php seems like it is the way it should be.

In /app, .htaccess contains only:

Order deny, allow
Deny from all

Relevant parts of httpd.config are as follows:

User apache
Group www-users

<Directory "/var/www/html">
     Options Indexes FollowSymLinks
     AllowOverride All
     Require all granted
</Directory>

SELinux is disabled and the output of ls -l on /var/www/html looks like this:

-rwxr-xr-x.  1 apache www-users   2834 Dec 10 19:56 api.php
drwxr-sr-x.  6 apache www-users     84 Dec 16 15:22 app
-rwxr-xr-x.  1 apache www-users   2831 Dec 10 19:56 cron.php
-rwxr-xr-x.  1 apache www-users    717 Dec 10 19:56 cron.sh
drwxr-sr-x.  7 apache www-users   4096 Dec 10 19:56 downloader
drwxr-sr-x.  3 apache www-users   4096 Dec 10 19:56 errors
-rwxr-xr-x.  1 apache www-users   1150 Dec 10 19:56 favicon.ico
-rwxr-xr-x.  1 apache www-users   5979 Dec 10 19:56 get.php
drwxr-sr-x.  2 apache www-users     39 Dec 10 19:56 includes
-rwxr-xr-x.  1 apache www-users   2642 Dec 10 19:56 index.php
-rwxr-xr-x.  1 apache www-users   2366 Dec 10 19:56 index.php.sample
-rwxr-xr-x.  1 apache www-users   6441 Dec 10 19:56 install.php
drwxr-sr-x. 12 apache www-users   4096 Dec 10 19:56 js
drwxr-sr-x. 14 apache www-users   4096 Dec 10 19:56 lib
-rwxr-xr-x.  1 apache www-users  10421 Dec 10 19:56 LICENSE_AFL.txt
-rwxr-xr-x.  1 apache www-users  10679 Dec 10 19:56 LICENSE.html
-rwxr-xr-x.  1 apache www-users  10410 Dec 10 19:56 LICENSE.txt
-rwxr-xr-x.  1 apache www-users   1319 Dec 10 19:56 mage
drwxr-sr-x.  6 apache www-users     83 Dec 10 19:56 media
-rwxr-xr-x.  1 apache www-users     20 Dec 10 15:20 phpinfo.php
-rwxr-xr-x.  1 apache www-users    886 Dec 10 19:56 php.ini.sample
drwxr-sr-x.  2 apache www-users     67 Dec 10 19:56 pkginfo
-rwxr-xr-x.  1 apache www-users 585086 Dec 10 19:56 RELEASE_NOTES.txt
drwxr-sr-x.  2 apache www-users     76 Dec 10 19:56 shell
drwsr-sr-x.  5 apache www-users     51 Dec 10 19:56 skin
drwxr-sr-x.  7 apache www-users   4096 Dec 16 15:07 var

Any ideas?

EDIT:

Just thought I would try this out.  index.php.sample uses this if statement to check if your php install is new enough:
if (version_compare(phpversion(), '5.2.0', '<')===true)

So I made a php file that reads as follows:

<?php
if (version_compare(phpversion(), '5.2.0', '<')===true) {
    echo 'phpversion returns: ' . phpversion();}
else { echo 'This works';}
?>

And sure enough it prints This works.  Why would act differently in the two PHP files with identical if statements?


texts: Manually update custom currency exchange rate

texts:
I have created a custom exchange rate, and I am attempting to find a way to change the exchange rate.

I clicked "update" on the Manage Currency Rates admin page, but I cannot modify the number at all.

What should I do to change the rate and ensure that any sort of auto update (cron?) does not impact the number?

Thanks!


texts: Use of Mysql4 and Resource in different modules in same project

texts:
There are some modules where Mysql4 is used and now I have created some new module with Resource for ModuleResource in config.xml.

Does it has any effect of performance of site?


texts:
I have my checkout cart page running on https.
When I am applying any coupon or removing, it is not showing any message to the user.
When I am using non secure checkout page, then Magento is showing error or success message on checkout cart page.
Any help in regard to fix this issue would be appreciated.


texts: Layout update programmatically in Magento 1.9.x

texts:
I now work with sources of other developers and don't understand what for this code:

protected function _getShippingMethodsHtml() {
    $layout = $this->getLayout();
    $update = $layout->getUpdate();
    $update->load('opcheckout_onepage_shippingmethod');
    $layout->generateXml();
    $layout->generateBlocks();
    $output = $layout->getOutput();
    return $output;
}

I am highly appreciated for any help.


texts:
I use the magento (1.7.0.2) rest API to receive sales orders and product information. This works fine. The problem is that we have added custom attributes to our products. A customer can choose those options when adding a product to his shopping cart.
But these custom attributes are not shown in the received rest API result. I also tried SOAP V1 and V2 API - no luck.

How can I get those custom attributes?


texts: Paypal Express Checkout Review: request to enter necessary information to the shop

texts:
When a customer purchases with PayPal express checkout, information that is essential for us is often missing:

The telephone number (it is not always populated on Paypal because it is not mandatory).

The certified email address (if it is an Italian company).

These two pieces of information are essential for the proper functioning of the shop's sales flows. In the Paypal Order Review page it is not possible to enter data. How would you solve? would you modify the order review page?


texts:
I'm trying to redirect to my shipping information page to cart page based on a condition how can i do this my plugin file is in this path

  /app/code/Sem/Shipment/Plugin/Checkout/Model/ShippingInformationManagement.php

    <?php

namespace Sem\Shipment\Plugin\Checkout\Model;
use Magento\Framework\Exception\StateException;
use Magento\Checkout\Model\Session;
use Magento\Framework\View\Element\Messages;

class ShippingInformationManagement
{

    protected $_messageManager;
    protected $jsonResultFactory;
    protected $_checkout;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory,
        \Magento\Framework\Message\ManagerInterface $messageManager,
        \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
        \Magento\Checkout\Model\Session $session

    ) {
        $this->_messageManager = $messageManager;
        $this->jsonResultFactory = $jsonResultFactory;
        $this->_session = $session;
    }

    public function beforeSaveAddressInformation(
        \Magento\Checkout\Model\ShippingInformationManagement $subject,
        $cartId,
        \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation

    )
    {
    $objectManager =   \Magento\Framework\App\ObjectManager::getInstance();
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $items = $this->_session->getQuote()->getAllVisibleItems();
    $address = $addressInformation->getShippingAddress();
    $postcode = $address->getData('postcode');
    $result = $this->jsonResultFactory->create();
    $resulta = [];
    $pid='';
    if (count($items) > 0){
        foreach ($items as $item)
            $resulta= $item->getName();
            $pid=$item['product_id'];
            $carttotal=$item['grand_total'];
            $weight=$item['weight'];
         $sql ="SELECT ca.postcode FROM
           mgcb_marketplace_product mp
           JOIN mgcb_marketplace_userdata mu ON mp.seller_id = mu.seller_id
           JOIN mgcb_customer_entity ce ON mu.seller_id = ce.entity_id
           JOIN mgcb_customer_address_entity ca ON ce.entity_id = ca.parent_id
           WHERE(mp.mageproduct_id = '$pid')";
        $qryresult = $connection->fetchAll($sql);
        foreach ($qryresult as $qryresult)
    {
        $pikup=$qryresult['postcode'];

          //Some code using Api here

       $result = json_decode($respon);
       foreach($result as $object) {
       $stat = $object->status;
      if($stat=="NO SERVICE AVAILABLE")
      {
         //Here i need to redirect to the cart page from checkout By displaying some message
        throw new StateException(__('Shipping is not available on the provided zipcode.'));
     }
    }
    }
    }

}
}

also i need to print the success and error message in the front end


texts: how to order products in related.phtml and item.phtml by specific attribute?

texts:
related.phtml is in

app/design/frontend/enterprise/default/template/targetrule/catalog/product/list/related.phtml

I wanted to order the products by sku  in app/code/core/Enterprise/targetRule/Block/Product/Abstract.php we have a getItemcollection which will be used in related.phtml and it is so weird that it gets a position behavior and the position behavior is abstract protected and I cannot understand it, more over I tried to write a function to sort the $this->_items array by sku but the problem is that it's data is protected and I don't know how to call it

here is what I did in abstract.php:

public  function orderProductItemsByModel()
    {
        if (!is_null($this->_items)) {
            if ($this->isShuffled()) {
                // shuffling assoc
                $ids = array_keys($this->_items);
                shuffle($ids);
                $items = $this->_items;
                $this->_items = array();
                foreach ($ids as $id) {
                    $this->_items[$id] = $items[$id];
                }
            } else {

           usort($this->_items, "sort_by_sku");
            }
            $this->_sliceItems();
        }
        return $this->_items;
    }
function sort_by_sku($a, $b) {
    return strcmp($a["data"]["sku"], $b["data"]["sku"]);
}

the problem is $a["data"]["sku"] I think I cannot get the data if you have idea about getData() function would you please let me know what i should use?

so it is not working here is print_r of $this->_items:

Array
(
    [3446] => Mage_Catalog_Model_Product Object
        (
[_data:protected] => Array
                (
                    [entity_id] => 44444
                    [entity_type_id] => 4
                    [attribute_set_id] => 4
                    [type_id] => simple
                    [sku] => BC4R

I don't know id I should change item.phtml or I went my way correct

Thanks in advance


texts: magento-salesforce integration with coupons

texts:
I am new to this forum but look forward to hearing from you!

We are having a company integrate Magento and Salesforce. The company is telling us that there is no way for them to have the sales price of the line item changed when a coupon is used since it's not stored at that level. They can change the total online price (stored on Opportunity level) only.

Does anyone have experience with this issue?

Thanks!
Sara


texts: When a customer changes the custom data from his account page , on the main page returns the old data, but in the database it changes , Thank You


texts: Item with the same id "2011" already exist

texts:
I am getting this error when i try to sign in as a customer.
What is the reason behind this. I checked there is no duplicate entry for the record id 2011.
See error in details here https://prnt.sc/skxonz

I am using MAgento 1.9.4.4.
Please help


texts:
I need to add the possibility a customer can create products like for admin or other system users.

Is it possibile or is there a plugin ?

Thanks


texts: Setting up the english transaction emails

texts:
So I started my Webstore in greece. Now I want to sell products in UK . So I already installed my language package and the default transaction  emails got replace by the greek one. How do I get the english ones back and actually send them, when my customer picks english as shop language? (At the moment he will still get the greek emails)

I'm using Magento 1.9 + and rwd theme. Thank you


texts: Magento 2 - Authorize.net payment failed in live mode

texts:
I am facing a problem with authorize.net payment gateway method since we are aware that authorize.net has removed md5 and provided a signature Key field. Hence I have implemented the authorize.net patch also. When I have tested with a sandbox account its working fine but with Live credential account, it throws following exception.

[2019-04-10 20:32:48] main.CRITICAL: The transaction was declined because the response hash validation failed. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): The transaction was declined because the response hash validation failed. at /vendor/magento/module-authorizenet/Model/Directpost.php:539)"} []

Below is the screenshot of Authorize.Net configuration setting.

If any buddy has the same issue. Please help me.


texts: Magento 2.3.3 -Load Custom Jquery after the Shipping Form load

texts:
I have added jquery on other click events they are working fine but when i am trying load jQuery after the Shipping page load.
 I want to hide my custom added fields in shipping page but they are not working
this is my custom field.

 $("[name='customCheckoutForm.checkout_purchase_order_no']").css('display','none');
 $("[name='customCheckoutForm.checkout_buyer_name']").css('display','none');

i have tried many methods like:

        $("#checkoutSteps").load(function(){     $("[name='customCheckoutForm.checkout_purchase_order_no']").css('display','none');
            $("[name='customCheckoutForm.checkout_buyer_name']").css('display','none');});

2.

$(document).ajaxComplete(function() {

            alert("ajaxCompleted ;)")
        }

and much more but did not worked for me.
Please help me to get out of it.


texts: Magento 2 - Custom sort order not working properly

texts:
I have created a custom plugin for sorting options for high to low & low to high price. High to low sort works fine but "low to high" sort order not showing correct results.

app/code/Digital/CustomSort/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
    <plugin name="digital_customsort_block_product_productlist_toolbar" type="Digital\CustomSort\Plugin\Catalog\Block\Product\ProductList\Toolbar" />
    </type>
    <type name="Magento\Catalog\Model\Config">
        <plugin name="digital_customsort_model_config" type="Digital\CustomSort\Plugin\Catalog\Model\Config" />
    </type>
</config>

app/code/Digital/CustomSort/Plugin/Catalog/Model/Config.php

<?php
//namespace Digital\CustomSort\Plugin\Model;
//class Config extends \Magento\Catalog\Model\Config

namespace Digital\CustomSort\Plugin\Catalog\Model;
use Magento\Catalog\Model\Config as CatalogConfig;

class Config
{
    public function afterGetAttributeUsedForSortByArray(CatalogConfig $subject, $result)
    {
        $result['low_to_high'] = __('Price - Low To High');
        $result['high_to_low'] = __('Price - High To Low');
        return $result;
    }
}

Digital/CustomSort/Plugin/Catalog/Block/Product/ProductList/Toolbar.php

<?php
 //namespace Digital\CustomSort\Plugin\Block\Product\ProductList;
 //class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar

namespace Digital\CustomSort\Plugin\Catalog\Block\Product\ProductList;

use Magento\Catalog\Block\Product\ProductList\Toolbar as ProductListToolbar;

class Toolbar
{
    public function afterSetCollection(ProductListToolbar $subject, $result, $collection)
    {
        switch ($subject->getCurrentOrder()) {
            case 'low_to_high':
                return $result->getCollection()->setOrder('price', 'asc');
            case 'high_to_low':
                return $result->getCollection()->setOrder('price', 'desc');
            default:
                return $result;
        }
    }
}


texts: Have anybody integrated Klaviyo server APi with Magento2 for custom event?

texts:
I want to send custom data for particular klaviyo custom event using server side api.
I have checked the Magento2 Klaviyo_Reclaim module. But there is only reference for java script API.
Can anyone please help me.


texts: How to get attribute value from magento compare list?

texts:
First of all thanks for your help, until now I never needed to write anything here, but I wasn't able to find any answer to this.

I have a compare list in a Magento Store and I want to compare all the items with the same 'name' attribute.

In other words, when I click to the comparison button to add the Product X, I want to see all the products with the same NAME as Product X in the comparison list.

Anyonw knows how to do that?

Thanks!


texts: How to implement lazy loading in checkout cart page ?


texts: What is the "handle" for and where all handle are listed in magento2?

texts:
I have seen in many layout files with different handle in magento2:

like:

          <update handle="editor">
          <update handle="default"/>

and many more

So what is for the handle and where handles are defined?

I have read many blogs and question about handle but not exactly understood  functionality of it.


texts: Migrate Magento 1.7 separate store to Magento 2 multistore (just customers and history)

texts:
We need to migrate the Customers and Orders History from Magento 1.7 to a Multistore Magento 2.

I was using the migration tools and tried to migrate at least the customers:

  <steps mode="data">
    <step title="Customer Attributes Step">
        <integrity>Migration\Step\Customer\Integrity</integrity>
        <data>Migration\Step\Customer\Data</data>
        <volume>Migration\Step\Customer\Volume</volume>
    </step>
  </steps>

But I was unsuccessful.

Though, the migration output was successfully:

$php bin/magento migrate:data /fullpath/vendor/magento/data-migration-tool/etc/ce-to-ce/1.7.0.0/config.xml

    [2017-05-22 08:59:21][INFO][mode: data][stage: integrity check][step: Customer Attributes Step]: started
    [2017-05-22 08:59:21][INFO][mode: data][stage: setup triggers][step: Stage]: started
    [2017-05-22 08:59:21][INFO][mode: data][stage: data migration][step: Customer Attributes Step]: started
    [2017-05-22 08:59:21][INFO][mode: data][stage: volume check][step: Customer Attributes Step]: started
    [2017-05-22 08:59:21][INFO][mode: data][stage: volume check][step: Customer Attributes Step]: Migration completed%

There is no customer records in admin panel

I have already a couple of days of struggling but I'm keep getting dead ends. Please help me to solve issue.

Maybe it is better to migrate first everything in a Multistore? What do you think?

Update

Sadly, I didn't receive any feedback to this problem.

So, I decided to take a longer run, not sure if it will get me to the end result though:

Configured a Magento 2 multistore websites with all 4 websites + stores.
I started to migrate every Magento 1.7 store into a separate Magento
2 store. That means for all 4 stores of Magento 1.7 I ended up with
another 4 stores of Magento 2.
Then I exported the customers:  Systems > Export > Customer Main File to a CSV file, edited the CSV file to reflect the Website Id and store ID I was importing to.

Now, the next point on the Agenda:  How to migrate the sales Data or at least just the orders history???!!

If anyone has any any suggestion please give a hand of help - and I'll be for ever grateful :).

Thank you.


texts: how to hide minicart content if subtotal is greater than $100000 in magento 2?

texts:
I am trying to restrict customer cart value to $100000.If customer cart value reach $100000, then i want show one message in minicart and hide proceed to checkout,view cart buttons. Is there any way to achieve that.
please help me.

Thanks in advance


texts: Override constructor of vender/magento/module_caltalog/block/ Block in magento 2

texts:
I am trying to get product list from specific category id.
i am using magento 2.2.1 version.

below are my code of
Block File : view.php
i want to override this file from vender.

Here is my custom module :

app\code\Narola\Magentocatalog\Block\Category\View.php

namespace Narola\Magentocatalog\Block\Category;
class View extends \Magento\Catalog\Block\Category\View
{
  protected $_productCollectionFactory;
  protected $_categoryFactory;

  public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    \Magento\Catalog\Model\CategoryFactory $categoryFactory,
    array $data = []
  ) {
    $this->_categoryFactory = $categoryFactory;
    $this->_productCollectionFactory = $productCollectionFactory;
    parent::__construct($context, $data);
}

public function getSubcategory($catId)
{
    $objectManagerr = \Magento\Framework\App\ObjectManager::getInstance();
    $categoryFactory = $objectManagerr->create('Magento\Catalog\Model\ResourceModel\Category\CollectionFactory');
    $collection = $categoryFactory->create()
    ->addFieldToFilter('parent_id', $catId)
    ->addAttributeToSelect('*');
    return $collection;
}

public function  getSubcategory_product($sub_catid){
    $category = $this->_categoryFactory->create()->load($categoryId);
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*');
    $collection->addCategoryFilter($category);
    $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
    $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
    return $collection;
}
}

==============================

Here when i add constructor i am getting below error.

Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Category\View::__construct() must be an instance of Magento\Catalog\Model\Layer\Resolver, array given, called in C:\wamp64\www\magento_221\app\code\Narola\Magentocatalog\Block\Category\View.php on line 18 and defined in C:\wamp64\www\magento_221\vendor\magento\module-catalog\Block\Category\View.php on line 45

If any one has solution regarding this then please provide me.


texts: Magento 2 custom field not added to the existing table

texts:
I made a Magento 2 module for adding an extra column product_custom_type into an existing table sales_order_item

I run the upgrade script with this command

php bin/magento setup:upgrade

the last output i got was "Upgrading schema...", then command quits.

This is my UpgradeSchema.php

namespace Scandesigns\ProductType\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

class UpgradeSchema implements UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        if (version_compare($context->getVersion(), '2.0.1') < 0) {
            $setup->startSetup();
            $setup->getConnection()->addColumn(
                $setup->getTable('sales_order_item'),
               'product_custom_type',
               [
                   'type' => \Magento\Framework\DB\Ddl\Table::TYPE_STRING,
                   'length' => '256',
                   'nullable' => false,
                   'default' => '',
                   'comment' => 'product custom type'
               ]
           );
           $setup->endSetup();
        }
    }
}

Did I do anything wrong in the code?


texts: Magento 2 : "Add All to Cart" button disable when one product "outofstock" in wishlist page

texts:
One product "Outofstock" and save in wishlist then after, when after login in wishlist form click on "Add All to Cart" button.
But it's not working because of "Outofstock" product in wishlist. So how can remove when if any one "Outofstock" product in wishlist, "Add All to Cart" button is disabled.

Note : Outofstock product need to add in wishlist.


texts: There's 'Default' attribute set in the default Magento installation. You have no ability to remove that attribute set using admin gui (Remove button is hidden for this set). I did not found something like system flag or other singularities for this set in eav_attribute_set. I need an ability to detect this attribute set's id programmatically in different installations. Maybe someone faced with task like this one and could give me the clue. Thanks


texts: Magento 2 How to generate button dropdown

texts:
I am new with Magento 2 and web development. I don't understand how to create dropdown button.
I saw some style in below website and I am not sure how to use it.
http://www.bergo.nl/pub/static/frontend/Magento/blank/en_US/css/docs/dropdowns.html
I have button.phtml file in templates/product/view
And put the below code but It is not working.

<button class="action toggle"
        data-mage-init='{"dropdown":{}}'
        data-toggle="dropdown"
        aria-haspopup="true">
    button + dropdown
</button>

        One

        Two

        Three

Does anyone know how to add dropdown and what would be the best practice to implement?
Thank you.


texts:
I have create a programmatically order and set programmatically discount amount but i have getting error when submit order.
Here is exception message :

DEBUG (7): ====ex==exception 'Exception' with message 'Quote totals must be collected before this operation.' in /home/xyz/public_html/testing/app/code/core/Mage/Sales/Model/Quote.php:1861
Stack trace:
#0 /home/xyz/public_html/testing/app/code/local/Mage/Sales/Model/Service/Quote.php(326): Mage_Sales_Model_Quote->prepareRecurringPaymentProfiles()
#1 /home/xyz/public_html/testing/app/code/local/Mage/Sales/Model/Service/Quote.php(223): Mage_Sales_Model_Service_Quote->_submitRecurringPaymentProfiles()
#2 /home/xyz/public_html/testing/app/code/local/Mage/Sales/Model/Service/Quote.php(238): Mage_Sales_Model_Service_Quote->submitNominalItems()
#3 /home/xyz/public_html/testing/app/code/local/Assel/StoreOwners/controllers/SalesorderController.php(364): Mage_Sales_Model_Service_Quote->submitAll()
#4 /home/xyz/public_html/testing/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Assel_StoreOwners_SalesorderController->submitOrderAction()
#5 /home/xyz/public_html/testing/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('submitOrder')
#6 /home/xyz/public_html/testing/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /home/xyz/public_html/testing/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#8 /home/xyz/public_html/testing/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /home/xyz/public_html/testing/sellertesting.xyz.com/index.php(385): Mage::run('sellerwebsite', 'website')
#10 {main}

Please can anyone suggest me.


texts: Few page titles suffixed(appended) by a keyword

texts: I have a strange problem. Few page titles are suffixed(appended) by a specific keyword called "Salwar Kameez". When i open the page the page title in the browser doesn't have the appended keyword. I am not sure where it is coming from. Default html head is empty in my case.


texts: Auto display the sucategories products in parent counter without "is anchor" option>?

texts: is it possible to auto display the subcategories products sum in the parent category counter in magento without using the "Is Anchor" option from the admin panel. As this assigns the subcategories products to the parent but leave the subcategories as the filters.I am only wanted the show the sum of subcategories products counter in the parent category.


texts: Magento 2 how to validate form and display error message below input field

texts:
In magento 1.x we use the following code to validate Magento forms:

I am using this code from the magento 2 contact form:

  Email

      <input name="email" id="email" title="Email" value="" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}" aria-required="true">

My question is: how do I validate a custom form in Magento 2?


texts: Magento 2 How can i remove coupon code from checkout

texts:
I'd like to remove coupon code from the last step of the checkout "Payment and Review".

I have a custom theme with checkout_index_index.xml in Magento_Checkout/layout folder.

Thank you


texts: Magento2: How to get config variable in block.php

texts:
I want to get the value of config variable in my custom block.php file.

Can somebody help me in this?

So far, I did following this in my block file.

public function __construct(
     \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
     \Magento\Store\Model\StoreManagerInterface $storeManager
)
{
    $this->_scopeConfig = $scopeConfig;
    $this->_storeManager = $storeManager;
}

$this->_scopeConfig->getValue('carriers/freeshipping/free_shipping_subtotal', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

But I'm still not getting the value and showing error

  ( ! ) Fatal error: Uncaught Error: Call to a member function
  dispatch() on null in
  D:\wamp64\www\deboomhut0710\lib\internal\Magento\Framework\View\Element\AbstractBlock.php
  on line 644 ( ! ) Error: Call to a member function dispatch() on null
  in
  D:\wamp64\www\deboomhut0710\lib\internal\Magento\Framework\View\Element\AbstractBlock.php
  on line 644


texts: Magento2 get all product review details by product sku?

texts:
In Magento 2 how to get all the product reviews by product SKU.

Please find the screenshot below.

please provide/suggest me how to get.

I have written some test code:

<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

ini_set('display_errors', 1);
echo "All reviews of the product </br>";

$sku ='24-MB04';
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
/** @var \Magento\Catalog\Model\Product $product */
$productObject = $objectManager->get('Magento\Catalog\Model\Product');
$storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
$currentStoreId = $storeManager->getStore()->getId();
$product = $productObject->loadByAttribute('sku', $sku);


texts: Call to Magento load() to load a model is slow the first time, fast in subsequent calls?

texts:
We have a program where we are trying to import Customers and Orders using php into Magento from a non-Magento system via csv files.

In a loop we call this function to get a customer model of previously imported customers so that we can attach the current order (from the csv file) to the correct customer:

$customers = Mage::getModel('customer/customer')
               ->getCollection()
               ->addAttributeToSelect('*')
               ->addAttributeToFilter('old_customer_id', $data['SessionID'])
               ->load();

The load of the customer model happens fine, that is not the issue.  Our previously imported customers are all there.  The issue is that the customer model load above takes about one second each time it's called in the loop that reads the order records from a csv file, which is slow. But the second time we run the program, any customer that was loaded during a previous run loads very quickly, orders of magnitude faster.

Does Magento cache customers during a load() operation or index them or something that causes the second load to be much faster than the first?

If so, can we pre-cache or index customers by the attribute we are searching on 'SessionID' in order to make the customer model load faster?

There are about a million order records to process in the csv file so we need to get better performance to make this approach viable.


texts: How do i make my 'About Us' page into 2 columns

texts:
Ive tried selecting the option to have my text into two columns but once i save it, it doesn't seem to change anything. Im not very familiar with coding please someone help.

This is was my text looks like

About Us

&nbsp;

Welcome to Come September, a place for beautiful clothing, unique jewellery and other fashion accessories.

&nbsp;

Fashion is an art. Not only is it art, but it is an important and powerful. It encompasses texture, form, shape, colour, and more. The fashion we choose, shows the world who we are and who we want to be.&nbsp;&nbsp;It makes us stand out from the crowd, and helps us tell our story. Our clothing range start at size 8 and goes through to size 26.

Come September takes this self-expression seriously. We know you take your reputation, your image, and your comfort very seriously (not to mention your wallet!) That's why we search for and offer you only the most carefully chosen fashion clothes and accessories at only the best prices.

Remember &ndash; accessories are just as important as the clothes on your body and the shoes on your feet. Fashion accessories and bags have the ability to elevate and transform an outfit &ndash; ultimately allowing you to spend less money by updating existing clothing you already own. Not only that &ndash; but fashion accessories, from bracelets to hair accessories, help you to punctuate your style by adding a bit of glitz or drama.

Here you can choose from great-looking, affordable clothes, jewellery, handbags/clutches, hair accessories, clothing, and formal&nbsp;&nbsp;accessories. We are always thoughtfully updating what we offer &ndash; keeping an eye on trends while always maintaining an appreciation for the classics.

Enjoy looking through what we have. We'll help you build a collection of clothing and accessory staples from which you can draw every time you get dressed in the morning. Pieces you can come back to again and again. Pieces that make a statement about who you are, and who you'd like to be. Of course it's what's inside that matters, but we all need a little help to shine!

Melissa Greggery

``


texts:
Is there any method in magento can sell a product A ($30) and B ($30) in total price in $55? i had tried bundle product, but there is a drop-down, checkbox, multi-selection, radio-button something like that i must have to set, it forces customer to choose, but it is not need for my case.

i only need to sell a couple of product in single price, with "no selection", "no quantity box".

any ideas?