texts: Improve Speed of this function - delete product images

texts:
I have a Mage CE 1.9.3+ store that hooks up to an ERP. The connector has pushed duplicate images to every product (3k+) - so we now have between 20-50 redundant images per product.

I've written something that I can call via the browser to clean up these surplus images category by category but its incredibly, incredibly slow. The user enters the category id & the function. At the moment I'm calling 'surplus' to remove these surplus images.

I'm using the media api. I suspect that the product is being saved after each image is removed & possibly re-indexed?

I'm sure this can be improved & speeded up by someone who knows their Magento better than I do.

// do an IP check
if (substr($REMOTE_ADDR != "ip")) {
    echo "You are not allowed!";
    exit();
}

include('app/Mage.php');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
error_reporting(E_ALL | E_STRICT);
Mage::setIsDeveloperMode(true);//not sure why I've set this!
ini_set('display_errors', 1);
ini_set('max_execution_time', 600);
ob_implicit_flush (1);
$mediaApi = Mage::getModel("catalog/product_attribute_media_api");
//take parameters
if (isset($_GET['function'])) {
    $method=$_GET['function'];
}
if (isset($_GET['categoryId'])) {
    $categoryID=$_GET['categoryId'];
}

$category = Mage::getModel('catalog/category')->setId($categoryID);
$attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
$_products = Mage::getResourceModel('catalog/product_collection')
    ->addCategoryFilter($category)
    ->addAttributeToSelect($attributes);

$i =0;
$total = count($_products);
echo 'PRODUCT count = '.$total .'
';
$position = array(0,1,2,3,4,5,6,7);
$count = 0;
$mediaApi = Mage::getModel("catalog/product_attribute_media_api");
foreach($_products as $_prod) {
    $prodID = $_prod->getId();
    $_product = Mage::getModel('catalog/product')->load($prodID);
    $items = $mediaApi->items($_product->getId());
    if (count($items) > 0) {
        foreach($items as $item) {
            if ($method == 'surplus') {
                if (in_array($item['position'], $position)) {
                } else {
                    removeSurplusImages($mediaApi, $_product, $item);
                    $count++;
                }
            } elseif ($method=='alts') {
                removeImagesWithAltTag($mediaApi,$_product, $item);
                $count++;
            }
        }
        echo "PRODUCT ". $_prod->getSku() . " done \n";
    } else {
        echo "
PRODUCT ". $_prod->getSku() . " has no images \n";
    }
}//EOF foreach

echo "
 finished removed product images $count  ";

/**
 * @param $mediaApi
 * @param $_product
 * @param $item
 * Deletes all images that have a position > 7. Checks that main or base
   image is not deleted
 * There may be > 1 image with position 6, for example. Such images will not
   be deleted
 */

function removeSurplusImages($mediaApi,$_product, $item)
{
    if ($_product->getSmallImage() != $item['file']
        && $_product->getThumbnail() != $item['file']
        && $_product->getImage() != $item['file']) {
        $mediaApi->remove($_product->getId(), $item['file']);
    }
    return;
}

/**
 * @param $mediaApi
 * @param $_product
 * @param $item
 * Deletes all images that have a label/alt tag.
 */
function removeImagesWithAltTag($mediaApi,$_product, $item)
{
    if ($item['label'] !='') {
        $mediaApi->remove($_product->getId(), $item['file']);
    }
    return;
}

Thanks for any help.


texts:
I have some products I want to delete from my website. It means I don't want them in catalog nor in search results.

In the same time I don't want 404 error page for these url products. Best solution for me would be: set stock availability to "No longer available" and set visibility "show only individually".

Is possible to achieve similar result?


texts: How to add a button in a Shopping Cart page?

texts:
i am trying to add a button in the Shopping Cart Page. I am not able to understand how to do it.

Can anyone please help ?


texts: How to grant Oauth access to API without cut-and-pasting the consumer key?

texts:
The documentation about the OAuth API looks very fuzzy on one point: how the client app is supposed to get the consumer key in the first place?

Indeed, let's say we have a webapp (SaaS) named FooX which need to pull data from the Magento API. After the registration within FooX, teh webapp would forward the merchant (aka the admin of the Magento instance) toward its Magento store, initiating the OAuth process.

However, looking at the documentation, it seems to me that the merchant is supposed to first to manually create a consumer app and then, manually move - aka cut-and-paste - those keys into FooX; which seems to completely defeat the purpose of having OAuth in the first place.

Could someone shed some light on the expected user experience associated to an OAuth integration with Magento? Is the merchant really expected to copy and paste keys around manually? Thanks!


texts: Custom Attribute Source Model for Multiselect

texts:
I followed this tutorial here: http://inchoo.net/ecommerce/magento/how-to-create-custom-attribute-source-type/

In this tutorial, there are two key settings which I want to change:

'type'              => 'int',    //backend_type
'input'             => 'select', //frontend_input

I tried using this:

'type'              => 'varchar',    //backend_type
'input'             => 'multiselect', //frontend_input

This works great from a UI standpoint, but I can't get Magento save any selection when I have the attribute setup this way.

How can I make a custom attribute source model that fully supports multiselect?


texts: Magento 2: How to change the icon in product description page?

texts:
in product description page, after adding to chart page I have 2 icons, 1st for add to favorite and 2nd for share And I want to change this like this and want to change star rating color to pink. how can I do it? I want something like this

Someone said I need to change in AddtoLinks.php

if ($this->wishlistHelper->isAllow())
            {
                $html .= '
                wishlistLabel . '"
                    aria-label="' . $this->wishlistLabel . '"
                    data-post=\'' . /* @escapeNotVerified */ $this->wishlistHelper->getAddParams($product) . '\'
                    data-action="add-to-wishlist"
                    role="button">

                        ' . $this->wishlistLabel . '

                ';
            }


texts: Magento 2 - CSS is only successfully compiled after removing a series of directories

texts:
I'm having a little trouble compiling the CSS in Magento 2. I'm well versed in the ways of Magento 1x but I've only worked a little in M2, so I apologise.

When experimenting with M2 I managed the CSS just fine, but the site I'm using in particular has been worked on by another individual so it's been set up in a different way.

Useful Info:

Magento 2.2.3
Developer Mode Enabled
Using built in pre-processor
Theme is a child of Ultimo theme.
Site is being run locally on wampserver.

So basically the child theme is set up correctly as far as I can see. However when I attempt to change anything (in Vendor/theme/web/css/_custom.less) it doesn't update at all.

I clear the cache, remove the pub/static folder (being careful with the .htaccess), run php bin/magento setup:static-content:deploy
-f (I know that's not needed in developer mode but hey) and clear the preprocessed folder. None of these when run individually update my CSS with the changes made.

I stumbled across this post : Magento2 changes not deployed which tells me to run rm -rf var/page_cache/* var/view_preprocessed/* var/generation/* var/cache/* pub/static/*. After about 2 mins of waiting, my CSS finally updates! This is great but I don't fancy quadrupling my workflow time every time I need to change some CSS.

I've tried running each command individually but no updates are made. In fact, if I remove the styles-l.css, the file gets regenerated but without the updates!!

I should also mention that any changes I do to template files update just fine - no deployment needed.

Please can anyone advise me what I could or could not have configured? The staging site works just fine as does the version on my colleague's machine.


texts:
Magento2 if i got to
mywebsite.it/searchterms
Magento2 will open a connection in the db and search the product. I would like to disable this feature because has been used on a DDOS attack.
How can i disable it?
Best regards


texts: Error filtering template: Warning: Invalid argument supplied for foreach() in magento 2.4.0

texts:
Error filtering template: Warning: Invalid argument supplied for foreach() in /var/www/html/magento2/app/code/Vendorname/Modulename/view/frontend/templates/email_items.phtml on line 10

<?php $items = $block->getItemDetails() ?>

    Name
    Condition

<?php foreach ($items as $key => $itemName): ?>

        <?php echo $key; ?>
        <?= $itemName ?>

<?php endforeach; ?>


texts: Display total price and total items in minicart

texts: I have installed magento 2.0.7 and overide the template minicart.phtml to my custom theme. I want to show total price and total items in the header minicart like the below image


texts:
I want to be confident that access to my Magento 1 code bases is restricted.

I have:

created a folder in my Magento root directory named public
moved .htaccess to public/.htaccess
created public/index.php

and created symbolic links of public/js, public/skin, and public/media

This setup isn't much different than creating a new Magento website in a multi-site setup. Is there anything else I should be considering?


texts: Magento 2 : Check Static Block with same identifier in InstallData Script

texts:
I am creating module which will create static block & cms page at time of site transfer.

So my InstallData file like below :

class InstallData implements InstallDataInterface
{
/**
 * @var BlockRepositoryInterface
 */
private $blockRepository;
/**
 * @var BlockInterfaceFactory
 */
private $blockInterfaceFactory;

private $pageFactory;

 public function __construct(
    PageFactory $pageFactory,
    BlockRepositoryInterface $blockRepository,
    BlockInterfaceFactory $blockInterfaceFactory
) {
    $this->pageFactory = $pageFactory;
    $this->blockRepository = $blockRepository;
    $this->blockInterfaceFactory = $blockInterfaceFactory;
}

/**
 * Installs data for a module
 *
 * @param ModuleDataSetupInterface $setup
 * @param ModuleContextInterface $context
 * @return void
 */
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $this->createCopyRightBlock();
}
public function createCopyRightBlock()
{
    $cmsBlock = $this->blockInterfaceFactory->create();

    $content = "

Copyright © 2017 Test Title

";
    $identifier = "copy-right";
    $title = "Copy Right Block";

    // We can then use the exposed methods from
    // \Magento\Cms\Api\Data\BlockInterface to set data to our CMS block
    $cmsBlock->setData('stores', [0])
        ->setIdentifier($identifier)
        ->setIsActive(1)
        ->setTitle($title)
        ->setContent($content);

    // And use the \Magento\Cms\Api\BlockRepositoryInterface::save
    // to actually save our CMS block
    $this->blockRepository->save($cmsBlock);
}   }

I want to check if there is static block with same identifier exists then script execution will be skip.

Please advice me how can i make condition for that.

Thanks


texts: magento 2 How to set attribute value to product during product import

texts:
I need  to add product attribute value to product during import product programatically how to add this in magento 2?
can anyone advise me?


texts: MSI and Shipping charges and Tax calculation Magento2 M2

texts:
Having query related to shipping charges when we use MSI.
For example :
We have configured MSI. For each product we are having multiple warehouse/source available.
Cart : 3 items in cart

Item 1 - available in ABC (California) ware house
Item 2 - available in ABC (California) ware house
Item 3 - available in PQR (Washington) ware house

Company registered in Alaska.
Query :

How magento will calculate table rate shipping charges in this case because items are
shipped from 2 different locations

Normally how magento calculates shipping charges when used multi source inventory and some products in cart available from specific store and others are from different store.

How magentp will calculate tax because in this case both items are having different origin for shipping.


texts: Uncaught TypeError: $el.ColorPicker is not a function Magento 2

texts:
Magento ver. 2.0.18

I created a custom module in backend there is color picker options.

for this i used this link color picker answer of @EmizenTech

it works perfectly but some time it gives and if i refresh the page error gone, in network i can see the jquery is loaded before the colorpicker.js

 index):421 Uncaught TypeError: $el.ColorPicker is not a function
        at HTMLDocument.<anonymous> ((index):421)
        at fire (jquery.js:3232)
        at Object.add [as done] (jquery.js:3291)
        at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)
        at (index):416
        at Object.execCb (require.js:1650)
        at Module.check (require.js:866)
        at Module.<anonymous> (require.js:1113)
        at require.js:132
        at require.js:1156

My /var/www/html/magentoce20/app/code/Companyname/ModuleName/Block/Color.php

<?php

namespace Companyname\ModuleName\Block;

class Color extends \Magento\Config\Block\System\Config\Form\Field {

    /**
     * @param \Magento\Backend\Block\Template\Context $context
     * @param Registry $coreRegistry
     * @param array $data
     */
    public function __construct(
    \Magento\Backend\Block\Template\Context $context, array $data = []
    ) {
        parent::__construct($context, $data);
    }

    protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) {
        $html = $element->getElementHtml();
        $value = $element->getData('value');

        $html .= '<script type="text/javascript">
         require(["jquery","jquery/colorpicker/js/colorpicker"], function ($) {
                $(document).ready(function () {
                    var $el = $("#' . $element->getHtmlId() . '");
                    $el.css("backgroundColor", "'. $value .'");

                    // Attach the color picker
                    $el.ColorPicker({
                        color: "'. $value .'",
                        onChange: function (hsb, hex, rgb) {
                            $el.css("backgroundColor", "#" + hex).val("#" + hex);
                        }
                    });
                });
            });
            </script>';
        return $html;
    }

}

My /var/www/html/magentoce20/app/code/Companyname/ModuleName/view/adminhtml/layout/adminhtml_system_config_edit.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="jquery/colorpicker/css/colorpicker.css"/>
    </head>
</page>

My /var/www/html/magentoce20/app/code/Companyname/ModuleName/view/frontend/requirejs-config.js

var config = {

    deps: [
        "Companyname_ModuleName/js/main",
    ],

     map: {
        '*': {
            'slickjs': 'Companyname_ModuleName/js/slick/slick'

        }
    }

};

UPDATE : I just wrapped my colorpicker code in load so that html loads completely first and than js comes , i know require is doing same thing in magento 2 but currently this solves my issues.
               $(window).load(function() {


texts: Which is correct way to create new custom theme in magento 2.0.4 under pub/static/frontend folder or app/design/frontend folder?

texts: Which is correct way to create new custom theme in magento 2.0.4 under pub/static/frontend folder or app/design/frontend folder ?


texts: Is there an updates checker extension for commercial extensions?

texts:
I was wondering if there are any extension stores which allow small developers to sign up (like nr-apps.com does) and publish their own work, but also have a ready made version checker which contacts the store?

Obviously the Connect Manager does this for free extensions but it's useless otherwise.


texts: magento delete all product and reindex from start

texts:
i want to reindex product id after i delete all product from admin .
From admin i deleted all products , but when i add new product i still see product ids to be increment from last product id, How can it be fixed , i do not want to run query on database as it may cause some issue .

Please help me to fix it


texts: Magento 2 : Redirect on cart page after login

texts:
I want to redirect the customer to cart page after login from anywhere ex.login from checkout page or customer account login.

Anyone know how to do this?

Please help me.


texts: Magento - add productcustom option to Shopping cart rule condition

texts:
I would like to add my product custom option (which programmatically added) to the Shopping Cart Price Rules (in Promotion).

If option value is 1 and customer add 3 (6,9 etc) of such product with the selected the same option in shopping cart, get x% discount(could be different product).

how to pass my custom option to the Shopping Cart Price Rules condition tab. Is there any possibility or I have to write my own Shopping Cart Price Rules?


texts: Get Payment Update for orders with Pending Payment Review status

texts:
Magento 1.9.X

Need a code to do the following: Run function "Get Payment Update" for each order that has status "Pending Payment Review" if order on authorize.net is approved, save order and update order status to Processing.

I could then set up the cron to run above function every hour or so.

Here is the code I have right now, but I had this code running for just changing all Order statuses to Processing, which is not convenient:

   <?php
     include_once './app/Mage.php';
     Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

     $orders = Mage::getModel('sales/order')->getCollection()
     ->addFieldToFilter('status', array('nin' => array('pending_payment','payment_review')));

     foreach ($orders as $order) {
        $orderId = $order->getId();
        $fullOrder = Mage::getModel('sales/order')->load($orderId);
        $fullOrder->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
        $fullOrder->setStatus('processing', false);
        $fullOrder->save();

        try {
          if(!$fullOrder->canInvoice()) {
             Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));
          }
          $invoice = Mage::getModel('sales/service_order', $fullOrder)->prepareInvoice();
          if (!$invoice->getTotalQty()) {
             Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
          }
          $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
          $invoice->register();
          $transactionSave = Mage::getModel('core/resource_transaction')->addObject($invoice)->addObject($invoice->getOrder());
          $transactionSave->save();
        }
        catch (Mage_Core_Exception $e) {
        }
     }

  ?>

Thanks in advance!


texts: How can i modify admin category product pagination in magento 2?

texts:
I want give custom pagination for category product list like more than 200 or 999.

So, admin user can see more than 200 products at a time.


texts: I am getting this kind of error while installing magento 2.3.5 on ubuntu 16.04

texts:
I want to install magento 2.3.5-p1 community edition on ubuntu 16.04 but when i am extracting directory to my location of htdocs by creating new folder of M2 and going to install magento but it still giving me below error:
Fatal error: Uncaught ReflectionException: Class Magento\Framework\App\ResourceConnection\Proxy does not exist in /opt/lampp/htdocs/M2/vendor/magento/framework/Code/Reader/ClassReader.php:26 Stack trace: #0 /opt/lampp/htdocs/M2/vendor/magento/framework/Code/Reader/ClassReader.php(26): ReflectionClass->__construct('Magento\Framewo...') #1 /opt/lampp/htdocs/M2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(54): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #2 /opt/lampp/htdocs/M2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo...') #3 /opt/lampp/htdocs/M2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...') #4 /opt/lampp/htdocs/M2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo in /opt/lampp/htdocs/M2/vendor/magento/framework/Code/Reader/ClassReader.php on line 26


texts: Undefined index: entity_type_id while installing data in Magento2.1

texts:
I have upgraded my Magento-1.9 Module to Magento 2.1 while upgrading the Extension I am getting the following Exception:

Installing data...

[Exception]
  Notice: Undefined index: entity_type_id in D:\wamp64\www\..\vendor\m
  agento\module-eav\Setup\EavSetup.php on line 1065

setup:upgrade [--keep-generated] [--magento-init-params="..."]

Can somebody let me what could be the issue with entity_type_id?


texts:
good afternoon
I have the MageWorx multifee module and Id like to add the multifee on the quotes of the Cart2Quote module (emails ect). How can I do this
Thank you for the attention
Malka Hakuk


texts: magento 2 : getting shipping rates table data

texts:
Iam having shipping rate data in database table.

    Country Region  Zip Code    Order  (and above)  Shipping Price
      IN       *        *          0                     45
      IN       *        *          25                    50
      IN       *        *          50                    55
      IN       *        *          76                    60
      US      AK        *          0                    100
      US      NY        *          51                   110
      US      CA        *         101                   120
      US      FL        *         151                   130

How to get data based on country with ip address.I want to show it in product page tab


texts: How to update magento 1.9.1.0 to 1.9.2.3

texts:
Can yo please help us to update our old version of Magento in Simple steps as after Searching I tried and there are errors in My website.

Thanks,


texts: Create product attribute with options in magento2 through rest API

texts:
I have created a custom module to create product attribute with option thruogh rest Api.

Here is my code samples.

etc/webapi.xml

<route url="/V1/attribute/attributeCreate" method="POST">
    <service class="Vendor\Module\Api\AttributeInterface" method="AttributeOptionCreate"/>
    <resources>
        <resource ref="Vendor_Module::custom"/>
    </resources>
</route>

Api/AttributeInterface.php

namespace Vednor\Module\Api;

interface AttributeInterface
{
/**
 * POST for attribute api
 * @param mixed $param
 * @return array
 */

public function AttributeCreate($params);

/**
 * POST for attribute option api
 * @param mixed $param
 * @return array
 */

public function AttributeDelete($params);

}

etc/di.xml

 <?xml version="1.0"?>
  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc /config.xsd">

<preference for="Vendor\Module\Api\AttributeInterface"
            type="Vendor\Module\Model\Attribute" />
</config>

Model/Attribute.php

  namespace Vendor\Module\Model;
  use Vendor\Module\Api\AttributeInterface;
  use Magento\Eav\Setup\EavSetupFactory;
  use Magento\Store\Model\StoreManagerInterface;
  class Attribute implements AttributeInterface
  {
   protected $_eavSetupFactory;
   protected $_storeManager;
   protected $_attributeFactory;
   protected $eavAttributeFactory;
   protected $attributeOptionManagement;
   protected $productFactory;

   private $productAttributeRepository;
    public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectManager,
    \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attributeFactory,
    \Magento\Eav\Model\Entity\AttributeFactory $eavAttributeFactory,
    \Magento\Eav\Api\AttributeOptionManagementInterface $attributeOptionManagement,
    \Magento\Catalog\Model\ProductFactory $productFactory,
    \Magento\Catalog\Model\Product\Attribute\Repository $productAttributeRepository
) {
    $this->_objectManager = $objectManager;
    $this->_eavSetupFactory = $eavSetupFactory;
    $this->_storeManager = $storeManager;
    $this->_attributeFactory = $attributeFactory;
    $this->eavAttributeFactory = $eavAttributeFactory;
    $this->attributeOptionManagement = $attributeOptionManagement;
    $this->productFactory = $productFactory;
    $this->productAttributeRepository = $productAttributeRepository;
}

public function AttributeCreate($params) {
    return 'Response: ' . json_encode($params); exit;
    $resultArr = array();
    $paramArr = array();
    $result =  json_encode($params);
    $resultSet = json_decode($result,true);
   }

 }

I have my json request like below

{
  "params":{
     "Attribute":"brand",
      "OptionValues":{
         "Value": "test1",
         "Value": "test2",
         "Value": "test3"
   }
  }
}

I am looking for logic to create attribute with option in my Model file.

I need to create attribute with the respective type, like dropdown, text and boolean.

As i checked finding code from installer only. can we create attributes from custom api like above.

Can anyone help me on this pls. Thanks in Advance


texts: Magento 1.9 customers receiving old confirmation emails

texts:
We are having a strange issue in magento 1.9. Our customers are receiving order confirmation emails of the orders which are already completed.

What could be the cause of this issue?


texts: How can I make a cms pages product price dynamic?

texts: So I have a cms page which I use as a lading page. The page is custom html coded with 3 of my products (basically showing the product and the price). When you click on an "Buy Now" button it takes you to the products product page where then you can add to cart. Since the prices on the landing page are hardcoded, when the products pricing is changed the landing pages price does not change. How can I make it Dynamic so that when the products price changes... the landing pages prices will change to?


texts: Magento 2 - custom option for coupon code

texts:
In the Marketing > Cart price rules rule section I would like to create a custom option for my coupon that allows me to apply the discount in money and not as a percentage.
To make myself better understood I would like to duplicate the option:
"Percentage discount on the product price"
and make it become
"Cash discount on the price of the product"

How can I add this option in the coupon and make it work with the catalog pricing rules?


texts:
Basically I want to show Customer's Order Details information in order History page under Customer Account My Order History Page.

Exactly what I'm did?

I have overridden

  vendor/magento/module-sales/view/frontend/templates/order/history.phtml

through below layout change :

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

        <css src="Btech_OrderTracking::css/custom.css"/>

        <referenceBlock name="sales.order.history">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Btech_OrderTracking::order/history.phtml</argument>
            </action>
        </referenceBlock>

</page>

In my history.phtml

  app/code/Btech/OrderTracking/view/frontend/templates/order/history.phtml

    <?php foreach ($_orders as $_order): ?>

<?php echo $_order->getRealOrderId() ?>

                Want to Show Order Items

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

I want like as like below screen :


texts:
this is my code in magento 1

class Namespac_Modulename_Model_Observer
{
    public function modifyPrice(Varien_Event_Observer $obs)
    {

        // Get the quote item
        $item = $obs->getQuoteItem();
        // Ensure we have the parent item, if it has one
        $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
        // Load the custom price
        $price = $this->_getPriceByItem($item);
        // Set the custom price
        $item->setCustomPrice($price);
        $item->setOriginalCustomPrice($price);
        // Enable super mode on the product.
        $item->getProduct()->setIsSuperMode(true);
    }

    protected function _getPriceByItem(Mage_Sales_Model_Quote_Item $item)
    {

        $price;
        $price = $_POST['finalPrice'];
        return $price;
    }

}

how i convert this in the magento 2


texts:
I receive the warning after upgrading to PHP 7.2 while running magento still in 2.2.
Warning: count(): Parameter must be an array or an object that implements Countable in /vendor/magento/module-catalog/Model/Product/Option/Type/Select.php on line 71

i tried changing count, but i am stuck.

   if (!$this->_isSingleSelection()) {
            $valuesCollection = $option->getOptionValuesByOptionId($value, $this->getProduct()->getStoreId())->load();
            if ($valuesCollection->count() != count($value)) {
                $this->setIsValid(false);
                throw new LocalizedException(__('Please specify product\'s required option(s).'));
            }
        }
        return $this;
    }


texts: How do i remove store view name from URL

texts:
Can any one point me on how to remove storeview name from my store?

When I go to www.domain.com

it works fine but when i try to go to a category or contact page or other products pages, it changes to

www.domain.com/storeview/category...

www.domain.com/storeview/products/...

and when i click on logo which is suppose to give me the base url, what it does is www.domain.com/storeview

instead of www.domain.com

Any help will be appreciated...


texts: How can I check if a product photo is "excluded"?

texts:
My product page template seems to be showing all photos linked to a product, even if they have the "Exclude" option set. How can I check if an image has the "exclude" option set? I want to add a simple "if not" statement to my template that says "if it is not excluded, display it."

UPDATE:

I tried the following code and it still showed all images

<?php $ac=0; foreach ($_product->getMediaGalleryImages() as $image): ?>
                <?php if( $image->getExclude()==0 ): ?>

        <img class="<?php echo Mage::helper('catalog/image') ->init($_product, 'image', $image->getFile())->resize();?>" src="<?php echo Mage::helper('catalog/image') ->init($_product, 'thumbnail', $image->getFile())->resize(66,66);?>"  alt="<?php echo Mage::helper('catalog/image') ->init($_product, 'image', $image->getFile())->resize(1200);?>">

            <?php $ac++;
            endif;
              endforeach; ?>


texts: Magento 2 Add Custom Tooltip to Shipping Methods On Checkout Page

texts:
I am using magento 2.3.3
I want to add tootlip in every shipping method
like:
Flat rate (i) This is for flat rate information content
I want to like this as above (in bold) after Flat rate
anyone help here
thanks in advance


texts: How can we show error with $rowData When Any Error Occur At Customer Data Import Using CVS In Magento 2

texts:
How can we show the Row Data at specific row error show in magento 2
i want to need to show that specific empty row row data at error place here i share the screen shoot

at this red-box place i need to show that row data also any idea how can i show that row data at this place


texts: Does magento connect manager not work on localhost?

texts:
I'm about to upgrade my 1.9.2.2 Magento shop to 1.9.3, amongst others, for security reasons.

We have a workflow set up that enables us to test everything locally first, using vagrant. This is obviously encouraged.
However, using the manager it does not display that any plugins need updates. Running the same manager in my production environment, this DOES display which extensions (including the core) can be updated.

Is there some sort of restriction on using manager for localhost? Or better yet, is there some sort of config file, creating the login from the manager to Magento community, that may be misconfigured on my localhost?

I can't seem to upgrade my application, as patching it on production is just too ballsy (we have quite a few extensions).

I should note that I have only been working with Magento for a few months, and only learned about the manager today.

UPDATE:

It seems as if this case is related: Magento isn't upgradable through Magento Connect Manager

I am not sure if that is still a thing though, as the server on which I am running the installation, was initiated through GIT, based on a production environment we had on a different server.
However, the manager IS working on production, so does not entirely explain. I will try on localhost.


texts: How to Interract with Knockoutjs Variables | Magento2

texts:
1) I'm trying to filter the customer addresses in the checkout according to their postal code. The address blocks are displayed using the following knockoutjs code:

  vendor/magento/module-checkout/view/frontend/web/template/shipping-address/list.html

First thing, I'm struggling to understand where the elems variable comes from. Where should I be looking for its declaration?

2) Then I've been able to retrieve the postcode from the element object, and add a comparison to a hardcoded value. The following code works, only displaying the addresses whose postal code is 12345:

But how can I pass a value from php or jQuery (or a knockoutjs selector?) to use as my comparison instead of the hardcoded string?


texts: Magento : 6788 patch applied but magereport not showing

texts:
I installed 6788 patch to my 1.9.0.1 magento site.It is installed succesfully but magereport showing as "not installed".

I think iam using custom theme, so that it is not showing? How to do it?


texts: catalog search result default sortBy by multiple attributes at once

texts:
I want to sort my catalog search result by multiple attributes.

For default sorting by price I have added below code in xml file :

...
<catalogsearch_result_index>
    <reference name="search_result_list">
        <action method="setDefaultDirection"><param>asc</param></action>
        <action method="setSortBy"><param>price</param></action>
    </reference>
</catalogsearch_result_index>
...

This is working correctly.

I have a custom attribute says "Is Special" (Yes/No) for product and want to show all special products on top in catalog listing with price asc order and then other product with price asc order.

For this I have tried below code in Custom_Module_Model_CatalogSearch_Layer

...
$collection->addAttributeToSort('special', 'DESC');
$collection->addAttributeToSort('price', 'ASC');
...

Sorting by only special attribute $collection->addAttributeToSort('special', 'DESC') working but not working in combination as I want.

How to do that?

EDIT : result of $collection->getSelect()->__toString()

SELECT `e`.*, `search_result`.`relevance`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id AND search_result.query_id='55'
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2'
 LEFT JOIN `catalog_product_entity_int` AS `special_t` ON e.entity_id=special_t.entity_id AND special_t.attribute_id='132' AND special_t.store_id='0' ORDER BY `special_t`.`value` DESC, `price_index`.`min_price` ASC


texts:
Ive installed a new magento theme/template from Template monster and I updated my magento to the latest 1.9.3 version of Magento and then installed.

Ive noticed that My tier prices dont show on the product page.  It did and does on the old theme.  Template monster say as the template is compatible with 1.9.2 they cant help.

Any ideas on how to get the tier pricing to show again on page view?

Thank you


texts: How to check if a product is within category several levels down

texts:
Hi so I have a hierarchy of categories, the parent of which is Ranges

Each range may have subcategories several levels deep.

What I need to do is check to see if the current product belongs to a category which is in ranges.

For example the product may be in several categories as follows:

Tables > Coffee Tables

Chairs > Comfy Chairs

Ranges > Range Name > Range

If any category is found which is an ancestor (no matter how many levels deep) or ranges, I want the logic to return true.

Here's what I have so far...

<?php
$_product = Mage::registry('current_product');
$categoryIds = $_product->getCategoryIds();
    if(count($categoryIds) ){
        foreach ($categoryIds as $cat) {

            $_category = Mage::getModel('catalog/category')->load($cat);

            if($_category->getParentId() == '683') {
                $_catname = $_category->getName();
                $_catimg = $_category->getImageUrl();
                $_caturl = $_category->getUrl();

                ?>

                    <img src="<?php echo $_catimg;?>" alt="Part of the <?php echo $_catname;?> range" />

                        Part of the

                            <?php echo $_catname;?>

                        Range

                        <a class="btn btn-blue btn-large" href="<?php echo $_caturl;?>">
                            View All

            <?php }
        }
    }?>

I think the problem is that getParentId only refers to the immediate parent, I want this to return true if 683 is an ancestor on any level.

Hope that makes sense,


texts: Magento admin order PayPal email link module

texts:
I am looking for a way to create an admin order in Magento that, once submitted, sends an email containing a link to pay by PayPal with the payment linked to the order so that the status updates automatically from pending to processing once the payment has been received.

Is this possible - has anyone else either found a module to do this or had a custom module built.

I have just switched to Magento from OpenCart and my admin order section in OpenCart had this functionality so my customers and staff expect to be able to use it in Magento.  It is particularly important when conversing with customers over Facebook as they often ask to pay by PayPal and request us to build the order for them.  I can build the order in Magento but can't see any easy way to send them a link requesting payment...

Help please!!!

Thanks,

Hugh


texts: How to remove Category name on list page? have pic

texts:
For example, the category name is SHOES, I do not want to appear on the page

How to remove Category name on list page? Where can I modify? ptml??


texts: Magento2.3.0 any one use layered navigation with multi select checkbox using category and other attribute filter

texts:
I am using Magento2.3.0 community version and I have integrate all free version layer navigation but not working  so my requirement is attribute option with checkbox  select than not remove in existing filter section inside.so if any one know this type of feature available in extension please reply me link and name and compatible with my magneto version.

Thanks in advance


texts: Mageplaza Magento 2 Products Slider Category ID not working?

texts:
https://github.com/mageplaza/magento-2-product-slider

When using the CMS shortcode for selecting a category:

{{block class="Mageplaza\Productslider\Block\CategoryId" template="Mageplaza_Productslider::productslider.phtml" products_count="8" heading="test heading" category_id="5" description="test"}}

the category_id field apparently is wrong/incorrect? My category 5 is a child category of the Default Category in Magento 2.2.7

I get the following error:

  Error filtering template: Warning: Invalid argument supplied for
  foreach() in
  /Applications/MAMP/htdocs/MYFOLDER/vendor/mageplaza/magento-2-product-slider/Block/CategoryId.php
  on line 96

Can anyone help ASAP?

I have products within this category so it should be fine?


texts: Get quantity of simple products in configurable products on list.phtml

texts:
I'm trying to get the qty of simple products in configurable products in the list page and it works with this code inside the product collection foreach:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');

foreach ($_productCollection as $_product):

$configProduct = $objectManager->create('Magento\Catalog\Model\Product')->load($_product->getId());

$_childrens = $configProduct->getTypeInstance()->getUsedProducts($configProduct);
 foreach ($_childrens as $child) {
  if ($StockState->getStockQty($child->getId(), $child->getStore()->getWebsiteId()) == 0) {
   echo "" . $child->getAttributeText('size') . "";
  } else {
  echo "" . $child->getAttributeText('size') . "";
      }
}
endforeach;

But this is very SLOW! how can I get the qty without using the objectManager?

how need to extend the ProductList class? How?

thank you in advance for your support


texts:
I create a New Store in Magento with the code myshop and I add a domain in cPanel with the name my-shop.com, after I setup everything i copy the index.php file and .htaccess in the root my-shop.com, in index.php i add this:

$mageFilename = '../app/Mage.php';

and this

Mage::run('myshop', 'website');

but when i try to access the new domain my-shop.com i get this error "NetworkError: 404 Not Found". Anyone can tell me what is wrong?

I will list my errors:

"NetworkError: 404 Not Found - http://my-shop.com/"
my-shop.com
"NetworkError: 404 Not Found - http://my-shop.com/skin/frontend/default/theme668/css/styles.css"
styles.css
"NetworkError: 404 Not Found - http://my-shop.com/skin/frontend/default/theme668/css/photoswipe.css"
photoswipe.css
"NetworkError: 404 Not Found - http://my-shop.com/js/calendar/calendar-win2k-1.css"
calenda...k-1.css
"NetworkError: 404 Not Found - http://my-shop.com/skin/frontend/default/theme668/css/jquery.bxslider.css"
jquery....der.css
"NetworkError: 404 Not Found - http://my-shop.com/skin/frontend/default/theme668/css/bootstrap.css"
bootstrap.css
"NetworkError: 404 Not Found - http://my-shop.com/skin/frontend/default/theme668/css/font-awesome.css"
font-awesome.css
"NetworkError: 404 Not Found - http://my-shop.com/skin/frontend/default/theme668/css/responsive.css"


texts: Magento 2.x How to allow children of Configurable Products to have Custom Options?

texts:
In Magento 2.x, core functionality does not allow you to set Custom Options on child products belonging to a Configurable Product. If you attempt to set a custom option on such a child product (which in Magento 2.x is a Virtual Product), it is removed from the parent Configurable Product when you save it.

Are there any known workarounds to this limitation? Any help in writing custom code to support this in Configurable Products would be appreciated. Thanks.


texts:
I am developing a new product type. I based my tests on http://www.solvingmagento.com/creating-a-custom-product-type-in-magento/. I have renamed all the code to suit my company name.

The custom product type does appear in magento, but I can't add it to any orders (via the backend) when "create new order"

Say for example my new product has a type_id of "custom_product"

I looked in the catalog_product_entity table in the database and if i change the type_id field of one of my new products to one of the built in types such as virtual or simple, it shows up in the list of products in "create new order"

This is confirmed by turning on mysql query logging. here is an example of the query executed.

SELECT `e`.* FROM `catalog_product_entity` AS `e`
  INNER JOIN `catalog_product_website` AS `product_website`
  ON product_website.product_id = e.entity_id AND product_website.website_id = '1'
  WHERE (((`e`.`type_id` = 'simple') OR (`e`.`type_id` = 'virtual') OR
        (`e`.`type_id` = 'configurable') OR (`e`.`type_id` = 'grouped') OR
        (`e`.`type_id` = 'bundle') OR (`e`.`type_id` = 'downloadable')))
  ORDER BY `e`.`entity_id` DESC LIMIT 20

How do I specify what type_id s are in the filter? Is this in XML? Do I override a class? Is it configurable in the backend?

Thanks in advance.

EDIT ---------------- I FOUND THE ANSWER ----- BUT I'M NOT ALLOWED TO ANSWER IT!

add this to the config.xml

you need to add to the config.xml

<adminhtml>
    <sales>
        <order>
            <create>
                <available_product_types>
                    <affiliate/>
                </available_product_types>
            </create>
        </order>
    </sales>
</adminhtml>


texts: Shipping Charges not Showing in One-Page Checkout Progress Block

texts:
Delivery Surcharges and/or Shipping Charges (when applicable) are not showing in our One-Page Checkout Progress Block under 'Totals'. More specifically here: 'Your Checkout Progress > Payment Method > Totals' but these shipping charges do show up in the 'Shopping Cart' and on the 'Order Review' step of checkout. Please see image below:

Using Template Path Hints the block in question is shown here: frontend/base/default/template/{your package}/couponopc/checkout/onepage/progress/totals.phtml - But after looking in that file I only see a comment saying 'Dynamically loaded' as you see below. So is this essentially an issue with checkout.xml? I don't see one here: app/design/frontend/{your package}/{your theme}/layout/checkout.xml but I do see one here: app/design/frontend/base/default/layout/checkout.xml - I have included the applicable code from that file further down. I am not sure how to proceed from here.

from totals.phtml

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

from checkout.xml

<reference name="right">
            <action method="unsetChildren"></action>
            <block type="page/html_wrapper" name="checkout.progress.wrapper" translate="label">
                Checkout Progress Wrapper
                <action method="setElementId"><value>checkout-progress-wrapper</value></action>
                <block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml">
                    <block type="checkout/onepage_progress" name="billing.progress" template="checkout/onepage/progress/billing.phtml"></block>
                    <block type="checkout/onepage_progress" name="shipping.progress" template="checkout/onepage/progress/shipping.phtml"></block>
                    <block type="checkout/onepage_progress" name="shippingmethod.progress" template="checkout/onepage/progress/shipping_method.phtml"></block>
                    <block type="checkout/onepage_progress" name="payment.progress" template="checkout/onepage/progress/payment.phtml"></block>
                </block>
            </block>
        </reference>
        <reference name="content">


texts:
Is it possible to preview a theme I'm working on? I am creating a new theme for a Magento website but do not want my changes to be live on the main store until I am happy.

Is there a way to preview a theme in the admin panel or make theme-selection possible for logged in admins?


texts: Magento 2.3 static Block to replace subcategories in navigation

texts:
I am attempting to add a block in place of the subcategory in the main navigation or site navigation. I don't want to use a bloated extension, just minimal code. I am using a blank custom theme I made. In the photo below you will see the "Women" link has a block shown during mouse over dropdown instead of the subcategories. I will code the block with the rest of the mega menu in it per say.

I'm trying to make most of the links on the site navigation this way, 7 for now. The mobile view should be normal subcategory view.

i seen the post sort of like mine. It's not the same.

I GREATLY APPRECIATE the help. if you will please provide details if you can. folder structure / locations and where code gos as i may not be as well versed as the average bear.


texts: Magento 2: Get order ID and Date in DHL Shipping Carrier model

texts:
I have a requirement to attach the order ID and order date to the xml request (ShipmentRequest) located in /magento/dhl/model/Carrier.php

Is there a way to retrieve the order ID linked to this shipping request?


texts: Magento 2: Redirect from Category Page to CMS Page

texts:
I already gone through How to redirect a category to another link

Still i have issue. In my .htaccess , in <IfModule mod_rewrite.c> before end of </IfModule>

i wrote

Redirect 301 /subcart/product.html http://localhost/magento2/testcmspage


texts:
Here's my folder structure for my block:

Product
| - Form.php
Product.php

My product form is a Form Container which is supposed to launch the Form stored within Product -> Form.php

However, although Product.php is loading fine, the Product -> Form.php does not seem to be appearing. I have a simple form setup, with a simple field on there asking for a Product SKU. The Fieldset nor the form it's contained within are loading on the page.

<?php
/**
 * Form for Warehouse Products.
 * Loads individual items that make up the form itself.
 *
 * @author Dan Hanly
 **/
class Company_Module_Block_Adminhtml_Warehouse_Edit_Product_Form extends Mage_Adminhtml_Block_Widget_Form
{
    public $_id;        // Identifier of the block
    public $_title;     // Title of the block
    public $_form;      // Varien_Data_Form

    /**
     * Init class
     */
    public function __construct()
    {
        parent::__construct();

        $this->_id = 'product_form';
        $this->_title = $this->__('Product Information');
    }

    /**
     * Setup form fields for inserts/updates
     *
     * @return Mage_Adminhtml_Block_Widget_Form
     * @author Dan Hanly
     */
    public function _prepareForm()
    {
        $model = Mage::registry('module_warehouse');
        $request = $this->getRequest();

        $this->_form = $this->createForm($this->getUrl('*/*/save', $this->getUrlParameters($request)));
        $this->setForm($this->_form);

        $fieldset = $this->_form->addFieldset('base_fieldset', array(
            'legend' => $this->_title,
            'class' => 'fieldset-wide',
        ));

        if ($this->isEdit($request)) {
            $fieldset->addField('id', 'hidden', array(
                'name' => 'id',
            ));
        }

        $fieldset->addField('warehouse_id', 'hidden', array(
            'name' => 'warehouse_id',
            'value' => Mage::registry('module_warehouse')->getId()
        ));

        $fieldset->addField('product_id', 'text', array(
            'name' => 'product_id',
            'label' => $this->__('Choose Product'),
            'value' => $this->__('Choose Product'),
        ));

        return parent::_prepareForm();
    }

There's nothing relevant in the logs that would allude to this.

EDIT
I clarified my question to strip out parts that were irrelevant.


texts: how to add product size in proper order?

texts:
I have added the product size randomly and the result was, the numbers added last was shown at the end even if it is smaller than the above size:

I have also changed the position in admin panel:

Still not able to arrange the sizes in either descending or ascending order.


texts:
I'm getting 404 for my logo in my default.xml
Existing code:
<referenceBlock name="logo">
        <arguments>
            <argument name="logo_src" xsi:type="string">\images\logo-small-730.png</argument>
            <argument name="logo_alt" xsi:type="string">Book of Us</argument>
        </arguments>
    </referenceBlock>

What is the correct path to use in layout XML files?? in /app/design/frontend/themename/deafult/web/images


texts: Magento 2 - Update all configurable products after migration

texts:
I have migrated all the Magento 1.9.2 products to Magento 2.2.4 and would need that in each configurable product a single price is applied to each SKU, the price that the configurable product has.

Now all the configurable products are using the price attribute to each Sku.

Would there be a way to make an update of all the configurable products and for all of them to use a single price be applied to each SKU?


texts: Magento 2: how to add version in your assets (i.e ...sample.js?v=1 and ...sample.css?v=2)?

texts: I want to create a config where I can put asset version. This will be inserted on every included asset (particularly CSS and JS) as a query string. Example: sample.css?v=1


texts:
I'm using magento 2.1.9 and trying update cross sell product list.

So, where can I update the cross sell number of product on the list?


texts: Magento 2: Unable to write file into directory. Access forbidden

texts:
After upgrading from 2.1.5 to 2.1.6 CE. I'm getting below error on Windows WAMP while saving product on Admin side.

  Unable to write file into directory
  \D:/wamp/www/magento/pub/media/catalog/product\cache\3cf5799449660ed39031217945ace72a/H/3.
  Access forbidden.

I tried below but it's for Linux

Access Denied (Permission Issue) after upgrade 2.0.3 -> 2.0.4


texts: Why do I have to reset permissions of cache folder after every deploy?

texts:
I am following the standard deploy procedure for single machines except I am clearing the static folder as well as clearing and flushing cache.

I am forced to run sudo chown -R www-data:www-data var/cache


texts:
Magento just released a new version 2.3.3 with 170 core bugs fixes, supported PHP 7.3 and PSD2 compliance for core payment methods

Has someone faced any issue in Magento 2.3.3?

Thanks


texts: VAT validation for Not-Logged-in Customers or Guests

texts:
I'm working on this requirement from my EU client. We are on Magento 1.9.1 We have set up VAT validation and auto-group change based for valid and invalid VAT IDs and its working fine.

Now the twist is, we want to validate VAT for customers who are not logged in and move them to a customer group say "Not-Logged-in-Valid-VAT"

Is it possible to assign guest to a customer group since guest is not actually a full customer entity ? Is it possible to replicate the concept of Not-Logged-in customer group ?


texts: After Upgrading to 1.9.3.4 onepage checkout get suck to step 5 Payment Information

texts:
I have upgraded my magento to 1.9.3.4 and I got stuck at Payment Information step. Selecting a payment method and clicking continue doest not load next step. I have only two Payment method 1. Cash on Delivery 2. Check. When I saw the exception log. It says exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_PaypalUk_Block_Link_Shortcut' in /app/Mage.php:595.
Below is the complete error log with stack trace:

2017-07-29T14:54:48+00:00 ERR (3):
    exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_PaypalUk_Block_Link_Shortcut' in /mydomain/app/Mage.php:595
    Stack trace:
    #0 /mydomain/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
    #1 /mydomain/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('paypaluk/link_s...', Array)
    #2 /mydomain/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('paypaluk/link_s...', 'checkout.cart.m...')
    #3 /mydomain/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('paypaluk/link_s...', 'checkout.cart.m...')
    #4 /mydomain/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
    #5 /mydomain/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
    #6 /mydomain/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
    #7 /mydomain/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
    #8 /mydomain/app/code/core/Mage/Checkout/controllers/CartController.php(194): Mage_Core_Controller_Varien_Action->loadLayout()
    #9 /mydomain/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->indexAction()
    #10 /mydomain/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
    #11 /mydomain/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
    #12 /mydomain/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
    #13 /mydomain/app/Mage.php(684): Mage_Core_Model_App->run(Array)
    #14 /mydomain/index.php(83): Mage::run('', 'store')
    #15 {main}

I have added the formkey to form of each checkout step files of my theme. Also checked the opcheckout.js

if (elements[i].name=='payment[method]' || elements[i].name == 'form_key') {is available at opcheckout.js

Kindly help me.

Thanks


texts: Does somebody know how to remove the need of Update/Delete/edit actions from Gift-Message?

texts:
Unfortunately, to enter a gift-message customers have to click on update button to store the message. If he is not doing this, the message is not stored after the checkout is processed.
This is not good because each unneccessary click in the checkout is a bad click and I would like to have the gift-message without the need of these buttons.
Some extensions for an order comment doing it without the need of pressing a button for saving the comment.
Does somebody know how to do this or does somebody know an extension which is doing it?
Regards,
Chequille


texts:
In Magento 2 we have different classes to access session, depending on context we want to access it, for example \Magento\Customer\Model\Session or \Magento\Checkout\Model\Session. Recently I was wondering if in case of some bigger custom modules, when there is a need to use some session variables and so on it's good idea to implement custom session class to access php session.
If there a sense to do it, has anyone tried to do it, and can share some code or point some important issues while doing it.


texts: How to create an independent script run on Magento 2?

texts:
I'd like to create a file in the root folder (e.g. test.php) that I'll be able to do functions programmatically like update product attributes or something like that.

Can you show me some sample?

Thanks


texts: magento 2 custom component at checkout-step-shipping as shipping address child

texts:
I trying to add a custom template @ checkout between form customer login and shipping address inside div id="checkout-step-shipping"  there are 2 forms :

I've tried a few thing like 'before-form' etc.. I've manage to add before and after everything following this :https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_new_step.html
But Not able to add in between!
Here is my xml :

...<referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="shipping-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shippingAddress" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="MYCUSTOMHTML" xsi:type="array">
                                                        <item name="component" xsi:type="string">Magento_Checkout/js/view/shipping-address/MYCUSTOMCOMPONENT</item>
                                                        <item name="sortOrder" xsi:type="string">1</item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>...

Here is my component :

define(
[
    'uiComponent',
    'jquery',
    'Magento_Checkout/js/model/step-navigator',
    'Magento_Checkout/js/model/quote',
    'Magento_Ui/js/modal/alert',
    'Magento_Ui/js/modal/modal',
    'ko'
],
function (Component, $, stepNavigator, quote, alert, modal, ko) {
    'use strict';
    return Component.extend({
        defaults: {
            template: 'Magento_Checkout/shipping-address/MYCUSTOMCOMPONENT'
        },
        initialize: function () {
            this._super();
            console.log('LOADED!');
        }
    })
}

);

My html:

TEST TEST TESTE

This works I console.log LOADED but the html does not gets added!

Does anyone have any idea I ma not sure why the html not showing up as the component loads! any help Appreciate thanks!


texts: How should I insert data via in admin_user table via admin/permission/ create user.


texts:
Is there any one who can help me?

I see that Magento by default is US every city and province included.

But for my country, I only can see the name of my country, but i can't see any city drop-down option or  the names of my country city.

Is there any option to include the name of my city/province on the shipping address?

Thanks


texts:
We upgraded magento to 1.9.3.3. Now, We are not able to create account. It says "You don't have permission to access /customer/account/create/ on this server."

Any help would be appreciated.

Thanks.


texts: Fix issues with composer.lock and composer.json updatation

texts:
I am having issue of installing extension from CLI and it displays auto-load error of one past extension and says it's already defined.

  ie: Autoload error:  Module 'Mageplaza_Core' from
  '/vendor/mageplaza/module-core' has been already defined in
  'vendor/mageplaza/core-m2

'

I have checked composer.json and deleted extension lines from there but still  creating the same issue.

I think these issues can be fixed from composer.json or composer.lock.  I am not sure should I update composer.lock  or composer.json?


texts: Magento 2 sitemap url does not work after we add any rewrite rule in root htaccess file

texts:
Our sitemap URL works fine at /sitemap/sitemap.xml but as soon as we add any rewrite rule in root .htaccess file then it gives status code 404 page not found.
RewriteRule ^abc/(.*)?$ /media/doc/files/abc/$1 [R=301,NC,L]
Magento version 2.2.5


texts: Magento Store, Storeview and Currency Changer

texts:
I try to implement a store switcher for switching between Store,Store View and Currency.

With using this line: Mage::getModel('core/store_group')->getCollection();

I get the Store names (3 kinds) like: store 1,store 2

Store 1 has 3 Store views (German, English and Chinese)

How can i generate the link for switching between the Stores? (Not between Store Views)


texts: Elastic Search: Custom sorting options not working after enable elastic search

texts:
I'm trying to add custom sorting options like newest products,price high-to-low & price low-to-high in category page using plugin. After creating plugin it's working good in category page and search page but when i enable amasty's elastic search module then price high-to-low & price low-to-high sorting working proper in plp but not working in search page.
If from backend settings i'm select "MySql" option then custom sorting working proper and if i'm select elastic search from dropdown then it's not working.

Also newest product sorting not working in both plp and search page. I have already tried some of solutions suggested in stack as below links but no luck:-
Custom sort by is not working with elastic search in magento 2.3
Magento 2 How to add custom sort by option
Have somebody also faced same issue before? Any suggestions should be appreciated. Thanks.
Following are my module file:-
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
        <plugin name="custom_custom_block_toolbar" type="Namespace\Modulename\Plugin\Catalog\Block\Toolbar" />
    </type>

    <type name="Magento\Catalog\Model\Config">
        <plugin name="custom_catalog_model_config" type="Namespace\Modulename\Plugin\Catalog\Model\Config" />
    </type>

</config>

Config.php
<?php

namespace Namespace\Modulename\Plugin\Catalog\Model;

class Config
{
    public function afterGetAttributeUsedForSortByArray(
    \Magento\Catalog\Model\Config $catalogConfig,
    $options,
    $requestInfo = null
    ) {
        unset($options['position']);
        $options['high_to_low'] = __('Price - High To Low');
        $options['low_to_high'] = __('Price - Low To High');
        $options['newest'] = __('Newest');
        return $options;

    }

}

Toolbar.php
<?php
namespace Namespace\Modulename\Plugin\Catalog\Block;

class Toolbar
{

    public function aroundSetCollection(
    \Magento\Catalog\Block\Product\ProductList\Toolbar $subject,
    \Closure $proceed,
    $collection
    ) {
    $currentOrder = $subject->getCurrentOrder();
    $result = $proceed($collection);

    if ($currentOrder) {
        if ($currentOrder == 'high_to_low') {
            $subject->getCollection()->setOrder('price', 'desc');
        } elseif ($currentOrder == 'low_to_high') {
            $subject->getCollection()->setOrder('price', 'asc');
        }
        elseif ($currentOrder == 'newest') {
            //$subject->getCollection()->setOrder('entity_id', 'desc');
            $subject->getCollection()->setOrder('created_at', 'desc');
        }
    }

    return $result;
    }

}


texts: Get all visible products whose Quantity greater than 0 in Magento2

texts:
I have written a product collection to get all products whose quantity is greater than 0.

Here is my code for the collection

<?php
$websiteId = $this->storeManager->getStore()->getWebsiteId();

    $collection = $this->_productCollectionFactory->create();
    $collection->setVisibility($this->_productVisibility->getVisibleInSiteIds());
    $collection->addAttributeToSelect('*');
    $collection->addAttributeToSelect(array('entity_id','sku'));
    $collection->addWebsiteFilter($websiteId);
    $collection->addStoreFilter();
    $collection->addAttributeToSelect('*')->setFlag('has_stock_status_filter', true);
                    $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
                    $this->_stockFilter->addInStockFilterToCollection($collection);
                    $collection = $collection
                        ->joinField('qty',
                            'cataloginventory_stock_item',
                            'qty',
                            'product_id=entity_id',
                            '{{table}}.stock_id=1',
                            'left'
                        )
                        ->addAttributeToSelect('stock_status')
                        ->addAttributeToSort ( 'entity_id', 'DESC' )
                        ->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
                        ->addAttributeToFilter('qty',['gt'=>0])
                        ->load();

Above Query not loading condfigurable products, bcz all config parent products qty is 0.

How can i get all products which have in_stock here with qty condition. can someone help me out. Thanks!!!


texts: Best practice for cleaning fake customers in Magento 1

texts:
What if a Magento 1 shop had a nasty bot attack. Thousands of fake customer account were created and subscribed to the newsletter. Some of the account are quite easy to find (fake domains for example), others have another pattern (Front name and last name are exactly the same) and some follow no pattern at all.

Now we are faced with the task of cleaning out these fake customers / subscribers, and we I am wondering what would be best practice? Write an SQL script that filters customers based on certain patterns? Or something else?


texts:
I've written a module with an observer but when I try and use $this->__('something to translate') within the observer, I get the error Fatal error: Call to undefined method CompanyName_ModuleName_Model_Observer::__()

I assume this is failing because my observer class doesn't extend a Magento base class, so there is no code that would include my helper and hence the translation methods.

I've searched the Magento 1.9 codebase and can't find any examples of translations within an observer. I'm guessing this means that translating within an observer is not the Magento way, but I can't think of any other way of achieving what I want.

My Observer code is

<?php
class CompanyName_ModuleName_Model_Observer
{
    public function testfunction(Varien_Event_Observer $observer)
    {
        $test = $this->__('test translation');
    }
}

My config.xml look like this

<?xml version="1.0"?>
<config>
    <modules>
        <CompanyName_ModuleName>
            <version>0.1.0</version>
        </CompanyName_ModuleName>
    </modules>
    <global>
        <models>
            <modulename>
                <class>CompanyName_ModuleName_Model</class>
            </modulename>
        </models>
        <helpers>
            <modulename>
                <class>CompanyName_ModuleName_Helper</class>
            </modulename>
        </helpers>
        <events>
            <controller_action_predispatch_checkout_onepage_saveBilling>
                <observers>
                    <companyName_modulename>
                        <type>singleton</type>
                        <class>modulename/observer</class>
                        <method>signupPreference</method>
                    </companyName_modulename>
                </observers>
            </controller_action_predispatch_checkout_onepage_saveBilling>
        </events>
  </global>
</config>

And I have a Helper/Date.php which looks like

<?php
class CompanyName_ModuleName_Helper_Data
    extends Mage_Core_Helper_Abstract
{

}


texts: How do I translate a product description that is using the function getdescription to show the product description on the screen in 1.9?

texts: I have my product descriptions being shown using the getDescription function, and I just want to translate the text from English to French


texts: How to Override catalog_category_view.xml file in our theme?

texts: I have tried, it is working in base folder. but doesn't work in my custom theme fronted folder.


texts: How to restrict or hide fedex shipping method based on conditions at checkout page in magento 2

texts:
How to hide or restrict the FedEx calculation in the checkout page
I don't want to show the FedEx shipping method based on product attribute value at the checkout page?
For example

The attribute code "shipping_applicable_for_fedex"
If the attribute set as no, I don't want to show the FedEx shipping method on the checkout page
If the attribute is set as yes, I want to show the FedEx shipping method on the checkout page

Can anyone please guide me to achieve it?
Thanks in advance


texts: getSelect and Join: Adding a shipment status to the Invoice Grid.php

texts:
I am trying to perform a join in the invoice grid.php.

I am adding a column that I want to show one, of possibly many, shipment created_at rows attached to an Invoice.

The problem is that for many invoices more than one row in sales_flat_shipment_grid exist.

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->join('sales_flat_order', 'main_table.order_id = sales_flat_order.entity_id', array('shipping_description', 'shipping_amount'));

        $collection->getSelect()->joinLeft('sales_flat_shipment_grid',
           'main_table.order_increment_id = sales_flat_shipment_grid.order_increment_id',
            array('shipment_status' => 'created_at',
                  'shipment_entity_id' => 'sales_flat_shipment_grid.entity_id',
                  'shipment_order_id' => 'sales_flat_shipment_grid.order_id'
                  ));

        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

In this code snippet, I have tried assigning the sales_flat_shipment_grid entity id to an alias to avoid conflict with the main table entity id.

The issue is the final $collection->getSelect() line.  I cannot get the collection to retrieve just one of the multiple rows that are returned when looking up an order_increment_id in sales_flat_shipment_grid.  How can I limit the join to one of the rows that are possibly returned?

Here is the error from Magento:

Item (Mage_Sales_Model_Order_Invoice) with the same id "53249" already exist


texts: Magento 1.9 - How to Filter and Aggregate Order API Response

texts:
I need to Filter and Aggregate the query of (/Orders) endpoint in Magento 1.9

Can anyone tell me how to do this?

and what are the Aggregate and Filter parameters

Thank you.


texts: Magento 2 - How to create item wise shipment And add tracking number programmatically

texts:
We need to create programmatically shipment and add tracking number for all the ordered items from CSV.
Check following CSV sample data for your reference.

order_no,sku,quantity,tracking_no
700100,JK5012,1,132131315
700100,KM5013,2,132131316

Can anyone help us with the above requirement?
Your help will be appreciated.


texts: Getting data from Magento database into order/invoice emails and PDF

texts:
I have googled for hours on end for a solution to this, but I cannot find an answer.
Really hope StackExchange can help me out.

My goal is to get the customer comment, if any, added into my order/invoice emails defined in System > Transactional Emails and also in the PDF that the back-end generates when "Print" is pressed.

I have Magento 1.7.0.2 running with GoMage Light Checkout 5.7.

I'm thinking the easiest way to get the data accessible in both the email and PDF could be to use System > Custom Variables.

The field I want in the email is from the table sales_flat_order, the column is named gomage_checkout_customer_comment.


texts:
I am still building my onlineshop now.I found an issue that cannot get a mail like when ordering,registered id and so from magento on Gmail.
Although I could get a mail my private domain,cannot on my Gmail.

I just installed and set-up the extension which is SMTP Pro,but it does not work on it.Do you know how to send a mail to Gmail account?
I no longer have idea.That would be great if you give a tip or something helpful source.


texts:
Can blind people use the current Magento store out of the box or what modifications are needed?

Are there any plugins for this?


texts: Where is Add Product Click Button of magento admin

texts: I want to know place of "Add Product" of magento on Manage products page. And also the function which is work onclick of that button.


texts: Magento : Move Category Top Description to Bottom or Below Footer

texts:
My category description appears just below the category title banner. I want to shift it to bottom of the page or even better below the footer as there will be a unique description for each category.

I tried the following approach of moving

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
    <div class="category-description std">
        <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
    </div>
<?php endif; ?>

to the end of the file in view.phtml but that did not help.


texts: Magento Admin Custom Button on View Order

texts:
I am trying to create a button on the Magento View Order page that when I click it, it will email a certain vendor using information that is contained on the order and items in the order.

I have successfully created the module, and the button, I can click the button and it displays a warning type message. But I cannot figure out how to make the button perform the action. Currently the button is just going to a URL.

Here is what I have:

MG_Dropship.xml

    <?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <MG_Dropship>

            <!-- Whether our module is active: true or false -->
            <active>true</active>

            <!-- Which code pool to use: core, community or local -->
            <codePool>local</codePool>

        </MG_Dropship>
    </modules>
</config>

config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <MG_Dropship>
            <version>0.0.1</version>
        </MG_Dropship>
    </modules>

    <!-- Configure our module's behavior in the global scope -->
    <global>

    <blocks>
         <adminhtml>
            <rewrite>
                <sales_order_view>MG_Dropship_Block_Adminhtml_Sales_Order_View</sales_order_view>
            </rewrite>
        </adminhtml>
    </blocks>

    </global>

</config>

View.php

<?php

class MG_Dropship_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
    public function  __construct() {

        parent::__construct();

        $this->_addButton('dropship', array(
            $message = "Are you sure you want to dropship?",
            'label'     => Mage::helper('Sales')->__('Dropship'),
            'onclick'   => "confirmSetLocation('{$message}','{$this->getUrl('MG_Dropship')}')"
        ));
    }
}

Any help would be greatly appreciated.


texts: Change Currency Symbol in Switcher & at Products

texts:
It's very strange to me that somehow I can nowhere find perfectly described how to change these things

How to get a currency symbol here like: €, $ and so forth

How to change this Currency Title? So I can delete those US before the $

Appreciate everyone's Help

-1-


texts: Develop a module to create custom attributes in categories, not in setup

texts:
I want to create a module like the default module of Magento: Product Attributes in admin, located in Stores -> Attributes -> Product, but for categories, add custom attributes to categories from an admin module.
I know how to create a module for the admin, I created a form, but I don't know how to save all the data and save the new attribute.

I read this post: Magento2 Create eav_attribute for catalog but here the attribute is created inside the Setup.


texts: Magento 2.2 adding images to product programmatically does not set small_image

texts:
I'm adding images to products programmatically. Every product can have from 1 to n images.
So I reorder the images array in the way I need and then, to the first image of the array (that has to be the first to be displayed in the product page and in the product list view) I set the media_attribute as needed (image, small_image, thumbnail).

Everything seems to work fine, and images are correctly ordered in the product details, but small image and thumbnail are not set.

This is the piece of code I'm using to add images (the usual used everywhere)

ksort($prod_images);
foreach($prod_images as $key=>$img){
    $imgPath = $dirName . $img;

    try{
        if($key == 1){
            $prod->addImageToMediaGallery($imgPath, array('image', 'small_image','thumbnail'), false, false);
        }else{
            $prod->addImageToMediaGallery($imgPath, null, false, false);
        }
        $prod->save();
    }catch(\Exception $e){
    }
}

I eventually managed to set the correct image as small/thumb/base if I reverse the array and add it as last image, but in this way the image order is wrong and I need to preserve it or eventually change it, but I could not find a way for that.

Any clue?

EDIT

I found a patch, but it does not actually satisfy me... after saving the product for the first time, I recall the existing images and set the first as base/thumb/small, and it seems to work, but it actually waste a lot of time...

so I'm still looking for a real solution.


texts: Magento 2 : Call a function at the time of module installation

texts:
I want to call a function to send some store information through api call at the time of my custom module installation. Is there any event observer for this? How can we do it? Thanks.

class InstallData implements InstallDataInterface {
protected $authSession;
public function __construct(
    \Magento\Backend\Model\Auth\Session $authSession,
    \Magento\Framework\App\State $state
) {
    $this->authSession = $authSession;
    $state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMIN);
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context){
    $email = $this->authSession->getUser()->getEmail();

    $data = [
        'scope' => 'default',
        'scope_id' => 0,
        'path' => "[module]/general/email",
        'value' => $email,
    ];
    $setup->getConnection()
        ->insertOnDuplicate($setup->getTable('core_config_data'), $data, ['value']);}}


texts: Magento 2.3 : Add free product in a cart after applying coupon

texts:
How to add product in a  cart with custom price 0 after coupon code success. what is the way to achieve this.
pls help me with the couponcode success event name.


texts: Create an AJAX coupon code button on checkout step

texts:
I have a step added to checkout where i want to put some pre defined coupon codes buttons so the user can just click a button to apply the code if they want a sample for example.

For now I can apply a coupon with below form however causes a page reload on checkout:

<form id="discount-coupon-form-ajax" action="/checkout/cart/couponPost/" method="post">
    <input id="coupon_code" class="input-text" name="coupon_code" type="hidden" value="FREESAMPLE" />
    <button class="action apply primary" type="submit" value="Apply Discount">
        Free Sample
    </button>
</form>

The checkout however has a much more elegant ajax version of applying a coupon code however and was wondering how i could harness this functionality?

I have tried with some standard jquery like below:

$(document).on("submit", '#discount-coupon-form-ajax', function(event) {
      event.preventDefault();
      $.ajax({
        url:"/checkout/cart/couponPost",
        type:'POST',
        data:'ajax=true&'+$('#discount-coupon-form-ajax').serialize(),
        success:function(data)
        {
            console.log(data);
        }
      });
    });

This however was for Magento 1 I believe and does not respond in json and just seems to respond a standard checkout page. Not sure how to get the coupon controller to respond in json or however it normally responds or if this is possible anymore with code like above.


texts: What is use of class names in base/default/template in magento?

texts:
I am new to magento want to design a new theme. someone else is going to design pages,I am thinking to give him template files, so is it necessary to tell him to keep the class names same as they are in base/default package and he don't know magento theming,first of all is this the way magento theme is developed

If I replace all the classes with new one's will it break magento's functionality?


texts: No "Asynchronous Sending" Option in my Magento 2 Admin panel

texts:
I am facing an issue with order confirmation emails from being sent and I suspect that it has happened due to the failure of Cron jobs, somehow it got messed up, however we think it will take time to fix, however order confirmation emails are not being sent because cron jobs are needed for that.

However, I found out that Asynchronous Sending when disabled the emails will be sent without the help of any Cron job:

https://docs.magento.com/m2/ce/user_guide/system/email-communications.html

As shown in the official docs, I went to the exact place Stores > Configuration > Sales > Sales Email

But it isn't there.

Any idea what is going wrong here?


texts:
I have a magento 1.9 site in Dutch. To make the site Dutch I downloaded the Dutch language files and configured these to my needs. Now my whole site is translated in Dutch, except for some phrases. These are still in English and I can't figure out how to change them in Dutch.

After the checkout Magento sends you to a redirect page (payment succes). I cannot change the header of this redirect page to Dutch. Its the same with the print link on the bottom of this page. It says "Click here to print a copy of your order confirmation."

Can somebody help me out?

Smedia


texts: How do I get a EAV Attribute Option Label from Option Id?

texts:
I have a custom eav attribute on a product that is a of type dropdown. When the product is saved, the attribute is saved as the optionId. How do I get its label to be able to display it properly on the frontend.

Note:

I do not want to load the whole set of options for the attribute and loop through the find the matching one. I want to be able to get the label for the saved id value.
I have the attribute option id and the attribute code and can use them for query.


texts: Magento 2 Enable maintenance mode except my ip

texts:
I want to enable maintenance mode except my ip address, and I have run below command in CLI tool

php bin/magento maintenance:enable --ip= 180.233.1--.1-- (this is my ip)

this enables the maintenance mode including my system, while I have already excluded my ip.

I don't know why this is not working correctly.

If anyone have idea please let me know.


texts: How to delve into Magento Enterprise development?

texts:
I'd like to start out studying Magento Enterprise development. Is there a legal way to obtain a free Enterprise distribution for non-commercial purposes - other than getting employed as a Magento developer at a company which works with Magento EE?

Is there any other resource, apart from the Enterprise User Guide on the topic?


texts: Magento2 - show/notify customer when they reach x in the cart to spend x more to get free item or discount

texts:
Basically I am looking If there is something out there or anyone has used anything or suggestions for when in a cart price rule where the rules is E.G: spend $100 and get Y for FREE.

So It's basically a near miss, so when they reach their basket total let say $90 as a minimum threshold then either as a popup message at product page or cart page etc... to let then know if they spend $10 more to get Y item for free so basically let them know about the promotion.

I've seem some web comm do this.

The reason being as some customer might not be aware of the promotion but yet we don't want to place banner and notices everywhere clustering the  website this will also make the process more automated and no needing to remove promotional tex, banners. images etc...

I've been researching the web but couldn't find anything!

Thanks in advance!


texts:
I know so many others have asked the same question but still no reliable ans is available.

Suddenly my site is hitting the wrong path of static content (CSS/JS/IMAGES) because of this my site is not loading.

static path is adding version140*****

Same problem discussed in this question

But still same problem is there for my custom CSS still url is wrong.

  pub/static/version1487328792/frontend/Magento/luma/en_US/Codilar_RenderBook/css/style.css.

Version part is getting added automatically.


texts: How to add a JavaScript tag attribute in Magento 2?

texts:
What is the proper way to add a js tag attribute in Magento 2?

This is needed for example for Cloudflare Rocket loader to ignore a certain script.

<script data-cfasync="true" type="text/javascript" src="~~">


texts:
Probably since the SUPEE-6788 patch we can't access our magento connect manager anymore. We get the login screen, but the login just doesn't work.

There's no message whatsoever, nothing about wrong credentials (even when we deliberately use wrong login). After submitting the form, we just get http://magento-url/downloader/index.php?A= which shows the login screen again.

the adminhtml cookie is set on the domain name. Magento backoffice works correctly, and we have full administrator role permissions. No different cookies are being set, and when we remove all cookies, no new cookie is set either. We've tried different browsers, different client PC's, incognito mode to rule out any browser issues, but that doesn't seem to work.

Any thoughts?


texts: Need help with display random products code

texts:
I wanted to generate random products for certain categories on my home page. Came across this code:

<?php
// $_productCollection = $this->getLoadedProductCollection();
 $_helper = $this->helper('catalog/output');
 $_category = Mage::getModel('catalog/category')->load($this->getCategoryId());
 $_productCollection = Mage::getResourceModel('reports/product_collection')
                   ->addAttributeToSelect('*')
                   ->addAttributeToFilter('small_image', array('neq' => 'no_selection'))
                   ->addCategoryFilter($_category)
                   ->setVisibility(array(2,3,4,5));
 $_productCollection->getSelect()->order(new Zend_Db_Expr('RAND()'));
 $_productCollection->setPage(1, 5);
?>

Now when I added it to my modified list.phtml it wouldn't load. Playing around the only way I could get the above to work was to put the following BEFORE the above code.

 <?php
$_productCollection=$this->getLoadedProductCollection();
$_productCollection->clear()
               ->addAttributeToFilter('small_image', array('neq' => 'no_selection'))
               ->setPageSize(5)
               ->load();
$_helper = $this->helper('catalog/output');
$this->setData('column_count',5);
?>

This is working, however it is resulting in slow loading times on the page where this code is being called. I tried modifying the first code block to include elements of the 2nd block but no dice.

What can be changed to make this code run more efficiently?


texts:
I've install a group deal module. The group deal products will display in group deal layout while the normal product will use my theme layout. The sidebar is expected only will be displayed in group deal layout but it should not be displayed in my default product layout.

The group deal layout xml is containing a row which will display a sidedeals.phtml, see:

app\design\frontend\default\default\layout\groupdeals.xml (product_view section)

<block type="groupdeals/product_list_sidedeals" name="groupdeals.sidedeals" template="groupdeals/product/list/sidedeals.phtml" before="-"/>

and my theme layout xml file is in:

app\design\frontend\default\metroshop\layout\catalog.xml

the product which is not a group deal will use this layout.

But now, the default product view is display the sidedeals.phtml, it should not be displayed.

How can i fix the product?


texts:
I want to create command for delete operation for simple product by sku.
I'm getting following error.how to set admin area?

[Magento\Framework\Exception\LocalizedException]
  Delete operation is forbidden for current area

<?php
namespace Sivakumar\Sample\Console;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;

class DeleteSimpleProduct extends Command
{
    protected $_product;
    public function __construct(\Magento\Catalog\Model\Product $_product)
    {
        $this->_product =$_product;
        parent::__construct();
    }

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this->setName('delete_simple_product')
            ->setDescription('Delete Simple Product')
            ->setDefinition($this->getOptionsList());

        parent::configure();
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $errors = $this->validate($input);
        if ($errors) {
            throw new \InvalidArgumentException(implode("\n", $errors));
        }

    $product_id = $this->_product->getIdBySku($input->getOption('sku'));
    $product=$this->_product->load($product_id);
        $product->delete();
        $output->writeln('<info>product deleted ' . $input->getOption('sku') . '</info>');
    }

    public function getOptionsList()
    {
        return [
            new InputOption('sku', null, InputOption::VALUE_REQUIRED, 'SKU'),
        ];
    }

    public function validate(InputInterface $input)
    {
        $errors = [];
        $required =['sku',];

        foreach ($required as $key) {
            if (!$input->getOption($key)) {
                $errors[] = 'Missing option ' . $key;
            }
        }
        return $errors;
    }
}

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">
<type name="Magento\Framework\Console\CommandList">
    <arguments>
        <argument name="commands" xsi:type="array">
            <item name="delete_simple_product" xsi:type="object">Sivakumar\Sample\Console\DeleteSimpleProduct</item>
        </argument>
    </arguments>
</type>
</config>


texts: Change order of CSS and JS in the  section of the page

texts:
Where is the block with CSS and JS in the <head></head> rendered? And how to change the order of the elements from that section?

(this screenshot is from Magento 2 demo)

I'd like to change the order of elements in that section (and add more elements at the end) but I couldn't find any template file responsible for that part of the head, so it seems like it's rendered somewhere else.

A few elements from the head (e.g. the viewport meta tag) are added in this layout file vendor\magento\module-theme\view\frontend\layout\default_head_blocks.xml:

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <css src="mage/calendar.css"/>
    <script src="requirejs/require.js"/>
</head>

A few other elements are added in this layout file vendor\magento\theme-frontend-blank\Magento_Theme\layout\default_head_blocks.xml:

<head>
    <css src="css/styles-m.css"/>
    <css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
    <css src="css/print.css" media="print"/>
</head>

But what decides that in the end on the frontend the requirejs/require.js is placed after css/styles-l.css? Where is the code responsible for that?
Where is this element added to the head?

<link rel="stylesheet" type="text/css" media="all" href="http://magento2-demo.nexcess.net/pub/media/styles.css" />

I know it is taken from the Scripts and Style Sheets field from the admin panel: Content -> Design -> Configuration -> HTML Head. But what decides that it is displayed right after requirejs/require.js and not after other CSS assets like css/print.css?


texts: Magento 2: Same collection on listing page

texts:
I have some weird problem

  Here is my code that write in afterGetPrice() function, I am using
  plugin here to change price of product based on my custom table

$customPrice = $this->_customPriceFactory->addFieldToFilter('entity_id',$product->getId())->getData();

echo $product->getId();

echo rand();

print_r($customPrice);

  on search page and Listing I got the same result every time Here is image


texts:
How to get last 7 days order information. I don't know how to write Collection of this,

Can you please guide some one ?

<?php
include_once "app/Mage.php";
umask(0);
Mage::app();

$fromDate = date('Y-m-d H:i:s', strtotime('-7 days'));
$todayDate = Mage::getModel('core/date')->date('Y-m-d H:i:s');

$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate));
foreach ($orders as $orderkey => $ordervalue) {
    echo $eid = $ordervalue->getOrderId();
    echo $order           = Mage::getModel("sales/order")->load($eid);
    echo $customerorderid = $order->getIncrementId();
    echo $customeremailid = $order->getCustomerEmail();
    echo $customername    = $order->getCustomerFirstname();
}

?>


texts:
I am having a strange issue with my product filter (layered navigation) not working, I have narrowed this down to the URL paramaters being lost because of a 301 redirect.

If I go to the URL... http://domain.local/styles/?attribute_style=258

I would expect to land on a category page with a result filtered by attribute style. This does't happen, the products aren't being filtered. This seems to be because the above URL goes to a 301 redirect and forwards me to the URL... http://domain.local/styles/ without the query string.

I am pretty sure this is related to a configuration setting as I'm sure it was fine before I imported a pre-existing database.

Does anyone have any idea what is causing this and how I can resolve it?


texts: Magento 1.9: How to show image on admin form Magento 1.9

texts:
In my Magento 1.9 I have created a module and there from Front-end to end customer fill form with image.

At admin panel I have all form detail but don't know how to display image.
Image will be only display not editable.

Please anybody can suggest me.
Thank you


texts: Magento 2.2 - order confirmation/order edit - rounded bundled product qty

texts:
I use decimal qty for some products.
If product type is simple order confirmation email sends qty correctly in decimal eg. 1.05 m2 Unfortunately if same product is part of bundle qty is rounded down.
Same issue is in order edit. After order is edited via admin qty is rouded.

Where to fix qty rounding or does somebody has some workaround?