texts: Magento eliminating child products to get applicable price

texts:
I have a script that dynamically retrieves price of configurable products that I have written, and now I am going back and making sure that it takes into account any configurable attributes that there may be. The following is called via ajax and I have debugged it down to the most central part of the loop (therefore all magento methods are working). It should be removing children that do not match the attributes. The end goal is to have one child left, and echo the price. Each child DOES contain a unique price (this I know). Can you see why this is not working right now?

<?php
require_once('/var/www/Staging/public_html/app/Mage.php');
umask(0);
Mage::app();

$product_id = $_POST['productID'];
$optionSelectionArray = $_POST['optionSelectionArray']; //the ids of configurable options selected

//var_dump($optionSelectionArray);

$product =  Mage::getModel('catalog/product')->load($product_id); // no need to use the _ here, it's not protected/private; additonally Mage::registry won't work because you're technically not on a product detail page
$attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);

//Gather all attribute ids for given product
$availAttrs=[];
foreach($attributes as $attribute){
        $availAttrs[] = $attribute->getAttributeId();
}

foreach($availAttrs as $attr){//cycle available attributes
        foreach ($optionSelectionArray as $key => $value) {//cycle option for key
            if ($attr == $key){//if available attribute and key of optionSelectionArray match
                for($i=0; $i<sizeof($childProducts); $i++){//for each child in children
                    //get label of attribute code
                    foreach($attributes as $attribute){
                        if ($attr == $attribute->getAttributeId()){
                            $attrName = strtolower($attribute->getLabel());//get code name from attribute id
                        }//end if attribute matches attribute id
                    }//end attributes cycle

                    //CAITLIN LEFT OFF echoing the next line here to see if it is doing what it should

                    if($childProducts[$i]->getData($attrName) != $value){
                        array_splice($childProducts, $i, 1);
                    }//end if attribute values match
                    else{
                        echo("This is a match! : ");
                        echo('The vendor is ' . $childProducts[$i]->getData('vendor'). ";");
                        echo (" The price is " . $childProducts[$i]->getPrice());
                    }
                }//end childproducts loop
            }//end if
        }//end foreach optionSelectionArray
    }//end foreach availattrs

//Echo final price $childProducts[0]
?>


texts: Magento2 Best practice to edit layout xml file

texts:
Suppose that I want to edit the file

  vendor/magento/module-theme/view/frontend/layout/default.xml

Do I edit the file directly?

It seems not a best practice to me.

Or is there anyway I can extend the file to override the content.


texts: How to use owl carousel for my category wise product on home page in mageno2?

texts: Hello I want to display My Category's product in owl carousel, i already display product on homepage but i want that product in my owl carousel slider please help me without using any extension please help me.


texts: The error is coming from form-mini.js. I used two search boxes in  my theme. they are conflicting so i changed their id. but problem is the auto suggestion is not working. It is enabled from back-end but still not working


texts: How to override cartcontroller in magento 2?

texts:
I want to override cartcontroller(checkout/controller/cart.php) by my module controller. Can anyone help me please? Any help will be appreciated.

I just tried, But it is not working. My files are,

\code \StwBuyXGetY \BuyXGetY \etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Controller\Cart"
             type="StwBuyXGetY\BuyXGetY\Controller\Checkout\Cart" />
</config>

\code \StwBuyXGetY \BuyXGetY \Controller\Checkout\Cart.php

<?php
namespace StwBuyXGetY\BuyXGetY\Controller\Checkout;
class Cart extends \Magento\Checkout\Controller\Cart
{
    public function execute(){
        echo 'Hello World'; exit;}
}

Please help. (Note:- I just put the dummy content in cart.php, this is not the actual function.)


texts:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category

I have a debug got the null value


texts: Checkout problem after upgrade to 1.9.2.3

texts:
2 problems on onepage checkout:1. I have to enter login details twice -
first time it stays there and blanks the fields when I press the 'Login. button
2. When it does login it takes me to the customers account page and not to the
next step in checkout.3. The site is [australianplantsonline.com.au][1]
Please help !!!!![1]: http://australianplantsonline.com.au


texts: Magento 2 : Order/Invoice/Shipment Grid Data Not Migrate

texts:
I try to migrate data from Magento 1.9.3.7 to Magento 2.2.4 using data-migration-tool. I follow all steps provide here : http://devdocs.magento.com/guides/v2.0/migration/migration-migrate-data.html

All data migrate successfull except this.

Order Grid Table
Invoice Grid Table
Shipment Grid Table
Creditmemo Grid Table

I check into database of magento2, all the tables are empty.

Any one have idea what to do?


texts: magento get products only works with disabled Flat Catalog Product

texts:
we would like to check if products exists with the following code:

$foundProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);

We only get positive results if "Use Flat Catalog Product" is disabled in the configuration.


texts:
I am running Magento 1.9.0.1 version . The issue is with my categories. When I click on a category to edit it, it shows as a new category. When I did an inspect element on my chrome browser, I found out that there is a 403 forbidden message.

http://brandsbay.com/skin/adminhtml/base/default/themeoptions.css Failed to load resource: the server responded with a status of 404 (File not found)
    http://brandsbay.com/index.php/admin/catalog_category/edit/key/33951b31670aafc3d81e07e1d9be4f47/?isAjax=true Failed to load resource: the server responded with a status of 403 (Forbidden)
    http://brandsbay.com/skin/adminhtml/base/default/themeoptions.css Failed to load resource: the server responded with a status of 404 (File not found)


texts: How can i detect numbers of color's available for a product

texts:
I have an issue in my project where color swatches are comming in proper way for desktop. But while in mobile I have added an icon where more color options are available. But it showing each product in mobile.

I need to add an icon by availability of color swatch. I don't know how to detect color options available for the product.

If any other way to solve this problem please help.


texts: How to increase the quality of product photos JPG (Magento 2.1)

texts: The JPG compression on Magento 2.1 is very strong, so that the quality of product images get really bad in Catalog and Product view. How can I change the Image compression for JPG's in Magento 2.1 ?


texts: magento1.9: 502 bad gateway when saving shipping addresses

texts:
I'm trying to save shipping address in my Magento form, but When I got 502 Bad gateway error happening.
my shipping address code

      protected function saveAddress($oid)
{

   $order= Mage::getModel('sales/order')->load($oid);
    $cusId = $order->getCustomerId();
    $cus = Mage::getModel('customer/customer')->load($cusId);
    $ShipAdd = $order->getshipping();
    $shipping = Mage::getModel("customer/address")->setId($cus->getDefaultShipping());
    $shipping->setCustomerId($cus->getId());
    $shipping->setPrefix($ShipAdd->getPrefix());
    $shipping->setFirstname($ShipAdd->getFirstname());
    $shipping->setLastname($ShipAdd->getLastname());
    $shipping->setCountryId(self::BE_COUNTRY_CODE);
    $shipping->setPostcode($ShipAdd->getPostcode());
    $shipping->setCity($ShipAdd->getCity());
    $shipping->setStreet($ShipAdd->getStreet());
    $shipping->setTelephone($ShipAdd->getTelephone());

     try {
        $shipping->save();
    } catch (Exception $e) {
        Mage::logException($e);
    }
    }

Any help will be appreciate


texts: How to add custom field in checkout step

texts:
I'm trying to find a tutorial which show me how to add custom field to one page checkout page in magento 1.9.1 version.
I tried to use This Turorial but it's quite old and not working, i see the field and everything but my custom field in database is empty.
Maybe somebody have working tutorial for magento 1.9  ?

Thanks for all replies


texts: How to call phtml file from custom theme to cms block

texts:
I have created a custom block using Magento 2 UI, I know that I can't have any PHP in the block so I have created a test.phtml file and added it to my custom theme on the server.

Now, I want to call that block but can't figure out what path it will be.

The location of the test.phtml is following:

app/design/frontend/CustomTheme/CustomChild/Custom_Themesettings/templates/html/test.phtml

How should I call this test.phtml file in my block? I got something like this but it's not working:

{{block type="core/template" template="app/design/frontend/CustomTheme/CustomChild/Custom_Themesettings/templates/html/test.phtml"}}


texts:
In Local , all css and js files have the url start form https:// but i want http://. where to change it .

Thanks.


texts: Install sample data using Composer - Command prompt hangs when asked for password

texts: I'm trying to install Magento2 using composer but when i'm prompted to add my private key the command prompt hangs, not letting me enter my private key.


texts: How to edit sales_order AdminHtml template

texts:
i want to edit sales_order listing view to add new column but i can not find that template to edit.

i want to edit .phtml file not Block

this is url that i want to edit on it

http://localhost/ProjectName/index.php/admin/sales_order/


texts: Not Able to see All Product In Shopping cart in magento Dashboard

texts: Kindly check attached Snap-shot , which in under Shopping cart Its showing 98 Items but, I m not able to see all, it showing only 15 to 20 , and there is no Drop-down or pagination, pl help to solve this issue .


texts:
I have this form where validation for upload file works but validation for dropdown isn't working.

    <form name="designer-upload" class="designer-uploads form-group" id="designer-upload" action="<?php echo Mage::getUrl('designerr/account/upload/'); ?>" method="post" enctype="multipart/form-data">

                <?php $_helper = Mage::helper('catalog/category') ?>
                <?php $_categories = $_helper->getStoreCategories() ?>
                <?php $currentCategory = Mage::registry('current_category') ?>
                <?php if (count($_categories) > 0): ?>

                        <?php echo $this->__('Category') ?>
                        <select class="input-text required-entry" name="drp_category" id="drp_category" >
                            <option><?php echo $this->__('Please Select') ?></option>
                            <?php
                            foreach ($_categories as $parent) {
                                echo '<option value="' . $parent->getId() . '">' . ucfirst($parent->getName()) . '</option>';
                            }
                            ?>
                        </select>

                <?php endif; ?>

                    <?php echo $this->__('Subcategory') ?>
                    <select class="input-text required-entry" name="drp_subcategory" id="drp_subcategory" >
                        <option><?php echo $this->__('Please Select'); ?></option>

                    </select>

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

                    <input name="MAX_FILE_SIZE" type="hidden" value="2000000"  />
                    <input name="attachment" id="attachment" class="input-text required-entry " type="file" />

            <input type="submit" name="submit" value="<?php echo $this->__('Submit') ?>" class="button" />

    </form>


texts:
I am trying to configure the dhl module in magento (not depricated), but I have this error in the log file

2015-02-19T09:00:35+00:00 DEBUG (7): Array
(
    [1000] => Error #1000 : The requested Global Product Code  and Local Product Code  is not available based on origin country US postal location and destination country US postal location for payment country US. Please make sure data entered is valid before proceeding or contact our customer service.
    [__pid] => 1672
)

My configurations for the shop are -
Country: United states |
City: Madera |
Zip: 93637

Any idea why I had this error?


texts:
I uninstalled MageWorx SEO extension and I am experiencing the following error.

Class MageWorx\SeoBase\Model\Source\CrossDomainStore does not exist

Checking the error report, I get this

{"0":"Class MageWorx\\SeoBase\\Model\\Source\\CrossDomainStore does not exist",

How do I fix this?


texts: DIsplay full Order Summary on shipping steps while select shipping method

texts: I need to show Order summary with Total and subtotal on shipping steps based on select shipping method. It displays like payment step. if change shipping method it will change subtotal and total on shipping steps.


texts: Migration fails with "Notice: Undefined offset: 1"

texts:
I am trying to migrate data from M1 to M2 using the data migration tool. I am using version 1.9.3.10 of M1, and 2.3.0 of M2.

I am using this info to clear my M2 database before the migration and have run this query on M1 to avoid duplicate keys:

update  eav_attribute_set set
    attribute_set_name=concat(attribute_set_name, '_', entity_type_id)
    where attribute_set_name = 'Default';

Still, I get this error:

[magento@host m2_root]$ php71 bin/magento migrate:data --reset  --auto
    vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.10/config.xml

...
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:43:59][INFO][mode: data][stage: integrity check][step: Log Step]: started
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:43:59][INFO][mode: data][stage: integrity check][step: Ratings Step]: started
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:43:59][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:43:59][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:43:59][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:43:59][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:43:59][INFO][mode: data][stage: integrity check][step: Inventory Step]: started
[2019-01-30 08:43:59][INFO][mode: data][stage: setup triggers][step: Stage]: started
100% [============================] Remaining Time: < 1 sec
[2019-01-30 08:44:00][INFO][mode: data][stage: data migration][step: EAV Step]: started
42% [============>---------------] Remaining Time: < 1 sec
In ErrorHandler.php line 61:

  Notice: Undefined offset: 1 in /var/www/html/m2_root/vendor/magento/data-migration-tool/src/Migration/Step
  /Eav/Data.php on line 292

migrate:data [-r|--reset] [-a|--auto] [--] <config>

I searched a lot about this, but no success. Is there perhaps another way to migrate data?


texts: How to add tables to database with foreign key?

texts:
I'm trying to extend costumers to add some wholesale info we need, so I'm trying to create a module with an InstallSchema to create, let's say, the table 'wholesale_info' with some columns and getting the user ID from 'customer_entity'.
What I've done so far is
<?php

namespace Custom\AddUser\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface {

    public function install( SchemaSetupInterface $setup, ModuleContextInterface $context ) {
        $installer = $setup;

        $installer->startSetup();

        $table1 = $installer->getConnection()->newTable(
            $installer->getTable('Wholesale_Customer')
        )->addColumn(
            'customer_id',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            '2M',
            ['nullable' => false],
            'Customer Id'
        )->addColumn(
            'num_colb',
            \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            null,
            ['nullable' => true],
            'Collaborators'
        )->addColumn(
            'website',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => true],
            'Website'
        )->addColumn(
            'facebook',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => true],
            'Facebook'
        )->addColumn(
            'instagram',
            \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
            255,
            ['nullable' => true],
            'Instagram'
        );
        $installer->getConnection()->createTable($table1);

        $installer->endSetup();
    }
}

This does nothing, if I try to run set:up this just gives an error.
I've seen some tutorials but the more I see the more I get confuse with this.
Any help? :D
Thanks in advance,
Best regards,
Rui Silva


texts: How to set up different inventory options for each website?

texts:
I have one Magento installation that has two websites: retail and wholesale. I have one catalog and I sell the same products in both websites.

In retail shop it's ok to sell one product at time, but at the wholesale shop it should only be possible to order at least 5 of the same product at once.

The Magento's inventory options are global. Is there a way to make them website specific?


texts: Few product restrict for specific countries

texts:
I want to restrict some products to sell in a particular country, Not all products.

Can you please suggest me how to achieve it?


texts: JSON request to controller giving error invalid form key

texts:
I have a custom module with a button in the admin that i want to call a controller class on click. My phtml file contains this JavaScript :
<script type="text/javascript">
    require(["jquery"],function($) {
        $('#savePricing').click(function() {
            var customurl = "XX/Pricing/Controller/SaveFamilyPriceChanges";
            $.ajax({
                url: customurl,
                type: 'POST',
                dataType: 'json',
                data: {},
            complete: function(response) {
                var status = response.responseJSON.status;
                console.log(status);
                },
                error: function (xhr, status, errorThrown) {
                    console.log('Error happens. Try again.');
                }
            });
        });
    });
</script>

here is my XX/Pricing/Controller/SaveFamilyPriceChanges.php
<?php
namespace XX\Pricing\Controller;

use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Customer\Model\Session;

/**
 * Class SaveFamilyPriceChanges
 * @package XX\Pricing\Controller
 */
class SaveFamilyPriceChanges extends \Magento\Framework\App\Action\Action
{
    /**
     * @var JsonFactory
     */
    private $resultJsonFactory;
        /**
     * @var Session
     */
    private $customerSession;

    /**
     * @param JsonFactory $resultJsonFactory
     */
    public function __construct(
        JsonFactory $resultJsonFactory,
        Session $customerSession
    ) {
        $this->resultJsonFactory = $resultJsonFactory;
        $this->customerSession = $customerSession;
    }

    /**
     * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\Result\Json|\Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $response = $this->resultFactory
             ->create(\Magento\Framework\Controller\ResultFactory::TYPE_JSON)
             ->setData([
                 'status'  => "ok",
                 'message' => "form submitted correctly"
             ]);

        return $response;
    }
}

When i click the button i am getting :

{"error":true,"message":"Invalid Form Key. Please refresh the page."}


texts:
I want to read customer email and ID for a tracking purpose. My script is as below.

<?php
$_email = '';
$_customer = Mage::getSingleton('customer/session')->getCustomer();
if($_customer->getEmail()){
    $_visitorId = $_customer->getId();
    $_email = $_customer->getEmail();

}else{
    $_visitor = Mage::getSingleton('core/session')->getVisitorData();
    $_visitorId = $_visitor['visitor_id'];

}
?>
<!-- Initialize RDK -->
<script type="text/javascript">
window.sfrdk('_setConfig', {
    visitorId: '<?php echo $_visitorId ?>',
    email: '<?php echo $_email ?>'
});
</script>

This tracks the customer email in my account page but does not track in the product detail/list pages

Any idea?


texts: Pre filter datasource for Magento 2 custom grid

texts:
I have 2 grid that i want to use in my custom module, the first grid have actions column that have link to access the second grid, the problem is i want to load data in second grid (listingproduct) based on the first grid primary id which will be send via url like this:

                    'lazada' => [
                        'href' => $this->urlBuilder->getUrl(
                            'test_lazada/listingproduct/index',
                            [
                                'listing_id' => $item['listing_id']
                            ]
                        ),
                        'label' => __('List')
                    ]

it will generated lnk like this:

localhost/admin/lime_lazada/listingproduct/index/listing_id/<listing_id>/key/<form_key>

the listing_id is the primary key i'm gonna use to filter the second grid datasource, here's how i define the datasource for my first grid and second grid in 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">
    <!-- first grid  -->
    <virtualType name="Lime\Lazada\Model\ResourceModel\Listing\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">lime_listing</argument>
            <argument name="resourceModel" xsi:type="string">Lime\Lazada\Model\ResourceModel\Listing\Collection</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="lime_listing_grid_data_source" xsi:type="string">Lime\Lazada\Model\ResourceModel\Listing\Grid\Collection</item>
                <item name="lime_listingproduct_grid_data_source" xsi:type="string">Lime\Lazada\Model\ResourceModel\Listingproduct\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
    <!-- second grid  -->
    <virtualType name="Lime\Lazada\Model\ResourceModel\Listingproduct\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">lime_listingproduct</argument>
            <argument name="resourceModel" xsi:type="string">Lime\Lazada\Model\ResourceModel\Listingproduct\Collection</argument>
        </arguments>
    </virtualType>
</config>

here's my Adminhtml/Listingproduct/Index.php:

namespace Lime\Lazada\Controller\Adminhtml\Listingproduct;

class Index extends \Magento\Backend\App\Action
{

    protected $resultPageFactory;

    /**
     * Constructor
     *
     * @param \Magento\Backend\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    /**
     * Index action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
            $resultPage->getConfig()->getTitle()->prepend(__("listingproduct"));
            return $resultPage;
    }
}


texts: Add Custom url to href in email template not working

texts:
I try to generate an a href element in my email template that will open a mobile app, to do this i just have to replace the http or https in url with my app name, the a href element should contain the url like this:

//var url = 'test://test.com';
 Test

if i use the Deeplinking url like above code, the href of a element wont show in my email, so the a href element become unclickable

 Test

but if i use normal url it works just fine

//var url = 'http://test.com';
 Test


texts:
addAttributeToSelect is not working in magento 2. i tried below but it is loading all item.

$groupCollection = $this->_productloader->create();
$groupCollection->addAttributeToFilter('sku','24-MB02');
$groupCollection->addAttributeToSelect('name,sku');

below is result

{"entity_id":"6","attribute_set_id":"15","type_id":"simple","sku":"24-MB02","has_options":"0","required_options"
:"0","created_at":"2016-04-26 06:40:51","updated_at":"2016-04-26 06:40:51","is_salable":"1"}


texts: Magento 2 catalog price rules vanish after 2 days

texts: I saw a million posts of this type of question but none of them have an answer to it and most of them are related to the Magento 1, so I was hopping that we can accomplish that here. Catalog price rules are simply gone after 2 days and I don't why. I am using Magento 2.3.5 -p1 and my timezones are correctly written. I am hopping for your help on this problem.


texts: add two column in product choose grid in widget

texts: I want to add two column describe in image


texts: Special Price Not Showing Configurable Product Magento 2.4.2

texts:
I have upgraded Magento 2.4.1 to 2.4.2
Special price is showing for a simple product but showing for the configurable product in the category view page.
However, on the product details page, I can see the special price of the configurable product.
Simple Product category view page example.

Configurable product category view example (not showing special price)


texts: How to define custom table and retrieve the data into grid?

texts:
i'm writing a module to retrieve the data from a table (i manually created it by using phpmyadmin), but i don't know how to access it in grid.php

<?php
class TempName_AdminLog_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
    public function __construct()
    {
        parent::__construct();
        $this->setId('tempname_admninlog_grid');
        $this->setDefaultSort('increment_id');
        $this->setDefaultDir('DESC');
        $this->setSaveParametersInSession(true);
        $this->setUseAjax(true);
    }
    protected function _prepareCollection()
    {
        ***$collection = Mage::getResourceModel('sales/order_collection')***

        return $this;
    }
    protected function _prepareColumns()
    {

    }
    public function getGridUrl()
    {

    }
}

how to access the table "admin_log" in _prepareCollection method? Anyone knows what i actually have to do?


texts: Add current url as variable in CMS content

texts: Is there a way to add current url in CMS content? Just like when I add the store name, something like this {{config path="general/store_information/name"}}


texts: Can't add a New filter to Magento Magento's Total Ordered Report

texts:
I'm trying to add a new filter to Magento's Total Ordered Report (i.e. Reports > Sales > Orders from the admin panel).

The filter I want is "Order Type" and can be either "Delivery" or "Collection"

I was able to add the filter to the Report form by rewriting the Mage_Sales_Block_Adminhtml_Report_Filter_Form_Order class.

<?php
class Holy_Reports_Block_Sales_Adminhtml_Report_Filter_Form_Order extends Mage_Sales_Block_Adminhtml_Report_Filter_Form_Order
{
    protected function _prepareForm()
    {
        parent::_prepareForm();
        $form = $this->getForm();
        $htmlIdPrefix = $form->getHtmlIdPrefix();
        /** @var Varien_Data_Form_Element_Fieldset $fieldset */
        $fieldset = $this->getForm()->getElement('base_fieldset');

        if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) {

            $fieldset->addField('order_type', 'select', array(
                'name'       => 'order_type',
                'options'    => array("delivery"=>"Delivery", "collection"=>"Collection"),
                'label'      => Mage::helper('reports')->__('Order Type'),
            ));

        }

        return $this;
    }
}

But when I run the report it does not filter the results by the Order Type.

I've tried to add the filter to the collection with $this->_addCustomFilter($resourceCollection, $filterData->getData('order_type')); by re-writing Mage_Adminhtml_Block_Report_Sales_Sales_Grid

<?php
class Holy_Reports_Block_Adminhtml_Report_Sales_Sales_Grid extends Mage_Adminhtml_Block_Report_Sales_Sales_Grid
{
    protected function _prepareCollection()
    {
        parent::_prepareCollection();

        $filterData = $this->getFilterData();

        $storeIds = $this->_getStoreIds();

//        $orderType = $filterData->getData('order_type');

        $resourceCollection = Mage::getResourceModel($this->getResourceCollectionName())
            ->setPeriod($filterData->getData('period_type'))
            ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))
            ->addStoreFilter($storeIds)
            ->setAggregatedColumns($this->_getAggregatedColumns());

//        $resourceCollection->$filterData->getData('order_type');
//        $resourceCollection->addFieldToFilter($filterData->getData('order_type'));
//        $this->_addOrderStatusFilter($resourceCollection, $filterData);
//        parent::getCollection()->addFieldToFilter('fulfillment_store_id', $filterData->getData('order_type'));
//        $this->_addCustomFilter($resourceCollection, $filterData);
        $this->_addCustomFilter($resourceCollection, $filterData->getData('order_type'));

        $this->getCollection()->setColumnGroupBy($this->_columnGroupBy);
        $this->getCollection()->setResourceCollection($resourceCollection);

        return parent::_prepareCollection();
    }
}

I'm using xDebug and can see that my class re-writes are working, it seems to be that my PHP logic is wrong.


texts: Magento 2.3 : How to implement declarative schema in custom module

texts:
I install the magento 2.3 and I'm creating custom module.

But, I don't know how to create custom database table in magento 2.3 version.


texts: Can't find where to start making my newsletters

texts: I am using Magento ver. 1.9.2.4, can't find where to start making my newsletters


texts: Why is simple product price required even in a configurable product?

texts: Some months ago I released a Magento store for the company where I work and they need to change product prices so many times, especially for promo campaigns etc. The point is: because the simple products price being required by default, we have to change, in addition to the configurable product price, each price of their simple products, and it takes us a long time. I read on the internet that simple products are totally useless when working with configurable products, then I wanted to know if there is a possibility of leaving the price field of simple products as optional so we can fill only the configurable products price. Would this affect the operation of something in the store?


texts: Magento2 How checkout address form fields works?

texts: I need to add new field in checkout address form. How can add it ? Also need to convert the city address input field into drop-down field.


texts: Magento2.2.4: breadcrumbs disappeared from product page

texts:
I have a website developed with Magento 2.2.4.

There is a problem with breadcrumbs.

Breadcrumbs are showing on all the pages except Product page.

How can i check what's error ?!


texts: new products list - with title & short description

texts:
I want my New Products (list) widget to display the Title & Short Description of the items. E.g. www.pccasegear.com there "New products" section on there home page.

I've had a look at a few addons/extensions but none of them seem to do what I want. Is there a way I can edit this widget to display the Short Description on each product? Maybe even have a character limit.

At the moment I've just got

  {{widget type="catalog/product_widget_new"
  display_type="all_products" products_count="10"
  template="catalog/product/widget/new/content/new_list.phtml"}}

EDIT2: Everything seems to be working (no error codes) with the below code. Except I keep getting "There are no products to display". I've tried setting today's date and future days with the same message. Is there something I'm missing?


texts: Difference in approach for Mass Order Hold and Unhold

texts:
I was working on something in Magento admin on order Management.
I have observed that MassAction Unhold is using the collection to release order from hold, whereas MassAction Hold is using Interface to put the order on hold.

Code in MassAction function in class Magento\Sales\Controller\Adminhtml\Order\MassUnhold

foreach ($collection->getItems() as $order) {
            $order->load($order->getId());
            if (!$order->canUnhold()) {
                continue;
            }
            $order->unhold();
            $order->save();
            $countUnHoldOrder++;
        }

Code in MassAction function in class Magento\Sales\Controller\Adminhtml\Order\MassHold

foreach ($collection->getItems() as $order) {
            if (!$order->canHold()) {
                continue;
            }
            $this->orderManagement->hold($order->getEntityId());
            $countHoldOrder++;
        }

Why there are two different approaches for a similar functionality?


texts: Magento get list of products which never ordered

texts: I am using magento 1.8 and want to generate a list of products which never ordered on our site. Can you please give some idea on it. I am open to use any code as well as any sql which can be directly run on our database.


texts:
I'm following the exercises of "Magento2 development cookbook".
In the part of "Adding a block of new products" (previously to that all works fine). I have:

app/code/Packt/HelloWorld/view/frontend/layout/helloworld_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <title>Helloworld Landingspage</title>

        <remove name="wishlist_sidebar" />
        <referenceContainer name="content">
            <block class="Packt\HelloWorld\Block\Landingspage" name="landingsblock" template="Packt_HelloWorld::landingspage.phtml" />
            <block class="Packt\HelloWorld\Block\Newproducts"  name="newproducts"  template="Packt_HelloWorld::newproducts.phtml" />
        </referenceContainer>

app/code/Packt/HelloWorld/Block/Newproducts.php

<?php
namespace Packt\HelloWorld\Block;

use Magento\Framework\View\Element\Template;

class Newproducts extends Template
{
    private $_productCollectionFactory;
    protected $_logger;

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

    public function getProducts() {
        $collection = $this->_productCollectionFactory->create();

        $this->_logger->info('YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY');
        //$this->_logger->info();

        $collection
            ->addAttributeToSelect('*')
            ->setOrder('created_at')
            ->setPageSize(5);

    return $collection;
}

}

app/code/Packt/HelloWorld/view/frontend/templates/newproducts.php

New Products

    <?php foreach ($block->getProducts() as $product): ?>

<?php echo $product->getName() ?>

    <?php endforeach; ?>


texts: Set programmatically added attributes to product

texts:
I'm writing cron module to import products (Magento 2). In this module I'm adding attribute, attribute value and assign this new attribute value to product. It sounds easy but new added attributes and it's values are not visible. For example when I add attribute option

$attribute = $this->_eavConfig->getAttribute('catalog_product', $code);
$attributeId = $attribute->getAttributeId();

$option = array();
$option['attribute_id'] = $attributeId;
$option['value'][$attr->value][0] = 'value';
$option['value'][$attr->value][1] = 'value';
$this->_eavSetup->addAttributeOption($option);

and then try to find new added option

$options = $attribute->getSource()->getAllOptions(true);
foreach ($options as $option)
{
    if ($option['label'] == 'value') ...//new value missing
}

there is not new option value in $options table. I can get new option id directly from tables eav_attribute_option and eav_attribute_option_value. But It doesn't solve the problem because setting this option id to product wont work. "Product" also doesn't see this new attribute/option value. How can I force my script to refresh new attributes so they can be visible?


texts: magento 1.9.3 based ecommerce site product selection to checkout in single page

texts:
Is it possible to create a single page magento e-Commerce website?

Mainly displaying the products, cart and checkout everything on the same page.


texts: we are facing attack of stats.g.doubleclick.net virus in my website . Please suggest some way to stop it as people are redirected from checkout page to shopping cart page . Please help asap.


texts:
I am using Ebizmart_Mailchimp in Magento 2, I upgrade my MailChimp extension but now order not sync I am getting log:

"SubscriberNew": 100,
    "ProductNew": 100,
    "CustomerNew": 100,
    "QuoteNew": 68

why order not coming ? How I debug this.


texts:
I want to set the current language to the language what i want.
I did URL redirect but at i am not able to set cookies for store.


texts: Magento2- Custom attribute customer not show in admin

texts:
I have added custom attribute of customer, It have added to database but not show in backend.
I have used

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy

php bin/magento  cache:flush –all
But still not show.I have added below code:

Please help me!


texts: Overrite custom extension's tab form in admin

texts:
I want add new option in tab form.For this I have tried to overrite that file but getting an error

Fatal error: Call to a member function toHtml() on a non-object in /app/code/local/Test/Helloworld/Block/Adminhtml/Helloworld/Group/Edit/Tabs.php on line 19.

File I am overriding is : Test_Helloworld_Block_Adminhtml_Helloworld_Group_Edit_Tab_Main.

To override this file I am doing below code :

Config.xml

<blocks>
    <helloworld>
        <rewrite>
            <adminhtml_helloworld_group_edit_tab_main>
                  Mynamespace_Mymodule_Block_Adminhtml_Mymodule_Group_Edit_Tab_Main
            </adminhtml_helloworld_group_edit_tab_main>
        </rewrite>
    </helloworld>
</blocks>

Create file :

app/code/local/Mynamespace/Mymodule/Block/Adminhtml/Mymodule/Group/Edit/Tab


texts: How To call 'sidebar.phtml' in cart pop up

texts:
I am using magento 1.9.2.3. In my header.phtml when I call the cart sidebar like

<?php echo $this->getChildHtml('cart_sidebar'); ?>

the sidebar is not getting displayed when hovered over the cart icon. Also I enabled it in backend.

Below is my cart. Kindly help me to enable the sidebar.


texts: How to save to some data to database after order has been placed

texts:
I am new to magento 2. I am trying to add observer that will be triggered after order has been placed.

I have save some certain data to the cookies on my magento 2 website, i have intention to save it to database after the order has been placed already have the table created on the database. Just wanted it and some order details save to database when order has been placed


texts: Apply Date Filter With "not qual to" Condition in Magento 2

texts:
i need to filter with a date column with not
  current month records

i tried :

    $start = date('Y-m-d'.' 23:59:59',strtotime('-45 days'));
    $end = date('Y-m-d'.' 00:00:00');
    $collection = $collection
                ->addFieldToFilter('created_at',array('from' => $start, 'to' => $end));

this is Showing only Expect the this two month records

but how i can put "Not equal to"


texts:
I have installed Magento 2.2.4 with sample data. Now I need to remove all sample data, and I found a solution from Magento DevDoc

I used command as suggested,

php bin/magento sampledata:remove

But I got this error as following,

Loading composer repositories with package information

Removal failed, reverting ./composer.json to its original content.

  [Composer\Downloader\TransportException]
  The 'https://repo.magento.com/packages.json' URL required authentication.
  You must be using the interactive console to authenticate

What did I miss?


texts: How to differentiate in website URLs and store view URLs?

texts:
I need to add a check for website URLs and different Store view urls.
This means I need to get some unique value that can differentiate all the store view URLs and Website URLs.
Basically, One license key will be only for one website, we can't use it for another website and other store views.
Thanks in advance.


texts: ESI processing not enabled error only on Product detail page Varnish and Magento 1.9

texts:
I am trying to hole punch a Magento having two websites setup for retail and wholesale with Varnish 4. So far I have fixed the header section not appearing error by fixing the Main Navigation provided by Smartwave Porto theme. But on wholesale site for Home page and Category pages header seems to work fine. But the product detail page shows ESI processing not enabled error in place of global_messages, messages and top.links block.

I have already tried solutions suggested in some other threads like -p esi_syntax=0x2

Technology Specifications are: CentOs6, Nginx, Varnish 4, Magento 1.9.

It seems like the Turpentine extensions' EsiController->getBlock() method is not returning a proper response to varnish or may be these ESI blocks are not getting parsed at all. How can I debug further?

The multi-store setup works based on the below changes made to index.php file:

switch($_SERVER['HTTP_HOST']) {
    case 'dev.domain.com':
    case 'www.dev.domain.com':
        $mageRunCode = 'retail_shop_code';
        $mageRunType = 'website';
    break;
    case 'shop.domain.com':
    case 'www.shop.domain.com':
        $mageRunCode = 'wholesale_shop_code';
        $mageRunType = 'website';
    break;
}

Mage::run($mageRunCode, $mageRunType);

Just may be above code has something to do with varnish not processing ESI correctly?


texts:
how to auto VAT validation in magento2 checkout. can you provide any suggustions or code for auto validation in checkout page.
Thanks


texts:
when I tried to login into Magento admin it's show me error Invalid Form Key. Please refresh the page. and I know I am entering correct username and password. when I tried second time to login with same user name and password it's allow me to login successfully.

after 2 try finally I login to my Magento admin panel but after that when I click on logout it's refresh page and redirect me to dashboard.it's not logout from Magento admin panel.

any idea??

Update

now if I try to login in admin it's doesn't show any error it just refresh and url is changed.

for ex :
my admin url is : example.com/admin
username : admin
password : admin@123

now if I try to login using this details page is refresh and my url is change from example.com/admin to example.com/admin/index/index/key/95fdcbe3f6af413384d42ea557a7b4e7/


texts: Catalog Search index process "error":"MapperParsingException" after installing Elasticsearch

texts:
I am having a problem on a live M2 site (v2.3.5-p1) and a staging site (v2.4).
I have implemented Elasticsearch 7.xx on both and set the search to use Elasticsearch 7.xx.
Clicking the test button responds positive.
ElasticSearch is responding to requests using curl localhost:9200.
When I run bin/magento indexer:reindex the following error is displayed

Catalog Search index process unknown error:
{"error":"MapperParsingException[No handler for type [text] declared on
field [_search]]","status":400}

When I revert the search back to MySQL the error does not display.
An ideas anyone?


texts: how to add link for advance search in magento 2 home page default theme?

texts:
i followed this answer

https://magento.stackexchange.com/a/258463/73525

step 1:

{{block class="Magento\CatalogSearch\Block\Advanced\Form" template="Magento_CatalogSearch::advanced/form.phtml"}}

i did it's showing in home page (advanced search)

but
step 2:

If you need to customize phtml, copy it from:

vendor/magento/module-catalog-search/view/frontend/templates/advanced/form.phtml

where i can copy to
my default theme in magento

in my folders

  app/design/Magento after this no folder available

how i can do step 2

(i'm using magento luma theme)


texts: How to solve MagentovariablePlugin is not defined?

texts:
Hi I am adding editor and its works perfectly but when I clicks on Insert variable I am facing this error.
Error :-

MagentovariablePlugin is not defined

My system.config  field code

<field id="grid_view" translate="label" type="editor" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
  <label>Grid View Design</label>
 <frontend_model>Vendor\Module\Block\Adminhtml\System\Config\Form\Field\Editor</frontend_model>
</field>

and my Editor.php code

<?php
namespace Vendor\Module\Block\Adminhtml\System\Config\Form\Field;

use Magento\Backend\Block\Template\Context;
use Magento\Cms\Model\Wysiwyg\Config as WysiwygConfig;

class Editor extends \Magento\Config\Block\System\Config\Form\Field
{
    public function __construct(
        Context $context,
        WysiwygConfig $wysiwygConfig,
        array $data = []
    )
    {
        $this->_wysiwygConfig = $wysiwygConfig;
        parent::__construct($context, $data);
    }

    protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        $element->setWysiwyg(true);
        $element->setConfig($this->_wysiwygConfig->getConfig($element));
        return parent::_getElementHtml($element);
    }
}


texts: How to access system.xml values in phtml file

texts:
$extensionStatus=$this->helper('Esparksinc\Extension\Helper\Data')->getConfig('Extension/general/enableDisable');

i am accesing this way but it gaves me a warning "The use of helpers in templates is discouraged. Use ViewModel
     instead" while checking code in magento coding standared.


texts: Magento 2 GraphQl + Elasticsearch 6, GraphQl query products do not run pass by elasticsearch

texts:
I have a problem with query:

    {
      products(
        filter: { sku: { like: "24-WB%" } }
      ) {
        items {
          sku
        }
      }
    }

Although using search engine is "elasticsearch", it still using mysql. I dont know why? Please give me solution.
Thanks everyone for reading.


texts: Still necessary to apply APPSEC-212 patch for 1.8.1 CE?

texts: If a 1.8.1 CE site has all of the necessary security patches made available after APPSEC-212, but does not have APPSEC-212, should it be considered safe, as long as it is "safe" per curl https://magento.com/security-patch-check/[site]/[admin-dir]?


texts: Several fatal errors showed up during the upgrade to Magento 2.3.5 from 2.3.4 which, after research, were found to have been caused by the outdated version of composer. Running composer self-update unfortunately doesn't work. Is there a different command or an approach to updating composer to its latest version?


texts: Magento 2 - It is possible to create a select with optgroup using \Magento\Framework\Data\Form\Element\::addField?

texts:
As the title says,

Looking at Magento\Framework\Data\Form\Element\Select looks like it does but i cant figure out the array? that i have to pass to my addField(id, type, [name, label, options]);


texts: Display wrong price on list page when multi store

texts:
I am using Magento EE 1.14.3.0 with multi store and has configurable products.

Product is the configured with price, special price and for associated simple product given price with - number.

Problem is with price as low as in category list page. It displays correct on product detail page but category list page it displays wrong calculated value.

In first store it displays correct values on both category list & product details page, But for second store it displays wrong value.

Any help would be appreciated

Thanks


texts: How to add Child CMS page to Parent CMS page?

texts:
I'm Having two pages

parent_page
child_page

and I'm having a child page link inside a parent page.
If i click on child page link the url should be
www.xyz.com/parent_page/child_page
when the url look like this i can't display the child page content

How to achieve this?


texts: Customer session for logged in customer by token based authentication

texts:
We are using token based authentication over rest api from that resource

  /rest/V1/integration/customer/token?username=USER_NAME&password=P@$$WORD

to consume magento rest api web services.

We get tokens and return customer details successfully form that resource

  /rest/V1/customers/me

I need to get the customer ID from his session but I can not because user always considered not logged in, despite working fine for web scenario below is the code snippet I use.

   public function __construct(\Magento\Customer\Model\Session $session){

    parent::__construct($context);
    $this->customerSession = $session;
}

I am facing that problem inside my custom offline payment method defined in custom extension, I need to know the customer ID in order to determine if the customer can use that payment method or not.

Even if I tried to use the checkoutSession, still can not get the customerId.

$om = \Magento\Framework\App\ObjectManager::getInstance();
    $checkoutSession = $om->get('\Magento\Checkout\Model\Session');
    exit(var_dump($checkoutSession->getQuote()->getCustomer()->getId())); //return NULL

The custom extension works fine when viewing the store from the browser.

Can you please help me what is wrong here?

Thanks in advance


texts: x-magento-init: "variable is not defined"

texts:
I am completely lost trying to get my text/x-magento-init working.

I have included this in my template file and I can see it in the page source:

<script type="text/x-magento-init">
    {
        "*": {
                "a": "<?php echo 'Hello from template' ?>"
             }
    }
 </script>

I want to call this variable a in my JS function, but when I do that, I get an error:

Uncaught ReferenceError: a is not defined

Do I need to call the a in a special way or is there a mistake in my x-magento-init?


texts: slideshow images are occupying more space in the site

texts:
please visit this link :

this is ma_aries magento theme by Plaza themes

check the home page- slideshow images. Slideshow images are occupying more size.

I resized the images and uploaded. than also it's not occupying less size.

there is no option in admin panel to resize the image sizes.

please help me to find solution.


texts: Magento 2 - No method named openmodal when bootstrap bundle js is used

texts:
I want to display a review form in the modal popup on the click of a button. However, the code gives this error

  Uncaught TypeError: No method named "openModal"

I am using bootstrap.bundle.js in my application. If I remove that the popup is displayed without any error message.

Code I am using:

    Click Me

    <?php echo $this->getLayout()->createBlock("Magento\Review\Block\Form")->setTemplate("Magento_Review::form.phtml")->toHtml(); ?>


texts: Facing issue with cron job in magento 2.2.7, how to solve?

texts:
I am getting below error in update.cron.log file.

  [2020-01-20 05:33:01] update-cron.ERROR: Cron readiness check failure!
  Found non-writable paths:     /var/www/vhosts/project/webroot/.github
    /var/www/vhosts/project/webroot/.htaccess.sample
    /var/www/vhosts/project/webroot/.php_cs.dist
    /var/www/vhosts/project/webroot/.travis.yml
    /var/www/vhosts/project/webroot/.user.ini
    /var/www/vhosts/project/webroot/CHANGELOG.md
    /var/www/vhosts/project/webroot/COPYING.txt
    /var/www/vhosts/project/webroot/Gruntfile.js.sample
    /var/www/vhosts/project/webroot/LICENSE.txt
    /var/www/vhosts/project/webroot/LICENSE_AFL.txt
    /var/www/vhosts/project/webroot/app/design/adminhtml/Magento
    /var/www/vhosts/project/webroot/app/design/frontend/Magento
    /var/www/vhosts/project/webroot/dev/tests/acceptance
    /var/www/vhosts/project/webroot/dev/tests/integration/_files
    /var/www/vhosts/project/webroot/nginx.conf.sample
    /var/www/vhosts/project/webroot/package.json.sample
    /var/www/vhosts/project/webroot/php.ini.sample
    /var/www/vhosts/project/webroot/pub/static/.htaccess
    /var/www/vhosts/project/webroot/var/.htaccess
    /var/www/vhosts/project/webroot/vendor/.htaccess [] []


texts: AJAX call to controller returns admin dashboard html

texts:
Calling a controller with location

  Vendor\Orderitemstatestatus\Controller\Adminhtml\orderitemstatestatusmapping\OrderStatus.php

The controller is called through AJAX from admin custom form as follows

    setAfterElementHtml('
            <script>
            require(["jquery", "jquery/ui"], function($){
                   $(document).ready(function() {
                    $("#page_order_status").click(function() {
                        var customurl = "orderitemstatestatus/orderitemstatestatusmapping/orderstatus";
                        $.ajax({
                           url: customurl,
                           type: "POST",
                           showLoader: true,
                           data: {form_key: window.FORM_KEY},
                       success: function(response) {
                                    console.log(response);
                           },
                           error: function (xhr, status, errorThrown) {
                               console.log(errorThrown);
                           }
                       });
                        });
                   });
                });
</script>'

);

Is there something wrong with the url? The secret keys to url is disabled from the backend.

routes.xml:

 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="admin">
        <route id="orderitemstatestatus" frontName="orderitemstatestatus">
            <module name="Vendor_Orderitemstatestatus" before="Magento_Adminhtml" />
        </route>
    </router>
</config>

OrderStatus.php file:

<?php
namespace Vendor\Orderitemstatestatus\Controller\Adminhtml\orderitemstatestatusmapping;

use Magento\Backend\App\Action;
use Magento\Framework\App\Filesystem\DirectoryList;

class orderstatus extends \Magento\Backend\App\Action
{

    /**
     * @param Action\Context $context
     */
    protected $resultJsonFactory;
    public function __construct(Action\Context $context,\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory)
    {
        $this->resultJsonFactory = $resultJsonFactory;
        parent::__construct($context);
    }

    /**
     * Save action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $data = $this->getRequest()->getPostValue();
        // return Json(new {msg="Successfully added "});
        return  $this->resultJsonFactory->create()->setData(['data' => 'file successfully called']);

}
}

The controller should simply return "file successfully called in json format" but returns dashboard page html.


texts: Why do I need to add new non-default inventory source to use In-store Delivery?

texts:
Magento docs states that Sources represent locations storing and shipping available product stock, and "All stores begin with a default source that must remain enabled. Single Source merchants (merchants who ship all products from one location) use the default source for their single point of inventory location and shipments.".
In Magento 2.4 we have a new feature: In-store Delivery, which would allow our customers to have their order delivered to a specific "store source" depending on how far away it is from this source.
However, to use this feature we must have configured a non-default stock and source.

So if I have a single inventory source (let's call it default vendor), and a single stock (i.e.: venue 1 store), I cannot allow my customers to have their orders delivered at the store?
Am I getting it wrong, or it was poorly designed? Considering I got it wrong (most likely), what would be the correct way to have the above scenario configured in Magento 2.4+?


texts: Drawback of product collection written in phtml

texts:
I have doubt with product collection

<?php

    $categoryIds = array(469);//category id
    $products = Mage::getResourceModel('catalog/product_collection')
    ->addCategoryFilter(Mage::getModel('catalog/category')->load($categoryIds));
    $Collection = Mage::getModel('catalog/product')->getCollection()->addFieldToFilter('entity_id', array('in' => $products->getAllIds()));;
    $Collection->addAttributeToSelect(array(
                                       'image','small_image',
                                       'name',
                                       'short_description'
                       ))
    ->addFieldToFilter('visibility', array(
                                   Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                                   Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
                       ))
    ->setOrder('price', 'ASC')

    ->joinField('qty',
                 'cataloginventory/stock_item',
                 'qty',
                 'product_id=entity_id',
                 '{{table}}.stock_id=1',
                 'left')
     ->addAttributeToFilter('qty', array("gt" => 0))

    ->addFinalPrice()
    ->getSelect()
    ->where('price_index.final_price < price_index.price')
    ?>

I wrote in this collection to my phtml it's working fine. But what is the drawback to written collection in phtml

I feel after that site little bit slow. Then I wrote MVC But i don't know how to call in that phtml.


texts: How To Modify Tax Calculations in Magento 1.9

texts:
For Testing - Learning purposes I would like to modify Tax Calculations in my magento installation. (not for production so no problem to modify core files).

Based on the fact that Taxes are displayed on catalog, cart, orders, etc I believe it will provide me enhanced details about some magento functionalities i cannot fully understand right now. Consequently my main idea is to learn how it works in terms of:

Original Price multiply by a Tax rate.
Price Calculations including Tax rate based on a shipping location.
Price Including Taxes displayed in different design areas.

Tax Model is so complex i cannot find the appropiated class defining those details. Any help like php file containing that logic, explanation or tutorial on the web will be greatly appreciated.

brgds!

UPDATE!-------------------------------------------------------------------------

TAX Calculations are mainly handled by shipping, billing or default address. Calculations resides in Tax/Model/Calculation.php
if you modify calcTaxAmount function, the amount taxed to products, sales, quote, cart, etc. change in design.

Based on the fact shipping, billing address is displayed when user log into the system my idea is to test including a cookie with country destination information, based on Location detecting tecniques with IP addresses. it seems public function getRate($request) has the answer.
i will continue working.. any help for cookie management appreciated!.


texts:
I created the custom option for file upload, If i choose the file and click the upload button i want to upload file, i don't know how to do this

In Magento if choose the file and click the add to cart button file uploaded but I don't want this functionality.so what i need is if I click the upload button after choose the file, i want to upload the file. this is my code.

$jq(document).ready(function(){

    $jq("#click-me").click(function(){
             var imgVal = $jq('.choose').val();
            if(imgVal==''){
            return false;
            }
            else{
                $jq( "#myProgress" ).removeClass( "hide-progress" ).addClass( "add-progress" );

            }
        move();

        });

});
function move() {
  var elem = document.getElementById("myBar");
  var width = 10;
  var id = setInterval(frame, 10);
  function frame() {
    if (width >= 100) {
      clearInterval(id);
    } else {
      width++;
      elem.style.width = width + '%';
      document.getElementById("label").innerHTML = width * 1  + '%';
     }
     }

}

can you please help..


texts:
Notice: Array to string conversion in
  /home/pacifi48/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php
  on line 2999 Magento 2 Version 2.2.2

How to solve???


texts: How safe it is to run the magento cron.php cron job every minute?

texts:
About Magento 1.9

I want to run Magento's cron.php every minute because, I want sales email to be sent the soonest possible on client order. So besides the email function can someone let me know what the default cron.php does in the sense how wise it is to run it every minute, and if we do run it every minute what to be aware of before 1 minute becomes a problem for these jobs.


texts: Magento 1 Redirect only works once, works again after refreshing cache

texts:
I want to add a simple redirect if a customer is not logged in when trying to access one of my categories.

Now, I have created a test.phtml file and added it in my theme page/test.phtml with fallowing content:

<?php
    if(!Mage::getSingleton('customer/session')->isLoggedIn()){
      echo "Not logged in";
      Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getBaseUrl().'customer/account/login/');
    } else {
      echo "Logged in";
    }
?>

Then created a static block in admin panel with following:

{{block type="core/template" template="page/test.phtml"}}

In the Admin > Catalog > Manage Categories, I seleceted the category I want the redirect to be in and in Display Setting > Display Mode I changed it to Static Block and Products and assigned the block to it. Flushed cache.

Everything works as intended. When I navigate to the category as not-signed customer, I get redirected to log in page. However, if I navigate to the category again, I can see the products and the message "Logged in".

If I refresh the cache, the redirect works again.

Can anyone tell me why?

If this is expected behaviour, is there alternative method of redirecting customer if they not logged in and trying to access on of my categories?


texts: Magento 1.9 : PayPal Payment Information in Order View

texts: I placed an order using PayPal express checkout when I try to view it from backend it didn't show payment method PayPal. Can anyone help me?


texts:
I am getting an nginx 404 on all pages ending in .html in my test instance, which is in a subdirectory at the root of production. For instance, /test/, /test/contact/ and /test/about-us/ are all good. But /test/women.html, /test/solar-jacket.html, and /test/men.html all return 404. So, no category or product pages. :-( It's the same issue with or without rewrites.

This issue is only on my default store. A second store running on a subdomain has no problem displaying the same product pages.

Edit: It's a problem with ".html". If I enter a bad URL without ".html", I get a Magento 404. All URLs that end with ".html" return nginx 404.


texts: How to display numbers of row in table to section in configuration system

texts: I want to count the rows of table and display it to field in section system, can someone help me how to resolve this. Thanks!


texts: Unknown column 'shipping_city' in 'where clause' afterSearch Grid Table

texts:
I'm trying to use the afterSearch in a Admin Grid but when I try to filter a result I'm getting an Unknown column 'shipping_city' in 'where clause' where shipping_city is the custom column I added.
I found a sample here but just as the title state I'm getting an error. Below is my class that do this query and throws the error
class Grid
{
    public static $table = 'customer_entity';
    public static $leftJoinTable = 'customer_address_entity';

    public function afterSearch($intercepter, $collection)
    {
        if ($collection->getMainTable() === $collection->getConnection()->getTableName(self::$table)) {
            $leftJoinTableName = $collection->getConnection()->getTableName(self::$leftJoinTable);

            $collection
                ->getSelect()
                ->joinLeft(
                    ['co'=>$leftJoinTableName],
                    "co.entity_id = main_table.default_shipping",
                    ['shipping_city' => 'co.city']
                );

            $where = $collection->getSelect()->getPart(\Magento\Framework\DB\Select::WHERE);
            $collection->getSelect()->setPart(\Magento\Framework\DB\Select::WHERE, $where);
            // echo $collection->getSelect()->__toString();die;
        }
        return $collection;
    }
}

When trying to print the generated query I got this
SELECT `main_table`.*, `co`.`city` AS `shipping_city` FROM `customer_entity` AS `main_table`
LEFT JOIN `customer_address_entity` AS `co` ON co.entity_id = main_table.default_shipping
WHERE (`shipping_city` LIKE '%Maidenhead%')

As you can see the shipping_city is the custom column so whenever I tried to search in this column it's passing this parameter. But I can't get a result and it's throwing an error. How can I fix this please.. badly need your help. Thanks


texts: Is there any way to filter payment_method from magento 1.* ? Ruby Script

texts:
I have try to use code

@access_token.get("/api/rest/orders?page=1&limit=5&filter[1][attribute]=status&filter[1][in]=processing&filter[2][attribute]=payment_method&filter[2][in]=coinpayments&order=created_at&dir=dsc")

But it's not working and the error is

=> {"messages"=> {"error"=>[{"code"=>42,
  "message"=>
   "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_method' in 'where clause', query was: SELECT COUNT(*) FROM `sales_flat_order` AS `main_table` WHERE (`status` IN('processing')) AND (`payment_method` IN('coinpayments'))"}]}}

Does anyone have any ideas to filter payment method?


texts:
I am trying to use the Rest API to create partial shipments for Magneto 2 orders.  In two different scenarios.
First is one item with multiple pieces, say a customer ordered 4 pieces of sku 3 but I only ship 1 piece.  I send the message to
https://test.m2.test.com/index.php/rest/V1/order/61845/ship
with body
{"entity":{"order_id":"61845","items":[{"order_item_id":"3","qty":"1"}]}}
I get a valid response "44360" but when I check the order in the admin I see
Ordered 4
Shipped 4.
I have tried the message with just the items
{"entity":{"items":[{"order_item_id":"3","qty":"1"}]}}
and with actual item id
{"entity":{"order_id":"61845","items":[{"order_item_id":"77130","qty":"1"}]}}
{"entity":{"items":[{"order_item_id":"77130","qty":"1"}]}}
every one of them yields the same result
Ordered 4
Shipped 4.
The second scenario is with multiple items in the order; if I ship one item but not the other both are shown as fully shipped.
It basically appears that the application is just seeing the order_id in the POST path and marks everything in that order as shipped in full.
Any help is greatly appreciated.


texts: Script.js is minified. How should I find the module responsible for this?

texts:
I've inherited code for a project, Magento 1.9. For the task at hand, I need to touch a JavaScript file located at

skin/frontend/my_projects_name/default/release/js/script.js

This script was originally minified. To make changes, because I don't know how it was minified, I've used a program to "un-minify" it manually. Is this file common among Magento 1.9 projects, or is it unique to this codebase? There are several JS files. Which file was this minified from?

In the skin/frontend/my_projects_name/default dir, there are multiple dependencies files:

bower.json
Gruntfile.js
gulpfile.js
package.json


texts: Magento 2 Terms and Conditions store view column not showing in the grid?

texts:
Admin => Stores=> Settings => Terms and Conditions => Grid

I am facing one issue with the store view column at  Terms and condition Section in Magento 2.2.0

Please find the screenshots below:

Magento ver. 2.1.8 http://prntscr.com/h9t0nh  (working fine)

Magento ver. 2.2.0 http://prntscr.com/h9t3or  (not showing correctly)

Could anyone please help me how to fix this issue?

Thanks


texts:
I use nginx with php5-fpm and I have problem with SOAP webservice. Magento returns wrong address in wsdl.

<service name="MagentoService">
  <port name="Mage_Api_Model_Server_HandlerPort" binding="typens:Mage_Api_Model_Server_HandlerBinding">
    <soap:address location="http://aaa.local/index.php/?type=soap"/>
  </port>
</service>

Should be something like that

<service name="MagentoService">
  <port name="Mage_Api_Model_Server_HandlerPort" binding="typens:Mage_Api_Model_Server_HandlerBinding">
    <soap:address location="http://aaa.local/api/soap"/>
  </port>
</service>

My vhost nginx configuration

server {
    listen 80;
    server_name aaa.local;
    root   /var/www/aaa;

    location / {
        index  index.html index.php;
        try_files $uri $uri/ @handler;
           expires 30d;
        }

    location /api {
        rewrite ^/api/rest /api.php?type=rest last;
        rewrite ^/api/soap /api.php?type=soap last;
    }

    location /app/                { deny all; }
    location /includes/           { deny all; }
    location /lib/                { deny all; }
    location /media/downloadable/ { deny all; }
    location /pkginfo/            { deny all; }
    location /report/config.xml   { deny all; }
    location /var/                { deny all; }
    location /var/reports                { deny all; }

    location /var/export/ { ## Allow admins only to view export folder
        auth_basic           "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex            on;
    }

    location  /. { ## Disable .htaccess and other hidden files
        return 404;
    }

    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }

    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ \.php$ {
        if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
        expires        off; ## Do not cache dynamic content
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/aaa$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE aaa;
        }
}

Anybody know what is wrong?


texts:
I want to create a feature in an upgrade script that creates 2 new tax rates in Magento.

I looked at the importPost controller in adminhtml tax rates controller, but there is a lot of work in there.  I was hoping for a nice easy way kind of like:

Mage::getModel('tax model')->setData('tax rate data')->save()

Anyone know how to do this?


texts:
I have successfully installed Magento 2.3.1 in Xampp. But both the frontend and admin panel of the site are not working.

I have cleared the cache but still, it's not working.

Could anyone please help me with this?


texts:
I have a Magento site that has recently begun to stop showing the captcha forms. Also, some browsers (Safari) are refusing to show that my checkout page is secure because, even though the rest of the page's content is through SSL, the captcha is still being called from http and not https.

The error I get is:

  [Warning] The page at [my site url] ran insecure content from http://www.google.com/recaptcha/api/js/recaptcha_ajax.js. (onepage, line 51, x2)

The offending code output appears as:

<script type="text/javascript">
    if((DRjQuery.browser.msie && parseInt(DRjQuery.browser.version, 10) != 7) || !DRjQuery.browser.msie) {
                document.write("<script type='text/javascript' src='http://www.google.com/recaptcha/api/js/recaptcha_ajax.js'><\/script>");
    }
</script>

How do I get Magento to use https for captcha?

Where can I find the code (above) where Magento outputs the http so that I can change it to https?


texts: Can not access deep category and product links - url shortened

texts:
when I try to access some deep category I am alwyas redirected to link of parent category.

for example
i try access store.com/category/subcategory/subcategory2/subcategory3/subcategory4
but i am redirected to
store.com/category/subcategory/subcategory2/subcategory3

same with deep product url store.com/category/subcategory/subcategory2/subcategory3/product
also redirects to
store.com/category/subcategory/subcategory2/subcategory3

i am using nginx server. but i discovered that this redirecting happening in magento, not with server rewrites. can someone point me where should i start search?

i am using CE 1.9.2.1 with few plugins and porto theme


texts:
Too many arguments, expected arguments "command" "config".

migrate:settings [-r|--reset] [-a|--auto] [--] strong text

I am getting the above error on migration settings command.
php bin/magento migrate:settings --reset vendor/magento/data-migration-tool/etc/opensource-to-opensource/Magento 1.9.2.4/config.xml
I have made changes in config  file but still the command is not executing


texts:
Frontend search does not work when Sphinx Search for Magento is re-indexing. It is set to re-index whenever the catalogsearch_fulltext indexing is done for Magento.

Whenever I run php indexer.php --reindex catalogsearch_fulltext, searches on the frontend will timeout due to a lack of server response.


texts:
I'm saving a product like this (because this how I've learned it)

$product = new Mage_Catalog_Model_Product();
$product->[do a lot of stuff for adding a product];
try {
    $product->save();
} catch (Exception $e) {
    __error($e);
}

But this could still have errors while adding the product.

So now I'm doing:

try {
    $product = new Mage_Catalog_Model_Product();
    $product->[do a lot of stuff for adding a product];
    $product->save();
} catch (Exception $e) {
    __error($e);
}

Is this a correct way of handling it?


texts: REST API for getting cart details of specific customer

texts:
I am trying to get the allocated cart detail for specific customer, but there are no api available to getting the cart information from customer detail (from customerId).
How can i get the cart information for particular customer.


texts: How can we replace contact number at footer in magento 1.9

texts:
Just suggest me to replace a phone number at footer in Magento 1.9.

Where can we replace, can someone give me the path directions.


texts:
In my database I have courses_id=4 and number_of_courses=10

I have a function in controller and write:

$id=4;
$courseCollection = Mage::getModel('course/courses')->getCollection();
$numberCourse = $courseCollection->getSelect()->where("courses_id='$id'")->columns('number_of_courses');

I want value number_of_courses from database for $numberCourse

What should I do?


texts: What is the correct way to make the last page appear on pagination?

texts:
I need to make the pagination show some amount of pages saying 5 then show the dots and last page. Making it look like:

1 2 3 4 5 ... 20

pager.phtml already has those within the template, but they depend on the following methods

canShowNextJump();
canShowLast();

both are defined within Magento\Theme\Block\Html\Pager

Is there any combination of Admin settings to achieve that or I will need to override methods/values in Pager block?


texts:
I am trying to extend the admin order grid by adding a single column. I don't want to add all the logic again in my code, so the only method I'm calling is _prepareColumns():

protected function _prepareColumns()
{
    $this->addColumn('customer_group', array(
        'header'=> Mage::helper('sales')->__('Customer Group'),
        'width' => '80px',
        'type'  => 'text',
        'index' => 'increment_id',
    ));
    return parent::_prepareColumns();
}

I've read this article on overriding methods, but I don't know if I'm following it correctly. My module file at ~/app/etc/modules/Namespace_Module.xml includes the following:

<config>
    <modules>
        <Namespace_Module>
            <active>true</active>
            <codePool>community</codePool>
            <depends>
                <Mage_Adminhtml />
                <Mage_Core />
                <Mage_Sales />
            </depends>
        </Namespace_Module>
    </modules>
</config>

My config.xml file contains:

<config>
    ...
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_grid>Namespace_Module_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
    ...
</config>

On my testing site, I get only this Customer Group column on the grid. I am expecting all the columns AND this column. Am I wrong to think it will work like this?

My code is all in a custom module. Thanks.

A picture might help. I'm trying to edit this:


texts: Make a good url without the index with magento

texts:
The url needs to look like:

brands/Subway
brands/Mcdonalds
brands/Lego
brands/Barbie
brands/Duplo
brands/.....

How can i make this url work where the brand is a variable.

I have tried to make a module but in that case I get an url like brands/index/brands/Subway

I also don't want to make a rewrite for every brand (100+)


texts:
I know that I can have modman install my module to the application root, how do I have modman install and manage third party extensions?

For example,
I have a module name MyCompany_Mymodule. This is versioned with Git. In my IDE (eclipse), I have a project with just this module. I develop and test this module, then I commit to git. This module is linked (not cloned) by modman to the application root in my local development. The application root is some version of Magento that is NOT under version control. On the staging site, initially, I scp up everything in the base Magento install. As I develop my module, any commits to git are then uploaded to the staging site. There is NO git on the staging server.

Now, I'm suppose to install multiple third party extensions on the staging site. How do I do this with Modman? I know I can install with Magento Connect on the staging site, but I would like to have Modman do this for me. Is this a feature of Modman? Maybe I can list the repositories of third party extensions in the 'modman' file and when I do modman update on the staging site, it'll update the staging site for me?

Edit:
Here's what my project looks like:

my-project
    third-party
        Aoe_Scheduler
        magemonkey
    src
        app
        js
        skin
    modman

Here's my modman:

src/app/code/local                        app/code/local/
src/app/design/frontend/rwd/my-project    app/design/frontend/rwd/my-project/
src/app/etc/local.xml                     src/app/etc/
src/app/etc/modules/My_Project.xml        app/etc/modules/
src/skin/frontend/rwd/my-project          skin/frontend/rwd/my-project/
@shell rm -rf $PROJECT/var/cache/*

# Third party extensions
@import third-party/Aoe_Scheduler
@import third-party/magemonkey


texts: How to remove SKU on the product page in magento2

texts:
I want to remove the SKU from the product display page using XML .

How can I do this?


texts: Magento2: Date Interval Issue in Custom Report

texts:
I am creating a custom product viewed report.

I am facing issue in interval column.

Below is my collection

$collection = $this->customreportsFactory->create()->getCollection();
$collection->addFieldToFilter('created_at', ['gteq' => $filterData['from']]);
$collection->addFieldToFilter('created_at', ['lteq' => $filterData['to']]);
$collection->getSelect()->columns('COUNT(*) as view_times');
$this->setCollection($collection);

Here, If you select period as DAY then data should be only One Date raw and 3 product_name raw in Interval column.

Can anybody please update my collection according.


texts: Set a custom Transaction ID from an external source

texts:
I'm trying to change the Transaction ID straight after the user finishes the checkout process.

After the user has clicked submit, I'd like to change the Transaction ID to an ID that I'm retrieving from a 3rd party (POS system), and then add it into the database as per usual.

I've managed to get the correct ID from the POS system, but I'm not sure what file to edit in order to change the Transaction ID before it goes into the database.


texts: Multiple "Add to cart" buttons with quantities specified

texts:
Hi I would like to have three "Add to cart" buttons which add specified quantities for my products and remove the input field.

So rather than [qty input] [Add to card]

I'd like

[Add a single to cart]

[Add 6 to cart]

[Add 12 to cart]

Wondering on the best way to do this, I would also like to implement this on the product listing.

Thanks


texts: Show text block between start and end date (within date range) in magento 2

texts:
How can I display a text block between two dates?
I already a stored start and end date in db. I would like to display a shipping bar on the homepage from  April to May (stored in db).


texts:
I am including datatable plugin to my custom module.

I tried in this way, below is the code of my Vendor/Module/view/frontend/requirejs-config.js

 var config = {
    map: {
   '*': {
       dataTables: 'Vendor_Module/js/datatables.min'
     }
   }
 };

including css file like below in Vendor/Module/view/frontend/layout/default.xml

 <?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="Vendor_Module::css/datatables.min.css"/>
</head>

And i moved my css and js files into respective folders inside web folder.
 Vendor/Module/view/frontend/web/css/datatables.min.css
 Vendor/Module/view/frontend/web/js/datatables.min.js

I have used below code in my template file to load Datatable.

<script>
require(['jquery', 'jquery/ui','dataTables'], function($){
    $(document).ready(function($){
        $('#example').DataTable();
    });
});

seems datatable is not loading. and getting below error in console.

  Uncaught Error: Script error for: jquery

Please anyone suggest me where i am wrong. Thanks


texts: Standard Magento 2.3.5.-p2 install gives slow performance

texts:
We have a Fully Managed SSD Cloud VPS hosting account with the following:
4 x 2.50GHz Cores
8 GB RAM
5 TB Bandwidth
cPanel/WHM/Softaculous
5000 Mbps Network Out

I installed Magento 2.3.5-p2 standard out-of-the-box installation via Softaculous with sample data but when I log in through the Admin panel - there is always a 5 second delay with anything I click on (the circle comes on for the 5 seconds). Also the front end is slow. This was confirmed by the hosting company's tech who had the same loading delay (he says 4-5 seconds). Standard Cache is enabled. There were NO modifications made whatsoever - we didn't load any customers, products or orders; we didn't install any extensions either.
Why is this happening and what can we do to get rid of this performance issue?


texts: What is the fastest way to update stock in Magento 2?

texts:
I'm trying to update product stock in Magento 2 (2.4). But it is slow. I've used these 2 different methods:

Proper way to update stock in >= 2.4? » Valid for Magento > 2.3
Magento 2: Programmatically Updating Inventory » Deprecated for Magento > 2.2

Both options take a lot of time to update each item ( > 1.5 seconds). Is there a faster way to update stocks? Something like the saveAttribute function we use for products?
Thanks in advance for your help :)


texts: Magento 2.3: How to set the default swatch selection pro-grammatically on product listing page?

texts:
I want to implement the selection of swatch options in a way that by default it should be selected 2nd swatch on listing pages.

Attribute name is color.

I looked over the following Blocks but not finding any clue.

vendor\magento\module-swatches\Block\Product\Renderer\Configurable.php
vendor\magento\module-swatches\Block\Product\Renderer\Listing\Configurable.php

Also, checked  vendor\magento\module-swatches\view\frontend\web\js\swatch-renderer.js and found below code. But this does not work and in JS all other functions are start with underscore(_) not accessible.

if (firstSwatch.length) {
    $(firstSwatch).focus();
}

In some cases, Color and Size will be there but we want to select only 2nd position of color if have.


texts:
I want to show captcha in Product Review Form, Followed the below link.

Magento 2: How Captcha Module works?

Created the module with relevant files and I am able to see the captcha in review form.

Here everything is fine but after submit always I am getting "Incorrect CAPTCHA" error.

Can anyone check it and help me why the accepted answer is not working here?

My Magento version is 2.3.0.

Thanks in advance!!


texts: Include Alertify module js file in module_catalog/view/frontend/web/js/catalog-add-to-cart.js in magento2

texts:
We have include the alertify js module in magento2 its loading perfectly with frontname, we have to inlude those aletify in module_catalog/view/frontend/web/js/catalog-add-to-cart.js

How to include this?


texts:
I put that function on the transpotbuilder file in core file , but it has still error:

  Fatal error: Class 'Magento\Framework\Mail\Template\Zend_Mime' not
  found in /var/www/html/vendor/magento/framework/Mail/Template

 public function addAttachment(
    $body,
    $mimeType    = Zend_Mime::TYPE_OCTETSTREAM,
    $disposition = Zend_Mime::DISPOSITION_ATTACHMENT,
    $encoding    = Zend_Mime::ENCODING_BASE64,
    $filename    = null
) {
    $this->message->createAttachment($body, $mimeType, $disposition, $encoding, $filename);
    return $this;
}

I added this function in core file and try to send attachment email and I got the Above error.


texts: Custom Theme Error - package name does not exist

texts:
I'm having problems getting the 'custompackage' theme I've set up recognised in the Admin panel. I've been able to successfully update the Theme>Default>custom theme but for whatever reason the package name isn't working.

I've followed the steps on the Magento Commerce pages 3 times but have had no luck. The troubleshoot information suggests that maybe i've got the directory wrong, but I'm reasonably confident that I don't - screenshots of where they're saved are below. Is there any other reason this might be happening?

I have also had problems installing Compass - is this possibly causing the problem?
(The error I get with this is 'marshal data too short (augment error). - Any help with that also would be greatly appreciated!)

Thanks!!


texts: Beta site missing "blocks" and "variables" from permissions menu in admin

texts:
Both my beta and live sites are on version 1.9.2.1

I run the update process on beta than live (of course)

My live site has 2 menu options under System > Permission, blocks and variables, these do not exist on beta.  I did not notice this before as previously I did not have a need for them, but now I do for a slider I would like to add in.

I have added the slider to live, as it was a simple fix, but I would love to be able to have beta match it and no idea why the pages do not exist.

I tried using the url from live, appending the portion between /index.php and '/key/` into the beta url.  the pages are not there.

I am assuming something didn't happen during an upgrade that stopped it from installing that portion on beta.

I just need to know what files I would need to move from live to beta to fix it?

UPDATE 1

per the suggestion of Rafael Corrêa Gomes below I have run the SUPEE-6788 fixer file from Github with no change (menu item still not visible, no ability to use block)

Script on Github: https://github.com/rhoerr/supee-6788-toolbox

Command to run: php -f fixSUPEE6788.php -- fixWhitelists

UPDATE 2

the database table permission_block exists in my database, I have manually entered the block for my slider and it is still not allowing it.

No log files indicating a conflict, and all the same mods/plugins are installed on both beta and live (though live does have my menu items, while beta is not showing it)

UPDATE 3

I have copied all of the files in SUPEE-6788 from my live site to beta (as all processes are done on both, they should be the same, right?) and now I have my menu items... but my slider is still not showing on the homepage.

In System > Permission, blocks I have the block bannerslider/default set to Allowed, but the homepage is not displaying the slider.  Uncertain, at this point, if this is a new issue, or still part of the original problem.  But, I am leaning to part of the original problem as it seems more logical that it would be to me.

No errors in any logs (in the beta site all error logging is on), and the slider works on the main site, just not in beta, which is why I believe the beta sites issue in my original question is still the issue


texts:
I have added size filter in Manadev Layered Navigation

Catalog Input Type for Store  - Multiple Select

Size filter is based on Range i.e

1.  0 to 0.5
2.  0.5 to 1
3.  1 to 1.5

Filter works fine when I update the record in catalog_product_index_eav,  catalog_product_index_eav_tmp and catalog_product_entity_varchar table.
But when I come next day , filter value get changed on above table.

Can anyone tell the reason why it is happening?

Is this because I have not updated the same in catalog_product_index_eav_idx  ?


texts: Magento 2: How to Create Paypal Order Programmatically?

texts:
I have below link for creating order

https://www.mageplaza.com/magento-2-create-order-programmatically.html

How can we create Order with Paypal?


texts:
Collections provide a handy means of getting a blank model - e.g.:

$quote->getItemsCollection()->getNewEmptyItem();

Is there any means of doing this from an existing model without having to call for the collection - in other words directly from the instance? Something like this:

$product = Mage::getModel('catalog/product')->load(43);
$productNew = $product->getNewEmptyItem();

I do realize I could call getCollection() on the product first - not sure if this has some overhead.

Edit:

Obviously $product = Mage::getModel('catalog/product'); produces the desired result. Obviously. What I'm looking for is a means of getting a blank object without reinstantiating the model.

Perhaps I just need to switch to using singletons to ease my mind.


texts: Uncaught TypeError: Cannot read property 'autocomplete' of undefined during checkout

texts:
During the checkout process on our production server, we are seeing the following JS error being thrown:

Uncaught TypeError: Cannot read property 'autocomplete' of undefined
at eval (eval at require.load
(0a2bd8d76c9749ab612ccf3234146c23.min.js:175), <anonymous>:2:524)
at Object.execCb (0a2bd8d76c9749ab612ccf3234146c23.min.js:112)
at Object.context.execCb (eval at require.load
(0a2bd8d76c9749ab612ccf3234146c23.min.js:175), <anonymous>:10:147)
at Module.check (0a2bd8d76c9749ab612ccf3234146c23.min.js:56)
at Module.<anonymous> (0a2bd8d76c9749ab612ccf3234146c23.min.js:72)
at 0a2bd8d76c9749ab612ccf3234146c23.min.js:11
at 0a2bd8d76c9749ab612ccf3234146c23.min.js:74
at each (0a2bd8d76c9749ab612ccf3234146c23.min.js:3)
at Module.emit (0a2bd8d76c9749ab612ccf3234146c23.min.js:74)
at Module.check (0a2bd8d76c9749ab612ccf3234146c23.min.js:61)

I know the stack trace isn't very helpful due to everything being compiled/minified in production and I'm currently unable to replicate in my dev environment due to some other issues I'm debugging, but I'm pretty sure the issue is the same issue described in this question here JS errors Magento 2, however the suggested solution hasn't seem to have any effect.

Edit: I have resolved the other issues in our dev environment, and can confirm it is indeed the same issue as reported in the question, but the suggested solution has had no impact.

This error appears to cause the 'Estimate shipping and tax' block that is displayed on the cart page to display as an empty block, see attached image below.

Anybody else ran into this issue?


texts: Magento 2 : Customer import not working and gives "Import successfully done"

texts: I have around 1000 customer to import when I try customer import using magento2 default customer import. Validation works perfectly and when I start import it gives me the message "Import successfully done" but no customer imported.


texts:
I'm customizing rwd theme. I'm not able to show breadcrumb on product page.

In admin breadcrumb is enabled for CMS pages. Inside rwd/default/layout/page.xml

<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>

is present.
Even I tried adding

<block reference="header">
   <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>

to default handle in page.xml

Inside catalog/product/view.phtml I've tried following codes

<?php echo $this->getLayout()->getBlock('breadcrumbs')->toHtml(); ?>

and

<?php echo $this->getChildHtml('breadcrumbs') ?>

Still it's not appearing on product page.


texts: changed default store for website - now some products do not work properly anymore

texts:
Assume we have one website and we have two stores for that website: StoreA and StoreB, plus a store view for each store of course, StoreA_view and StoreB_view. The default store for the website was configured to be StoreA.

Assume we have some products who were configured to be enabled in StoreB_view, but not in StoreA_view.

Now we changed the default store of the website to StoreB instead. Everything works fine - except for the products that should only be visible in StoreB_view and not StoreA_view.

The products can be found in StoreB_view just fine. They can also be added to the cart. However, when opening the cart, the items are not actually there. The cart will be empty - even though the cart sum will show, that one of those products is in fact in the cart. It's rather odd.

Is there anything that needs to be done after changing the default store of a website, regarding the products and their visibility? We already did a complete indexer:reindex - however that had no effect.

Magento version: 2.2.8


texts: How to get all the attributes of all Products. Magento2

texts:
I want to get all the products with all attributes it tried

$productCollectionFactory = $objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
$collection = $productCollectionFactory->create();
$collection->addAttributeToFilter(
    'status', array('eq' => \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
);
$collection->setStoreId(1);
echo '<pre>';

foreach ($collection as $productcollection) {
// $productcollection->save();
 print_r($productcollection->getData());

}

so If try this then it returns me specific attributes not all the attributes as you can see from the image

but if I remove the comment from the $productioncollection->save() as you can see from the above code then it shows all the attributes as shown in the image below

but after getting three(3) products it gives me an error
how to solve this error or how to get products with all attributes?


texts: how to add pagination by text box in magento 2

texts:
1)When we enter a product page number in text box it has to load that current page.
2)Display the remaining pages near to that text box.


texts:
When I complete an order, I configured Magento to send an e-mail to the buyer. But no e-mail are sent…

In the “sales email” page (in the system settings), I enabled all e-mails.
And in the “system config” page, serveur is “localhost” and port “25”.

I use CentOS.

Can you help me ?


texts: How to change category grid view - Image size

texts:
Is there anyway to change the image size in category grid view?

Can I do this with custom design in the category or does it have to be applied in every category?

I would like my images to be larger ideally around 350px and perhaps add a border around them.

I have browsed through stackexchange and google got some templatemonster results too, tried everything (refreshed cache and added new product after the changes) but I can't seem to make it work...

Any ideas?
using magento 1.9.2.2


texts: Magento 2: js-translation.json not generating in pub folder

texts:
On running setup: php bin/magento setup:static-content:deploy command,

  js-translation.json is not generating in
  "pub/static/frontend/theme_vendor/theme_name/en_US/--"

Any idea why it is happening?