texts:
I'm using Magento 2.3.5-p1 and I'm trying to apply watermark on the product images. Following the docs the watermark is applied only at the main image on product page and on the category page.
For what I can notice, it's not applied:

in the cart
in the related, up-sell and cros-sell products
in the new products list

How can I apply it everywhere?


texts: Paypal express is not working for multishipping checkout in magento 1.7.2

texts:
I am trying to integrate the paypal express payment method for multishipping checkout and i have already set the variable $canuseformultishiiping="true" but paypal express payment method is not working for multishipping checkout.
Can anyone help me to integrate paypal express for multishipping checkout?
Does paypal express payment method support multishipping checkout in magento? if it does not supported by magento then how can we integrate for multishipping.


texts: magento 2 product add to cart URL doesnt have a form key

texts:
I am trying to get the cart add to cart URL in magento 2 but the URL being returned by the getAddToCartUrl is not valid.
public function __construct(
   \Magento\Catalog\Block\Product\ListProduct $listBlock,
   \Magento\Checkout\Helper\Cart $cartHelper
){
    $this->listBlock = $listBlock;
    $this->cartHelper = $cartHelper;
}

public funtion getUrl($product){ //this is a product instance
  //both this functions are returning the same
  $addUrl = $this->cartHelper->getAddUrl($product);
  $addUrl = $this->listBlock->getAddToCartUrl($product);

  return $addUrl;
}

the return URL are like this one.
http://$my_base_url/checkout/cart/add/uenc/$uenc_value/product/2772/
The generated URL doesn't work when adding to cart. I also observed in M1 there should be a form_key parameter that should also be passed. anyone has an idea what wrong here? is there a new way to get a valid add to cart URL in M2?


texts: Magento 2: how to remove order actions elements?

texts:
Magento order actions: https://docs.magento.com/m2/2.2/ee/user_guide/sales/order-actions.html

Would like to remove some of these from the list, like "Print Credit Memos", "Print Shipping Labels"

Does anybody know how to do? Thank you


texts:
Is it possible to tell Magento to do pick-up different CSS styles for something that appears throughout (such as the header?). For example, a website I am working on features a 'MENU' icon over an image. This image changes as different categories in the menu are hovered (using jQuery on CMS page). I want to tell it to change the color of the 'MENU' icon from say white, to black on certain images. Is this possible?

jQuery (in CMS page) for the image changing on hover:

HTML for the 'MENU':

                MENU

</div

CSS for the 'MENU':

.skip-link.skip-nav span {
  display: block;
  position: absolute;
  height: 2px;
  width: 70%;
  border-radius: 9px;
  opacity: 1;
  left: 0;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .25s ease-in-out;
  -moz-transition: .25s ease-in-out;
  -o-transition: .25s ease-in-out;
  transition: .25s ease-in-out;
}

.skip-link.skip-nav span:nth-child(1) {
  top: 0px;
  background: #b0b0b0;
}

.skip-link.skip-nav span:nth-child(2),.skip-link.skip-nav span:nth-child(3) {
  top: 8px;
  background: #b0b0b0;
}

.skip-link.skip-nav span:nth-child(4) {
  top: 17px;
  background: #b0b0b0;
}

.skip-link.skip-nav.open span:nth-child(1) {
  top: 18px;
  width: 0%;
  left: 50%;
  background: #000;
    height: 2px;
}

.skip-link.skip-nav.open span:nth-child(2) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
  background: #000;
height: 2px;
}

.skip-link.skip-nav.open span:nth-child(3) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
  background: #000;
  height: 2px;
}

.skip-link.skip-nav.open span:nth-child(4) {
  top: 18px;
  width: 0%;
  left: 50%;
  background: #000;
  height: 2px;
}

.skip-link.skip-nav .label {
    margin-top: -10px;
    color: #b0b0b0;
    margin-left: -50px;
    font-weight: bold;
}

.skip-link.skip-nav.open .label {
    display: none;
}


texts: Convert product grid delete massaction permission based in magento 2

texts:
In magento 2, the product grid massaction are added via ui_component. My requirement is, to disable the product delete if the user has no permission. Not getting how to do that in magento 2.

In magento 1, used the grid rewrite to change the massaction. Let me know, if there is as way to make the massaction permission based in magento 2.


texts: how to filter blank image product collection by observer

texts:
I need to filter collection for product listing.
I know how to re-write block.
But i want to filter that collection by observer.

basically i want to do this by observer...

this the code for filter blank image.

->addAttributeToFilter('image', 'no_selection');


texts: Magento 1.9 - doesn't show my customer custom image attribute on the frontend

texts:
Starting at the beginning

I managed to include a custom attribute so that I could enter an image in my database at the moment when some user register. At first it kept this attribute without problem. But after saving it, it does not show it to me in the customer's frontend, even though it is well saved and the data is correct. Besides that it doesn't save it when editing it, only the first time when the user registers.

The code displayed in the frontend:

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

        <div style="width: 200px; height: 150px; background: no-repeat center center url(file: <?php echo $this->__('http://'),$host,'/media/customer',$this->escapeHtml($this->getCustomer()->getLogotype()) ?> ); background-size:cover;" alt="<?php echo $this->__('Your Logo'); ?>" class="logo-company">

where $host is take it before from the command $host= $_SERVER["HTTP_HOST"];

The properties of the attribute:

$this->addAttribute('customer', 'logotype', array(
    'type'    => 'varchar',
    'input'   => 'file',
    'label'     => 'Your Logo',
    'position'  => 10,
    'required'  => false,
    'is_system' => 0,
    'visible'   => true,
    'user_defined' => 1,
    'source'    => 'eav/entity_attribute_source_table',
));
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'logotype');
$attribute->setData('used_in_forms', array(
    'adminhtml_customer',
    'checkout_register',
    'customer_account_create',
    'customer_account_edit',
));
$attribute->setData('is_user_defined', 0);
$attribute->save();
?>

Change the permissions of the folder, so that it allows me to see it without problem and the pointer is correct, but nothing.

It does not show the logotype and I want to display at the moment of the customer login on their account.

What I'm missing?


texts: Magento product detailed page Varien form hidden field validation not working

texts:
I have work with Magento1.9.3, then in my product detailed page i have added some hidden dropdown fields.

When i was used the Prototype(1.7.0) js, the hidden field validation was wroked without any issue, but after i upgrade the 1.7.3 version the hidden dropdown field is not working.

Kindly share your idea for fix the issue, thanks in advanc for your support


texts: Magento 2.2.6 Undefined index: REQUEST_URI in vendor/magento/framework/App/Valitron.php on line 1293

texts:
I use magento 2.2.6 i have this notice with valiton.php from 2 days, i don't understand why.
The message is :

PHP Notice:  Undefined index: REQUEST_URI in /var/www/vhosts/bonbonrose.ch/httpdocs/vendor/magento/framework/App/Valitron.php on line 1293

Here the part of code line 1293

 if ($this->validateSecureUrl($_SERVER['REQUEST_URI'])) {
        $secureKey = 'login';
        if (!empty($_POST[$secureKey]) && is_array($_POST[$secureKey])) {
            if ($this->executeSecureValidate($_POST[$secureKey])) {
                return true;
            }
        }

Someone know how to fix ?


texts: configurable product price not change on product page

texts: I have upload configurable product with different price. But i have select other size of my product so product price not change on product page any one resolve my problem. I have already create supper attribute but no solution.


texts: Error Applying PATCH_SUPEE-10266 Hunk #1 FAILED at 91

texts:
I try to apply the new patch from 1.9.3.2 to 1.9.3.6
and I get this answer. Any help? Thank you.

sh PATCH_SUPEE-10266_CE_1.9.3.2_v1-2017-09-13-06-38-58.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

    checking file app/code/core/Mage/Admin/Model/Session.php
    checking file app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php
    checking file app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php
    checking file app/code/core/Mage/Adminhtml/Controller/Action.php
    checking file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php
    checking file app/code/core/Mage/Adminhtml/controllers/CustomerController.php
    checking file app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php
    checking file app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php
    checking file app/code/core/Mage/Checkout/controllers/CartController.php
    checking file app/code/core/Mage/Core/Model/Email/Template/Abstract.php
    checking file app/code/core/Mage/Core/Model/File/Validator/Image.php

**Hunk #1 FAILED at 91.
1 out of 1 hunk FAILED**

    checking file app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
    checking file app/code/core/Mage/Core/etc/config.xml
    checking file app/code/core/Mage/Rss/Helper/Data.php
    checking file app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php
    checking file app/code/core/Zend/Serializer/Adapter/PhpCode.php
    checking file app/design/adminhtml/default/default/template/backup/dialogs.phtml
    checking file app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml
    checking file app/design/adminhtml/default/default/template/customer/tab/view.phtml
    checking file app/design/adminhtml/default/default/template/login.phtml
    checking file app/design/adminhtml/default/default/template/notification/toolbar.phtml
    checking file app/design/adminhtml/default/default/template/oauth/authorize/form/login-simple.phtml
    checking file app/design/adminhtml/default/default/template/oauth/authorize/form/login.phtml
    checking file app/design/adminhtml/default/default/template/resetforgottenpassword.phtml
    checking file app/design/adminhtml/default/default/template/sales/order/view/history.phtml
    checking file app/design/adminhtml/default/default/template/sales/order/view/info.phtml
    checking file app/design/install/default/default/template/install/create_admin.phtml
    checking file app/locale/en_US/Mage_Adminhtml.csv
    can't find file to patch at input line 720
    Perhaps you used the wrong -p or --strip option?

The text leading up to this was:
--------------------------
|diff --git downloader/template/login.phtml downloader/template/login.phtml
|index 26a7b84..a846d60 100644
|--- downloader/template/login.phtml
|+++ downloader/template/login.phtml
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored


texts:
Debugging an SSL issue, my host technician did something that disabled  logging on the site. He doesn't know what he did, and we can't get it working again. I've done the following:

disable/enable logging
change file/folder permissions to very open
issuing Mage::log("error");
Mage::log("error", null, "cust.log" true);

No luck.

Almost nothing logs in /var/log. Some things randomly shows up in system.log, but nothing will log to any other file, and no custom log files are created.

Mage::log doesn't work throughout the site. Also exceptions don't write to var/report and the Sphinx search log doesn't write to var/sphinx. Magento's exception screen appears showing file name, but the file doesn't appear in the reports directory.


texts: "No such entity" ERROR in magento 2.4 admin after upgrade

texts:
I am facing these issues into the admin during the product custom option save.

  [2019-04-29 15:00:50] main.CRITICAL: No such entity.
  {"exception":"[object]
  (Magento\Framework\Exception\NoSuchEntityException(code: 0): No
  such entity. at
  /var/www/html/magento2.1/vendor/magento/module-catalog/Model/Product/Option/Repository.php:170)"}
  []

Please, can you solve these issues?

Please note:- This issue is not coming in Magento 2.1.9 version this issues coming after the upgrade.

Thanks,
-V


texts: Layered Navigation in Magento 2 Luma template

texts: by default the left Layered navigations are hidden in Luma template. How do I un-hide the it. similar to blank theme.


texts: How to add new Custom option in between other Option

texts: I have added the "custom option"(Programmatically) with Configurable product`s option on cart page.But all the custom option are coming under the configurable product`s option. So what i need is that add custom option between the Configurable product `s Option. Is it possible?


texts: Magento update: Archiving Customizations and Extensions

texts:
I am trying to update magento ce-1.4.0.1 to ce-1.8. Following the guide I am suposed to

  Archive any custom theme packages in the
  magento-install-dir/app/design/frontend and
  magento-install-dir/skin/frontend directories.

Does this include base and default folders? I guess the update will change these files so I would not include them but on the other hand some modules might have added files here.

What would be the best way to go here?


texts: Magento 2 : Sort product collection by option values

texts:
We need to sort ordering on option values. for example Color is attribute and values are Red, Green, Blue then when we sort it should sort by alphabetically. So Blue, Green, Red results should come.

I hope you understand the problem. Default magento sort gives results based on option id not alphabetically.

Ref Issue:https://github.com/Smile-SA/elasticsuite/issues/450


texts:
I have just started to work with Magento 2 and I have the building blocks in place for my custom theme.

I'm only restyling the default luma theme and overriding the styling to fit in more with our business.

I am wondering how I can add more colors to _colors.less, Is it a simple case of adding more definitions to the file in the below location?

  lib\web\css\source\lib\variables

or do I override this somehow? I can't find much documentation on adding your own custom colors, just guides that use the default colours provided by Magento.


texts: Magento 2 : How To Get Modules Directory Path In Controller

texts: Does Anyone Know how can we get module file system path in magento 2 inside controller ?


texts: Remove wishlist and compare links next to add to cart button on product listing page

texts: I can't seem to locate where the add to wishlist or compare buttons next to the add to cart button on the product listing page are?


texts: How to get all the items using the order id in magento2

texts:
I tried the below code to get all the items in that order but am getting only first product please find the code below and tell me what mistake i did.

public function getAllItems()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId(000000014);
    $orderItems = $order->getAllItems();
    $itemQty = array();
    foreach ($orderItems as $item) {
         $itemQty['quantity'] = $item->getQtyOrdered();
         $itemQty['description'] = $item->getDescription();
         $itemQty['name'] = $item->getName();
         $itemQty['price'] = $item->getPrice();
    }
    return $itemQty;
}


texts: add new field in magento(1.9) customer registration without changing core files

texts:
I am new in Magento development and customization I am trying to add a mobile field in new customers registration form I have followed this article but I am stuck https://stackoverflow.com/questions/11501020/magento-add-a-field-on-default-registration-form

So, Please guide me through the perfect way without changing core files.


texts: After product deleted customer wishlist stopped working

texts:
Steps to reproduce error:

Create product from magento admin panel.
Login as customer on front end and add same product to wishlist.
Delete same product from admin panel.
For this customer, starting JS error on front side and can add any other product to wish list.

I believe same issue can be with if product contain in compare product, recently view, related product and product deleted, than product id still exist on these entity table.


texts: Can anyone tell me how to reindex with Magento 2.0.2

texts:
I am not very comfortable with command line in admin but when I run php bin/magento indexer:reindex in the root directory I am getting

  Status:  404 Not Found X-Powered_By: PHP/5.5.33 content-type:
  text/html

Any suggestion on how to get reindex completed?  I am running Magento 2 on a virtual private server with Godaddy and the reindex does not seem to worl through the application.


texts: How to check if shopping cart price rule applied to quote

texts:
I have a shopping cart rule setup which applies a discount if the product has a specific attribute - there's no coupon code involved.

Throughout the site I just need to check whether or not that shopping cart rule has been applied to the quote.

I've tried this:

$coupon_code = Mage::getSingleton('checkout/session')->getQuote()->getCouponCode();

But that doesn't work; it only works with coupon codes input by the user.

How would I check if such a shopping cart rule has been applied?


texts: how to create install data file in magento 2?

texts:
in magento 1
code is

INSERT INTO {$this->getTable('table_name')} (`color_id`, `color_name`, `color_code`) VALUES
(1, 'Green', '#A2C44C'),
(2, 'White', '#FFFFFF'),
(3, 'Blue Dusk', '#304050 '),
(4, 'Black', '#28272c'),
(5, 'Azalea', '#e975a4'),
(6, 'Cardinal Red', '#891c2f'),
(7, 'Carolina Blue', '#6e95ce'),
(8, 'Cherry Red', '#b3042b'),
(9, 'Chestnut', '#7d5b52'),
(10, 'Daisy', '#fed348'),
(11, 'Dark Chocolate', '#3c3230'),
(12, 'Forest', '#333a32'),
(13, 'Gold', '#feac1c'),
(14, 'Heliconia', '#d1316f'),
(15, 'Honey', '#edb963'),
(16, 'Ice Grey', '#c2bebf'),
(17, 'Indigo Blue', '#4a5d7b'),
(18, 'Iris', '#497bba'),

how i set this code in the magento2 in installData.php


texts: How to add meta tag. meta description, meta kywords in custom module of admin panel?

texts:
I have created the custom module. but at the time of creating seller, I want an additional text box to add meta tag. meta description, meta keywords same like "add product" form in Magento admin panel.

Indexcontroller.php

 public function createPostAction() {
    $session = Mage::getSingleton('customer/session');
    if ($session->isLoggedIn()) {
        $this->_redirect('demoreq/seller/dashboard');
        return;
    }

    if ($this->getRequest()->isPost()) {
        $data = $this->getRequest()->getPost();

        /* save a customer */
        $customer = Mage::getModel("customer/customer");
        $confirmkey = $customer->getRandomConfirmationKey();

        $customer->setWebsiteId(Mage::app()->getWebsite()->getId())
                ->setStore(Mage::app()->getStore())
                ->setFirstname($data['firstname'])
                ->setLastname($data['lastname'])
                ->setEmail($data['email'])
                ->setPassword($data['password'])
                ->setGroupId(6)
                ->setConfirmation($confirmkey);

        try {
            $customer->save();
            $customer->sendNewAccountEmail(
                    'confirmation', Mage::getUrl('demoreq/seller/login'), Mage::app()->getStore()->getId()
            );

            /* save a seller */
            $seller = Mage::getModel('demoreq/seller');
            $data['customerid'] = $customer->getId();
            $lastid = Mage::getModel('demoreq/seller')->getCollection()->getLastItem()->getSellerid();
            ++$lastid;
            $vendorid = "GIS" . str_pad($lastid, 3, "0", STR_PAD_LEFT);
            $data['vendor_code'] = $vendorid;
            Mage::getModel('demoreq/seller')->setData($data)->save();
            $session->setData('sellerdata', '');
            Mage::getSingleton('core/session')->addSuccess($this->__('Account confirmation is required. Please, check your email for the confirmation link.'));

            //send confirm message
            $url = "http://167.114.117.218/rest/services/sendSMS/sendGroupSms?AUTH_KEY=edc6dda5c95eb6534d8878d711c6d6e4";
            $postData = array(
                'mobileNumbers' => $data['phone'],
                'smsContent' => "you are registered on posforyou.",
                'senderId' => "DEMOOS",
                'routeId' => 1,
                'smsContentType' => "english"
            );
            $data_json = json_encode($postData);

            // init the resource
            $ch = curl_init();

            curl_setopt_array($ch, array(
                CURLOPT_URL => $url,
                CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Content-Length: ' . strlen($data_json)),
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_POST => true,
                CURLOPT_POSTFIELDS => $data_json,
                CURLOPT_SSL_VERIFYHOST => 0,
                CURLOPT_SSL_VERIFYPEER => 0
            ));

            //get response
            $output = curl_exec($ch);

            //Print error if any
            if (curl_errno($ch)) {
                echo 'error:' . curl_error($ch);
            }
            curl_close($ch);

            $this->_redirect('demoreq/seller/login');
        } catch (Mage_Core_Exception $e) {
            $session->setData('sellerdata', $data);
            $message = $e->getMessage();
            Mage::getSingleton('core/session')->addError($message);
            $this->_redirect('demoreq/seller/create');
        }
        return;
    }
    }


texts: Magento 2 : Table Rate Shipping Method Not Working

texts:
The table rate shipping method in Magento 2.3.1 is not shown in the checkout.

It could be that I missed some configuration point, but as of my knowledge and the information in the internet this is not the case.

Upload of the csv file did work and as of the sample which I got from the export everythink should be OK.

Flate rate and free shipping is working.

Does have somebody the same problem and found a solution for it?


texts: Get meta description in schema Product description

texts:
In the header I have the following code for meta description.

<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />

I am trying to get this description as my schema product description as follows in the view.pthml file

<meta itemprop="description" name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />

However "Description" it shows up as a blank on the google rich snippets tool.

When I enclose

<meta itemprop="description" name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />

with a <span itemscope itemtype="Http://Schema.Org/Product" > it shows up, but of course breaks the other product itemtype thats on the page.

So how do I get the description in the header to show as my schema product description?

Note: the default meta description is not used (blank) a extension called creare SEO creates the meta description based on attributes.


texts: Thumbnail image is causing Magento 2 back in stock alerts to fail

texts:
We have an issue where we tested the Magento 2 back in stock alerts on Magento 2.3.4. We've since updated to 2.3.5. Now, back in stock alerts are failing. Our only indication is the cron process "catalog_product_alert" is showing an error in the status column. No errors are logged anywhere. We've checked them all, server and Magento.
We were able to trace it back to line 16 of magento/vendor/module-product-alert/view/frontend/templates/email/stock.phtml:
<?= $block->getImage($_product, 'product_thumbnail_image', ['class' => 'photo image'])->toHtml() ?>

getImage is just a translation of line 130 of vendor/magento/module-catalog/block/ImageBuilder.php:
public function create(Product $product = null, string $imageId = null, array $attributes = null)
{
    $product = $product ?? $this->product;
    $imageId = $imageId ?? $this->imageId;
    $attributes = $attributes ?? $this->attributes;
    return $this->imageFactory->create($product, $imageId, $attributes);
}

Does anyone have any ideas? is there a good way to check to see if the thumbnail it's trying to create exists in the file system?


texts: URL Key problems on Magento upgrade 1.12 -> 1.13.1

texts:
I am getting this error on an upgrade, even if I drop the table, it still happens. I have checked that the table is not there prior to upgrading.

Zend_Db_Statement_Exception Object
(
    [_previous:Zend_Exception:private] =>
    [message:protected] => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'catalog_product_entity_url_key' already exists
    [string:Exception:private] =>
    [code:protected] => 42
    [file:protected] => lib/Zend/Db/Statement/Pdo.php
    [line:protected] => 234
    [trace:Exception:private] => Array


texts: How to display Notification Message in a page

texts:
I use magento 2.2.1 version. I just tried to show notification messages and I use this code.

You can go to Controller/Test/Crud.php. I also injected \Magento\Framework\Message\ManagerInterface $messageManager. But I couldn't see messages.

What is wrong in this code or what I need to show the messages ?

class Crud extends \Foggyline\Office\Controller\Test
{
    protected $resultPageFactory;
    protected $_messageManager;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Framework\Message\ManagerInterface $messageManager
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        $this->_messageManager = $messageManager;

        return parent::__construct($context);
    }

    /**
     * Url like http://magento2.ce/index.php/foggyline_office/test/crud/
     */
    public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
        $this->_messageManager->addSuccess('Success-1');
        $this->_messageManager->addSuccess('Success-2');
        $this->_messageManager->addNotice('Notice-1');
        $this->_messageManager->addNotice('Notice-2');
        $this->_messageManager->addWarning('Warning-1');
        $this->_messageManager->addWarning('Warning-2');
        $this->_messageManager->addError('Error-1');
        $this->_messageManager->addError('Error-2');

        return $resultPage;
    }
}


texts: Magento 1 to Magento 2 models Mage::getModel('sales/order_shipment_api') and Mage::getModel('sales/order_shipment')

texts:
I have to convert (translate) these two models from Magento 1 to Magento 2:
Mage::getModel('sales/order_shipment_api') and Mage::getModel('sales/order_shipment')
Where are they, and how can I get them using object manager? I need to access these methods(their substitutes) in Magento 2:

Mage::getModel('sales/order_shipment_api')->create($a, $b, 'shipment', false, 1);
Mage::getModel('sales/order_shipment_api')->addTrack($a, 'custom', $b, $c);
Mage::getModel('sales/order_shipment')->load($shipmentId);


texts:
i try rewrite my block on app/local/lesson7/test/block but its not working
my modules xml (lesson7.xml)

<?xml version="1.0"?>
<config>
    <modules>
        <Lesson7_Test>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Catalog />
            </depends>
        </Lesson7_Test>
    </modules>
</config>

my layout on app/design/frontend/tutorial/default/layout/lesson7.xml

<?xml version="1.0"?>
<layout version="0.1.0">
  <default>
      <reference name="content">
      </reference>
  </default>
  <lesson7_index_index>
       <reference name="content">
            <block type="lesson7/monblock" name="afficher_monbloc" template="lesson7/afficher.phtml" />
       </reference>
  </lesson7_index_index>
</layout>

my template on app/design/frontend/tutorial/default/template/lesson7/afficher.phtml

<?php

    echo $this->methodblock();

?>

my config on app/local/etc/lesson7/test/etc/config.xml

<?xml version="1.0"?>
  <config>
     <modules>
        <Lesson7_Test>
          <version>1.0.0</version>
        </Lesson7_Test>
     </modules>
 <frontend>
   <routers>
      <lesson7>
          <use>standard</use>
          <args>
             <module>Lesson7_Test</module>
             <frontName>lesson7</frontName>
          </args>
       </lesson7>
   </routers>
   <layout>
     <updates>
          <lesson7>
               <file>lesson7.xml</file>
           </lesson7>
      </updates>
  </layout>
</frontend>
    <global>
      <blocks>
          <catalog>
              <rewrite>
                  <product_view>
                      Lesson7_Test_Block_Product_View
                  </product_view>
              </rewrite>
          </catalog>
        <lesson7>
          <class>Lesson7_Test_Block</class>
        </lesson7>
      </blocks>
    </global>
</config>

my block on app/local/lesson7/test/block/Monblock.php

<?php
class Lesson7_Test_Block_Monblock extends Mage_Core_Block_Template
{
     public function methodblock()
     {
         return 'Lesson 7 Block !!!' ;
     }
}

and my rewrite app/etc/lesson7/test/block/product/View.php

<?php
class Lesson7_Test_Block_Product_View extends Mage_Core_Block_Product_View
{
    public function afficherLesInfo()
    {
        return 'afficher les info !!!';
    }
}

UPDATE
is it possible his error was in my new block? is it true rewrite of models/resource can only be summoned by Mage such as Mage:: getModel (), Mage:: getResourceModel (), Mage:: Helper (), Mage:: getSingletonBlock () ?
please your help, thank you :)


texts: Magento 2: How to add quantity field in category page

texts: I need to add quantity box in category page. your help will be greatly appreciated


texts:
I am having this weird issue. Whenever i try to open a product or add them into cart. The link gets opened but as an image.

That is if product link is abc.com/product/123.html

This page only has a body with an img attribute, with src="abc.com/product/123.html"

If i refresh the page, everything is ok, and the product page is loaded fine. but after a few moments i get the same issue again

Using elastic cache (memecached) and varnish

Any ideas ?

EDIT:

I have checked the browser console, getting this issue

Resource interpreted as Document but transferred with MIME type image/jpeg:


texts: How do you add a custom product type to a grouped product?

texts: I have a new product type, called foo. I'm trying to have the ability to group foo products together. When I try to create a new grouped product, I'm unable to select any foo products. When I look at the query that was ran in the DB, it is only allowing simple, virtual, or downloadable. How can I add foo to this list?


texts: Don't show addresses of customers in admin panel

texts:
Magento version: 2.2.3 Enterprise Edition.

When I go to customer tab in admin panel and to address tab the addresses should not render(as I have more than 50 addresses for some customers. So the customer page in admin panel hangs).

So need to know which file renders the addresses so that I can add plugin to that, not to render the addresses.

Thank you


texts:
I want to practice with adding themes to a Magento 2 environment, but I don't want to waste time on skinning the shop first. I've been searching on Google for Magento 2 themes, but all I'm able to find are themes that are already developed in Magento 2. That's not what I want. I want a theme that I need to put in Magento 2 myself.

Is there a website that sells themes like this?

Thanks!


texts: Magento 2 : Unique constraint violation found when adding product, categories or mega menu items

texts:
I have a Magento 2.2.3 installation and I have the theme SM-Maxshop on that. I am not able to add any products, categories or Megamenu items to it. I get an error "Unique constraint violation found" when I do any of these operations. I was able to add custom product attributes and add them to attribute sets too, but am stuck after that. Has anyone else faced any issue like this?

PFA screenshots of the error pages.

I see this in the exception.log file:

I see this entry in exception.log:

  [2018-05-14 05:36:06] main.CRITICAL: Unique constraint violation
  found {"exception":"[object]
  (Magento\Framework\Exception\AlreadyExistsException(code: 0):
  Unique constraint violation found at
  /home/.../public_html/.../vendor/magento/framework/EntityManager/Operation/Create.php:134,
  Magento\Framework\DB\Adapter\DuplicateException(code: 1062):
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '0' for key 'PRIMARY', query was: INSERT INTO url_rewrite
  (redirect_type,is_autogenerated,metadata,description,store_id,entity_type,entity_id,request_path,target_path)
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?,
  ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?,
  ?, ?, ?, ?) at
  /home/.../public_html/.../vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:555,
  Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity
  constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY',
  query was: INSERT INTO url_rewrite
  (redirect_type,is_autogenerated,metadata,description,store_id,entity_type,entity_id,request_path,target_path)
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?,
  ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?,
  ?, ?, ?, ?) at
  /home/.../public_html/.../vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235,
  PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint
  violation: 1062 Duplicate entry '0' for key 'PRIMARY' at
  /home/.../public_html/.../vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"}
  []


texts:
I'm testing the Magento Recurring Profiles feature as we'd like to do a monthly subscription box (like the BarkBox or HelloFresh).  Anyway, when I place the order for it I get the following error:

Unable to load the order.
Trace:
#0 /home/site/public_site/app/code/core/Mage/Core/Block/Template.php(241): include()
#1 /home/site/public_site/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#2 /home/site/public_site/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#3 /home/site/public_site/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#4 /home/site/public_site/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#5 /home/site/public_site/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#6 /home/site/public_site/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#7 /home/site/public_site/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('before_body_end', true)
#8 /home/site/public_site/app/design/frontend/default/jm_summer/template/page/1column.phtml(230): Mage_Core_Block_Abstract->getChildHtml('before_body_end')
#9 /home/site/public_site/app/code/core/Mage/Core/Block/Template.php(241): include('/home/site...')
#10 /home/site/public_site/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#11 /home/site/public_site/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#12 /home/site/public_site/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#13 /home/site/public_site/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#14 /home/site/public_site/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#15 /home/site/public_site/app/code/core/Mage/Checkout/controllers/OnepageController.php(295): Mage_Core_Controller_Varien_Action->renderLayout()
#16 /home/site/public_site/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->successAction()
#17 /home/site/public_site/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('success')
#18 /home/site/public_site/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/site/public_site/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/site/public_site/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/site/public_site/index.php(88): Mage::run('', 'store')

Everything ran through PayPal and was working fine up until the confirmation/success page.  Can anyone offer any insight or help?  TIA!


texts:
WebP Images Google Safari Image Optimization
We are using Amasty Google Page Speed Optmization Extension for Magento 2 which has Image Optimization options - There are options to covert images to webp format - which is preferred by Google but I have read that webp format is not supported by safari apple browser devices -
So I am confused if I do convert all images to webp format does this mean they will not show in safari browser or they will show the normal image i.e. .jpg .png  .gif etc  in safari  and the webp images in google or other browser that support this image format


texts:
Magento 2.3.3
I am trying to create a product attribute which has the type "radio button". I am almost sure in Magento 1 it was possible to do just that. Now in Magento 2, I do not have the option "radio button" as type of option, only dropdown and some others. Am I missing something, or is it not possible?
Thanks!


texts: How to call dispatch events specific for Mobile?

texts:
How to call dispatch event for REST API's only in
mobile devices.


texts: Magento 2 How to update existing less file?

texts: I want to add few styles in _print.less. I have updated the less file and run the upgrade,deploy commands but still it loads old style. Also clear the cache. How can I do it?


texts:
How can I get the list of payment methods that can use in the following?

$quote->setPaymentMethod('checkmo');

I copied it from a sample online and I guess it is Check / Money Order.


texts: Magento getFirstItem and getLastItem not working on collection

texts:
My code is as below but it won't work with loading first or last item.

    $shipidarr[0] = 100007536;

$shipModel = Mage::getModel('orderstatus/orderstatus')->getCollection();
    $shipModel->addFieldToFilter('shipment_incrementid', array(array('like' => $shipidarr[0].'%')))->getLastItem();


texts:
I applied captcha on customer registration page but many customers complained about the captcha is too difficult to read.
Is there any methods to reduce the difficulty of the Captcha?
There are a solution but the solution is for Magento 1.9 while I'm using Magento 2.3.x
Captcha unreadable


texts: I am trying to add a cross-sell product to a custom cart page. The regular process for adding cross-sell products to products in the admin panel does now show up in our cart. Is there a file/ line of code I can implement to create this block on my custom cart page?


texts: css not loading in owl carousel magento 2

texts:
hello guys i am trying to use owl carousel in phtml file in console it shows error regarding css
Following is my default_head_block.xml file which is a layout file

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>

    <css src="web/css/owl.carousel.css" />
     <css src="web/css/owl.theme.css" />

</head>
</page>

Following is my default.xml file through i am calling phtml file

<?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">
<body>
    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="slider_test" template="Magento_Theme::slider.phtml" after="-" />
    </referenceContainer>
    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_img_width" xsi:type="number">148</argument>
            <argument name="logo_img_height" xsi:type="number">43</argument>
        </arguments>
    </referenceBlock>
</body>
</page>

Following is my slider.phtml file in which i am calling owl carousel

 <div class="owl-carousel" id="car">
 <div> Your Content </div>
 <div> Your Content </div>
 <div> Your Content </div>
 <div> Your Content </div>
 <div> Your Content </div>
 <div> Your Content </div>
 <div> Your Content </div>
 </div>

<script type="text/javascript">
require([
    'jquery',
    'owlcarouselslider'
    ], function ($) {
          $("#car").owlCarousel();
});
</script>

Following is output

following is error which showing in console


texts: how to set up dynamic remarketing code in magento

texts:
My magento site has an extension which is used for google analytics and remarketing. I don't know how this thing work in magento as I am new to magento. I googled about this and got to know that a script is written in the head part( as required), which take some parameter for managing these things. Now I have to add google dynamic remarketing tags throughout the site. I read the article. but I can't get any clear picture about what should I do ? In which page should I write the script ?

Please help.Thanks.


texts: which table to store data like simple product in Magento2?

texts:
which database table to store data like simple product in Magento 2 and its all related info. like custom attribute?
Any Help will be appreciated.


texts: In Magento 2 handler catalog_category_default , catalog_category_layered not present

texts: What are the replacements for above in Magento 2


texts: How to wrap cents of tier prices in a block?

texts:
I want to change the style of the tier price cents on the product page. To do this, I need them to be rendered on the page in this form:
1099
How to do this?


texts:
Can anyone help me to resize the product page product image in magento2

please find the screenshot:


texts: Cron job is running but not updating Inventory

texts:
I am using mass product import and export Extension from Wyomind
https://www.wyomind.com/magento2/mass-product-update-import-magento.html
I have scheduled tasks to run csv profile after every 30 minutes

I have checked the Inventory is not updated what should be done???


texts: Why is Configurable Product getChildrenIds result an encapsulated array?

texts:
This is the implementation of getChildrenIds in the class Mage_Catalog_Model_Resource_Product_Type_Configurable:

/**
 * Retrieve Required children ids
 * Return grouped array, ex array(
 *   group => array(ids)
 * )
 *
 * @param int $parentId
 * @param bool $required
 * @return array
 */
public function getChildrenIds($parentId, $required = true)
{
    $childrenIds = array();
    $select = $this->_getReadAdapter()->select()
        ->from(array('l' => $this->getMainTable()), array('product_id', 'parent_id'))
        ->join(
            array('e' => $this->getTable('catalog/product')),
            'e.entity_id = l.product_id AND e.required_options = 0',
            array()
        )
        ->where('parent_id = ?', $parentId);

    $childrenIds = array(0 => array());
    foreach ($this->_getReadAdapter()->fetchAll($select) as $row) {
        $childrenIds[0][$row['product_id']] = $row['product_id'];
    }

    return $childrenIds;
}

As result from this function you get e.g.:

$childrenIds = array(
    0 => array(
        1 => "1",
        2 => "2",
        ...
    )
);

If I want to process this data, I always access $childrenIds[0] because $childrenIds always has at most one item so no need to iterate over it.

Why is result an encapsulated array, and not a simple array?

Wouldn't it be better to replace

$childrenIds = array(0 => array());
foreach ($this->_getReadAdapter()->fetchAll($select) as $row) {
    $childrenIds[0][$row['product_id']] = $row['product_id'];
}

with the following code?

$childrenIds = array();
foreach ($this->_getReadAdapter()->fetchAll($select) as $row) {
    $childrenIds[$row['product_id']] = $row['product_id'];
}

What advantage does the actual implementation have?


texts: Magento 2 Where ship-station (shipping charge) details will save at magento side?

texts:
I have installed and configured Auctane_Api ship-station module to magento2. Whenever I placed the orders those information populated at
ship-station portal successfully. After processed shipment fulfillment at ship-station portal where these details (Tracking Number, Shipping Cost/Rate, Shipping Carrier) will save at magento side database tables?

Can any one clarify/help where those details will save in database table?


texts: Magento trying to find js in skin/base folder instead of skin/custom-theme folder

texts:
I have added a custom js file to the head in the cart

  <checkout_cart_index>
    <remove name="top.links" />
    <remove name="left.reports.product.viewed" />

    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>Primaapi/index.js</name><params/></action>
    </reference>
</checkout_cart_index>

There are two other custom js folders getting rendered from my skin/custom-theme folder so I'm sure the new theme is set up correctly. But for some reason when it comes to this specific file magento is trying to load it from the base theme.

From the browser it looks like this

   <script type="text/javascript" src="http://mysite.localhost/shop/skin/frontend/base/default/Primaapi/index.js">

Why is it checking the base folder and not my custom theme


texts: PayPal gateway has rejected request. Security header is not valid (#10002: Security error)

texts:
I am trying to get my PayPal integration working but I have a problem. When I try to purchase anything using Website Payments Pro or Express Checkout, I get the following error.

  PayPal gateway has rejected request. Timeout processing request (#10001: Internal Error).

When I first tried it with the live site it worked with Express Checkout but now it won't work.

Additional Info

Magento version: 1.7

template：Blanco


texts: How can I enable star rating in Magento2?

texts:
How to enable Star rating in Magento2?
Currently Customers can only write "reviews" but cant rate the product..

Thanks for help!


texts: What is the difference between Multi-vendor and Dropshipper in Magento?

texts:
I am learning magento. I want to create a Multi-vendor application using Magento where vendors will add their products to sell. But when I google about multivendor extensions in magento, i  get dropshipper modules also in search results. I want to know the difference between Multi-vendor and Dropshipper. Can anyone explain about it ?

Thanks in advance.


texts: Magento 2 REST API to fetch all the filter attributes based on Category

texts:
How can we fetch all the available filter attributes in the category page with REST API?

I'm working with the mobile app for my Magento store.
In the category listing page, I need to show all the available filters for the category and with this filter, I need to show the products accordingly.

Available filter list for the category page.
Filtering the product in the category page based on the selected filter.

Also, I just want to know how this can be implemented within the search page.

Any help would be appreciable.


texts:
I was recently tasked with debugging some faulty magento reset password email code. I have, I think, found the culprit of the faulty behavior but I am really confused as to how to resolve it. Here is my log:

2015-04-23T15:38:02+00:00 DEBUG (7): site id is: 1
2015-04-23T15:38:02+00:00 DEBUG (7): loaded customer by email
2015-04-23T15:38:02+00:00 ERR (3): Recoverable Error: Object of class Mage_Customer_Model_Customer could not be converted to string  in /var/www/magento/apijson/customer/forgotPassword.php on line 30
2015-04-23T15:38:02+00:00 DEBUG (7): the customer is:
2015-04-23T15:38:02+00:00 DEBUG (7): new reset password link token generated
2015-04-23T15:38:02+00:00 DEBUG (7): resetToken is: 44bbce19e297c088c2bca9f97a21d020
2015-04-23T15:38:02+00:00 DEBUG (7): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null, query was: INSERT INTO `customer_entity_varchar` (`entity_type_id`,`entity_id`,`attribute_id`,`value`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UP DATE `value` = VALUES(`value`)

Here is the reset email password code:

  5 $customer = Mage::getModel("customer/customer");
  6 Mage::log("site id is: ".Mage::app()->getWebsite()->getId());
  7 $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
...
 26 if ($email) {
 27     try {
 28         $customer->loadByEmail($email);
 29         Mage::log("loaded customer by email");
 30         Mage::log("the customer is: ".$customer);
 31         $newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();
 32         Mage::log("new reset password link token generated");
 33         Mage::log("resetToken is: ".$newResetPasswordLinkToken);
 34         $customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
 35         Mage::log("rest password link token changed");
 36         $customer->sendPasswordResetConfirmationEmail();
 37         Mage::log("password reset confirmation email sent");
 38     } catch(Exception $e) {
 39         Mage::log($e->getMessage());
 40     }

From the log I know the code fails when it gets to the changeResetPasswordLinkToken function. However I don't understand why. I've looked online and googled a lot for the last couple of days but it seems I have stumbled onto a very unique issue. I did find this post that had an answer to my issue but unfortunately it did not work for me.

So my question for anyone who views this post is. Do you know what's causing the issue, and why changeResetPasswordLinkToken is failing? If there is a question similar to this one that you think will be of use please provide link since anything helps at this point. Thanks everyone.


texts: Magento2 Luma make special price show after original price

texts:
On magento 2.2.5 product detail page when I set a catalog price or or a special price what happens is the special price is shown first and then under it is the original price listed. i want to change this so that the original price is always listed first (above) any special price.

In my app/design/frontend/luma/Magento_Catalog/templates/product/view I see a price_cloned.phtml which idk what that does I tried editing the final_price.phtml (since this is for simple products) but that didn't do anything


texts: Configurable Swatches - showing up in product images

texts:
I am having some issues with configurable products swatches and the swatch images showing up in the product images. Scenarios below. Thanks!

Scenario 1: (everything works correctly!) Product A - Red - QTY:5 Product A - Blue - QTY: 3

Scenario 2: Product A - Red - QTY: 0 (out of stock) Product A - Blue - QTY 3

In scenario two the swatch image disappears from the swatches for red ... which is fine. BUT now the swatch appears as a product image in the product images for the configurable product. Any ideas?


texts: magento2 - Authorize.net how to pass line items in request

texts:
We uses magento 2.3.1 version and it introduce Authorize.net accept js method instead of direct post. its working fine but we want to send product data as line items.

How to add line items in Authorize.net request or how to override authorize.net vendor core files?

Regards
Hiren Shah


texts:
I want to resized image of subcategory. for that,
I added this code in .phtml file.I'm getting wrong path for image

<?php
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $catId = 3;  //Parent Category ID
    $subCategory = $objectManager->create('Magento\Catalog\Model\Category')->load($catId);
    $subCats = $subCategory->getChildrenCategories();
    $_helper = $this->helper('Magento\Catalog\Helper\Output');
    $_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
    $count = 0;
?>

    <?php
        foreach ($subCats as $subcat) {
        $_category = $objectManager->create('Magento\Catalog\Model\Category')->load($subcat->getId());
        $subcaturl = $subcat->getUrl();
        $_imgHtml = '';

        $subcaturl =  $_imagehelper->init($_category, 'image')->keepAspectRatio(TRUE)
            ->constrainOnly(TRUE)
            ->keepAspectRatio(TRUE)
            ->keepTransparency(TRUE)
            ->resize('256','128')
            ->getUrl();
        echo $subcaturl ."
";
        $_imgHtml = '';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
        echo $_imgHtml;
    } ?>

I am getting

  http://Hostname/als2/pub/static/version1549014696/frontend/Theme/Name/en_US/Magento_Catalog/images/product/placeholder/.jpg


texts: I recently starting working with Magento for a project and it has a lot of content. The old website uses CMS pages for non product content. Then there is a category in the layered navigation, and then does a 301 redirect to the CMS page. Since I am building a new website, should I use the layered navigation and the associate a static block instead and not use a CMS page?


texts:
I'm wanting to create a test that checks if Solr for Magento Catalog search is functioning on a recurring basis, and then report if it fails. I know there is a connection test button in the admin panel so the functionality already exists.

Questions:

Is there already a recurring test checking against Solr? And if so where does it report?
If there isn't already a recurring test, what file calls the test?

Thanks for any help.


texts: What is the use of 'Cost' attribute in Catalog product in magento 2

texts:
I have read the magento document for it and found that this is the actual cost of the item.

http://docs.magento.com/m2/ce/user_guide/catalog/settings-advanced-advanced-pricing.html

Cost:  The actual cost of the item. (Where it is used ?) (What is purpose of it?)

Looking forward to this great community to get more details about its uses.

Any directions or details are appreciated.

Thanks


texts: Deleting Customize Options Value in Magento 2.2 wiped out all remaining options

texts:
I am working on a project in which we have upgraded from Magento2.1.8 to Magento2.2.0.

Customization Options were working fine and now on Magento2.2.0 we are facing an issue.

For example:
we have 2 options

a
b

We have 3 option values for each option

a
-- a1
-- a2
-- a3
b
-- b1
-- b2
-- b3

when we edit product, if we delete a2 or a3 all options of B will be wiped out.

While it was working fine on Magento2.1.8.

Any clue or guideline to fix this.

Thanks in advance


texts: How to prevent Magento admin url being indexed from Google?

texts: Is there any safe way apart from the robots.txt to prevent the Magento admin url being indexed by Google.


texts: Magento2 - Changes to Order Summary block are not appearing

texts:
When I edit the Order Summary block, I do not see my changes.

I even modified the vendor/magento/module-checkout/view/frontend/web/template/summary/item/details.phtml template directly for testing purposes.

I already tried:

flushing the Magento cache, by running bin/magento cache:flush
clearing var/generation, var/cache and var/page_cache
running bin/magento setup:static-content:deploy.


texts: Magento2 URL key for specified store already exists. while creating product

texts:
I'm creating products using scripts.
Product data came from json file.
Problem is I'm getting error URL key for specified store already
exists. ,when second product has same name but different sku.
So, second product url should be url-1.html if url.html is exist.

Is it a Magento bug? How can I solve that?

foreach ($files as $etiq) {
  $_product = $objectManager->create('Magento\Catalog\Model\Product');
  $_product->setName($name);
  $_product->setSku($Sku);
  $_product->setTypeId('simple');
  .
  .
  .
  .
  $_product->save();
}


texts: Adding view all in subcategory for magento theme 1.9.2

texts:
I want to add view-all option with the subcategory in main menu  for magento theme 1.9.2.
currently my menu appears like this-
category1
 --subcategory1
   --type1
   --type2
 --subcategory2

I want to menu appears like this-
category1
 --subcategory1
   --type1
   --type2
   --view-all
 --subcategory2

Can someone tell me what i can do to make my menu appears like this?


texts:
We are developing a new site and have created some custom consumers for AMQP, however we are getting the error Error while checking if topic is synchronous during the setup:upgrade part of our deployment process.

I have identified that it looks to be redis causing this as removing the redis block from the env.php file resolves this. But I am not sure where to go after this.


texts: Magento 2: How to add css and js in custom module in magento 2?

texts: How to create Magento 2 custom module with include Css and Js ?


texts: "Qty uses decimals" field hidden when "Manage stock" is disabled

texts:
Managing a product's inventory settings, if a product is set to Manage Stock = No then the option for Qty uses decimals is no longer visible. This does not make sense as you may want customers to order based on decimal quantities, but you don't want to manage stock for that product. If I sold dirt (a weird example, I know) I probably have a big pile of dirt that I just fill in a container and send to a customer. I don't need to manage inventory, but I still want to price per cubic foot and let them order non-whole values.

Indeed, if you disable stock management for that product, the setting for Qty uses decimals is still honored as the value is still saved to the product model even if the field isn't visible in the form (or if you inspect element and remove display: none).

Is there a reason why this option is not always visible? If I want stock management disabled but still want to use decimal quantities, are there any known side-effects of saving the value as mentioned?


texts: Add all products to websites/storeview by sql

texts:
I have more then 10k products in base store and want now assign all to new website as multistore in system with/by sql how i assign all products to the new websites/storeviews using sql?

use Magento 2.3.3

I have the WebSite ID´s: 4, 5, 6 where i want assign all products in bulk by sql query in one step


texts: spConfig and where it can be defined and used?

texts:
Hey everyone so in my Magento File structure, in my

  app/design/frontend/base/default/template/catalog/product/view/type/options/configurable.phtml

I have:

var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
console.log("spConfig", spConfig);

And that gives me all the beautiful information I need! However why does it not show up if I call this exact same way on

  app/design/frontend/default/theme424/template/catalog/product/view.phtml

The interesting thing is when I turn on Template Path Hints in Developer->Configuation->Developer panel they are both on the same page and configurable.phtml is inside the wrapper known as the view.phtml


texts: How to remove Export option from Sales/Order grid?

texts:
I want to remove the following from sale order grid:

New Order RSS
Export to:
MassAction block

for a particular admin user role.

I currently use adminhtml_block_html_before event to remove the MassAction block:

  my observer method:

    public function salesOrderVendorLayout($evt){
        $tabBlock = $evt->getBlock();
        if($tabBlock instanceof Mage_Adminhtml_Block_Sales_Order_Grid){
            $tabBlock->setMassactionIdField('');
        }
    }

  My Questions:

Is this the right way to remove mass action block?
How can I remove the remaining two blocks?


texts:
I am trying to create button to run php ../bin/magento indexer:reindex bash script via admin panel. It is working on my localhost but when I pushed the script on server nothing happens.

<?php if ($title == "Index Management") : ?>
    Reindex
<?php endif; ?>
<?php
    if (isset($_GET['reindex'])) {
        echo shell_exec('php ../bin/magento indexer:reindex');
        echo '
';
        //echo 'Reindex finished successfully.';
    }
if(function_exists('exec')) {
    echo "exec is enabled";
} else {
    echo "exec is disabled";
}
echo '
';
echo shell_exec('whoami');

It says that "exec is enabled" and whoami says "www-data".
Maybe that www-data doesn't have permissions to execute that command. What do you guys $think?


texts: How to show state dropdown in phtml file in magento2

texts:
I want to show state drop down in phtml file in magento2

I have a country code

<?php $countryBlock = $block->getLayout()-
 >createBlock('Magento\Directory\Block\Data');?>
            <?= $countryBlock->getCountryHtmlSelect($defValue = null,
  $name = 'country_id', $id = 'country', $title = 'Country');?>

this shows the country name now i want to show state name also


texts: Hi is there place where I can view all access to my magento server? I tried looking into /var/log but only see ssl.log which I thought that was it but when I visit my site I cannot see my activity being logged.  The reason why I'm asking is because recently I've been getting a lot of spam accounts despite my captcha and I speculate that its being created through programatically perhaps via POST but I cant track this down since I can't see the log.  Perhaps its in apache's log?  thanks!


texts: How to constrain a product to one shipping method?

texts:
A client of mine sells some products that can not be shipped via regular channels due to extreme size and/or weight.

For these products, I would like to add a setting like "can be shipped regularly".
Then, in the checkout process I would like to check if there are any products in the cart having this flag, and if so: only show the shipment option "delivery on appointment".

I have already developed custom shipment carriers/methods, but do not know what would be a good way to disable any shipment methods for carts that contain a product matching the criteria.

I expected that when I set <sort_order>99999</sort_order> in the carrier's config.xml (so it's rendered last) and then having the following code in the Carrier.php model, I would be able to unset any other possible carriers. However, this does not work.

<?php
class Vendor_ExampleCarrier_Model_Carrier
    extends Mage_Shipping_Model_Carrier_Abstract
    implements Mage_Shipping_Model_Carrier_Interface
{
    /** @var string carrier code */
    protected $_code = 'vendor_examplecarrier';

    /**
     * Collect and get rates
     *
     * @param  Mage_Shipping_Model_Rate_Request $request
     * @return Mage_Shipping_Model_Rate_Result|bool|null
     */
    public function collectRates( Mage_Shipping_Model_Rate_Request $request )
    {
        // ...
        $canShipRegularly = false;
        // ...

        $shippingRateResultModel = Mage::getModel('shipping/rate_result');

        if (true !== $canShipRegularly) {
            // does nothing
            $shippingRatesResultModel->reset();

            // returns empty array
            $shippingRatesResultModel->getAllRates();
        }

        return $shippingRateResultModel;
    }

    // other stuff..
}

I feel this might be a possible solution, if I would be possible to get access to this model in another scope.

Anyone have an idea as to how to accomplish this?


texts: How to display and save extension attributes on Magento 2 Admin create order page

texts:
I have created extension attributes to order for rest API services. Also, I'm able to display the attributes on the order grid.

How can I display the same attributes on admin create order form and save it?

Here is my extension_attributes.xml file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Checkout\Api\Data\ShippingInformationInterface">
        <attribute code="delivery_day_slot" type="string"/>
    </extension_attributes>

    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="delivery_day_slot" type="string"/>
    </extension_attributes>
</config>

And, I'm saving the data using plugin

<type name="Magento\Checkout\Model\ShippingInformationManagement">
    <plugin name="NM_save_delivery_slot_in_quote" type="<Namespace>\<ModuleName>\Plugin\Checkout\Model\ShippingInformationManagement" sortOrder="1"/>
</type>

Namespace\ModuleName\Plugin\Checkout\Model\ShippingInformationManagement

namespace <Namespace>\<ModuleName>\Plugin\Checkout\Model;

class ShippingInformationManagement
{
    protected $quoteRepository;

    public function __construct(
        \Magento\Quote\Model\QuoteRepository $quoteRepository,
        \Magento\Checkout\Api\Data\ShippingInformationExtensionFactory $shpExtensionFactory,
        \Psr\Log\LoggerInterface $logger
    ) {
        $this->quoteRepository = $quoteRepository;
        $this->shpExtensionFactory = $shpExtensionFactory;
        $this->logger = $logger;
    }

    /**
     * @param \Magento\Checkout\Model\ShippingInformationManagement $subject
     * @param $cartId
     * @param \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation
     */
    public function beforeSaveAddressInformation(
        \Magento\Checkout\Model\ShippingInformationManagement $subject,
        $cartId,
        \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation
    ) {

        $extensionAttributes = $addressInformation->getExtensionAttributes();
        $shipExtension = $extensionAttributes ? $extensionAttributes : $this->shpExtensionFactory->create();

        $payload = \file_get_contents("php://input");
        $attr = json_decode($payload, true);
        if(isset($attr["extension_attributes"])){
            $deliveryDaySlot = $attr["extension_attributes"]["delivery_day_slot"];

            $addressInformation->setDeliveryDaySlot($deliveryDaySlot);
            $quote = $this->quoteRepository->getActive($cartId);
            $quote->setDeliveryDaySlot($deliveryDaySlot);

        }

        return;
    }
}

Can any one please suggest a best approach?

Thanks in advance


texts: Adding contact URL link to certain products in listing

texts: Is it possible to add a "contact page" link to the product listing, but not in the description but in the area where the 'Add to basket/cart' link is, and  only for certain products via perhaps an attribute?


texts: Magento - Can't change customer address in admin

texts:
I have Magento 1.8.1 CE and cannot change the customer address anymore. I do not know what has changed, I have not done this for a while.

When I go to the customer screen in admin I get this error on the main page.

  SyntaxError: unterminated string literal
  this.itemContentTemplate = new Template('#{company}

Then I go to the addresses
Then I get this error:

  ReferenceError: customerAddresses is not defined

I cannot change an existing address either.

Changing on the front-end is possible, and successful But the customer also gets a warning that it isn't saved?

There are no entries in the system.log


texts: Poor Site Performance after Upgrade from 2.4.1 to 2.4.2

texts:
After upgrading from Magento 2.4.1 to 2.4.2 on Feb 25th our install has been experiencing very poor performance. The 2.4.1 install ran flawlessly with an uptime of in excess of 80 days, now symptoms include;

Random (every hour or so) high server loads and very high frontend response times, these sometimes settle back down
Random server hangs (no response and 500s every 24-48hrs) requiring an external reboot to get it back online
Magento double processing orders (ie customers are charged twice and two orders appear backend)
Magento takes customer payment (via stripe or Paypal) but does not complete order and no order appears in the backend (this usually coincides with a high server load event) - a while later a failed payment email will come through saying products are out of stock that should have a saleable quantity
when server hangs and recovers sometimes Elasticsearch will not recover in this instance the site and server will run fine but no products will be available on the site obviously!
During these high load events if i execute top -c the CPUs seem to be tied up with a high %wa

I'm guessing that there are some changes between 2.4.1 and 2.4.2 that are causing elasticsearch to overload now possibly with reindexing or a cron job change? Sooo...
Environment (off the top of my head)

Centos 7.9 VPS
WHM/cPanel
2CPUs
2gb Ram
3gb Swap
60gb disk sapce (69% used)
Litespeed websserver 5.4.12 and Litemage cache plugin
PHP 7.4.16
MySql 8.0.23

Things I have tried so far...

switched from PHP7.3 to PHP7.4.16
Upgaraded the MFTF from 2.5.4 to 3.4
Upgraded from MySQL 7 to MySQL 8
Set elasticsearch Xms1g Xmx1g in jvm.options.d - this was done before upgrade and worked fine with 2.4.1
added LimitMEMLOCK=infinity in etc/systemd/system/elasticsearch.service.d/override.conf - this was done before upgrade and worked fine with 2.4.1
added Restart=always in etc/systemd/system/elasticsearch.service.d/override.conf - this hasnt stopped the overloads though.
Installed sodium PHP module  - Had to be done otherwise users could not log in after upgrade

Anyone else having similar issues after upgrading from 2.4.1 to 2.4.2? any thoughts? I' sure this is impacting on my sales.
Update 27/3/21
After spending time observing the process manager during these events it seems to be the cron jobs causing the high server load. When it happens i am seeing multiple instances of:
opt/cpanel/ea-php74/root/usr/bin/php /home/andy/public_html/bin/magento cron:run
and
jailshell (andy) [init] ilshell -c /opt/cpanel/ea-php74/root/usr/bin/php /home/andy/public_html/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /home/andy/public_html/var/log/magento.cron.log
When the load is really high (40+) ther are upwards of 10 of each of these processes. If i kill these processes he load returns to normal.
I tried deleting the crontab temporarily and truncating the cron_schedule table and the site ran fine with minimal load for about 12hrs, but the high load issues returned as soon as i reinstalled the crontab.
I have compared cron.php in 2.4.1 and 2.4.2 and there are no changes.The release note for 2.4.2 don't point to any obvious changes to the crons either. I didn't change anything or add any modules when i upgraded from 2.4.1 to 2.4.2 either.
Any ideas or pointers on how i can work out why the crons are now causing such high load?


texts: How to insert option value on Product Custom Attribute 'manufacturer' by magento program?

texts:
I have 100+ manufacturer from Old database for preparing data migration to Magento 2.

How can assign manufacturer to on php for the tables eav_attribute_option_value and eav_attribute_option?

Thanks


texts: Catalogue Widget with different price range products

texts:
How can I configure catalogue widget to show products from all categories.
Catalogue 1 : <$5
Catalogue 2 : > $5 <$10
Catalogue 3 : >$10 <$15

As soon as I use first rule on All Categories in One Catalogue Widget, it simply applies same rule on all catalogue.


texts: Importing product names with special characters using Magmi

texts:
I am trying to import products using Magmi.

Some of the products include special characters, such as é, à, etc.

When I import the products, I get the following error for the items that have the special characters:

  SKU [the product's sku] SQLSTATE[HY000]: General error: 1366 Incorrect string value: '[character code]' for column 'value' at row [column # I use for the product name]

So far I have tried:

Encodings: UTF-8 and Latin1 when I export to csv
Change the special characters to Latin1 values

I keep getting the same error, whatever I try to change.

Please help me :)


texts:
I'm using Google API to generate store locator in my module. I've stored all the store addressed in a separate table and accessing that table through direct SQL query to match locations inputted by user from frontend. Here's my query:

$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = sprintf("SELECT address, name, lat, lng, ( 3959 * acos( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) AS distance FROM ".$resource->getTableName('onibi_storelocator/store')." HAVING distance < '%s' ORDER BY distance LIMIT 0 , 20",
      mysql_real_escape_string($center_lat),
      mysql_real_escape_string($center_lng),
      mysql_real_escape_string($center_lat),
      mysql_real_escape_string($radius));

$results = $readConnection->fetchAll($query);

This code works alright in my localhost but when run it on development server it generates error like this:

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


texts:
How to create an EAV entity?

This is a question that pops up a lot on the web. There are some good blog articles that explain how to do that, but none of them are satisfying for me.
So I decided to a self-answered question and explain how I do it ... and it seems to work.

There is a lot of code in here. In order to read correctly sort the answers by 'oldest'.


texts: how to stop email of order programmatically in custom payment method?

texts:
use Magento\Quote\Model\QuoteManagement;
...

// Create order from quote

$order = $this->quoteManagement->submit($quote);

// This code send mail automatically

//also used **$order->setCanSendNewEmailFlag(false);**

// But this not working in magento 2.3.0


texts: paypal plus modul to magento 2 SSH InvalidArgumentException

texts:
I have a problem with intergration of Paypal Plus Modul for Magento 2.
I found this module on github

  https://github.com/i-ways/magento2-paypal-plus

There are instructions not to install it on Magento 2 but I got stuck at the point with
Run the command composer require iways/module-pay-pal-plus from instructions.
I get in my SSH Console:

[InvalidArgumentException]
Could not find a matching version of package iways/module-pay-pal-plus.
Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

I write in composer.json:

"repositories": {
"0": {
"type": "composer",
"url": "https://repo.magento.com/"
},
"1": {
"url": "git@github.com:i-ways/magento2-paypal-plus.git",
"type": "git"
},
"swissuplabs": {
"type": "composer",
"url": "https://ci.swissuplabs.com/api/packages.json"
}
},

please help, what's the problem?


texts: Various pages displaying "Customer Login" instead of their proper page title as defined in the xml page

texts:
My Contact Us page, Password Reset, Forgotten password and possibly a few other pages are having their page title overriten to say "Customer Login". I have a feeling that the culprit is located here,...

vendor\magento\module-customer\Block\Form\Login.php

    protected function _prepareLayout()
    {
        $this->pageConfig->getTitle()->set(__('Customer Login'));
        return parent::_prepareLayout();
    }

My layout files seem to be ignored and the title does not actually change. For example,

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Forgot Your Password</title>
    </head>
    <body>
        <referenceBlock name="root">
            <action method="setHeaderTitle">
                <argument translate="true" name="title" xsi:type="string">Password forgotten</argument>
            </action>
        </referenceBlock>
        <referenceContainer name="content">
            <block class="Magento\Customer\Block\Account\Forgotpassword" name="forgotPassword" template="Magento_Customer::form/forgotpassword.phtml">
                <container name="form.additional.info" as="form_additional_info"/>
            </block>
        </referenceContainer>
    </body>
</page>

does not actually do anything

I was able to find some hints on this stack post but it did not seem to do the trick.


texts:
I want to add footer link like I attach image .
I am using magento2.1


texts: how to disable cache for search page in magento 2

texts: Im using magento 2.3,want to disable cache for search page only because after removing filter second page is not loaded in search page


texts: Magento 2: Disable search by SKU storefront

texts:
I would like disable the storefront search by SKU.

I changed

but it still shows results by sku.

Any idea?


texts: Adding layered navigation block to custom page

texts:
In Magento, the Layered Navigation block works nicely in the product list page.

How can this block be successfully copied to a custom page, where there is a custom list of products?

Note: Just adding the block to the XML, and calling it's getChildHtml('blockname') doesn't do the trick.


texts: Magento 2: When to use cachable=false in Layout file

texts:
In Layout XML file, if we don't want to cache a block we use cachable=false. By default, it's going to cache.

When to use cachable=false & how it effects to website performance?


texts: Show random/default cross-sell items in onepage checkout

texts: In Onepage Checkout screen, I want to show default/random cross-sell items if none of the cart items have defined cross-sell items. I mean Onepage checkout screen will always show cross-sell products. Is there any settings for that in Magento 2 or I need to implement it? Thanks in advance.


texts: js file not loading in ajax returned phtml file magento2

texts:
I am returning phtml file content on ajax call in Magento2  its working fine, In the phtml file I am loading jquery and mine custom js file booking, using below code. A query function running fine, but the custom is not loading because called js function returning not defined error -

Here is my code  -

require([
    "jquery",
    "booking"
    ], function(jQuery){
        jQuery(function ($) {
            $("#load_more").click(function(){
                var c = 1;
                var total_rows = 1;
                $.each($(".location_time"), function(){
                    if($(this).css("display") != 'none'){ ++total_rows; };
                    if($(this).css("display") == 'none' && c<=<?php echo $showRows;?>){
                        $(this).css("display","table-row");
                        ++c;
                    }
                });
                if(total_rows == $('#total_rows').val() || c < <?php echo $showRows;?>){
                    $('#load_more').hide();
                }
            });

            bookingTable = $("#booking-table");

            setAddressLocationRows(bookingTable);
        });
    });

Error I am getting is  -

  Uncaught ReferenceError: setAddressLocationRows is not defined

Please let me know, what I am doing wrong.

Regards
Atul


texts: Site Crashed After Back Up. How do I change the php to "664"

texts:
I have finished my site and thought I should back it up. What a disaster the site is now completely blank and I cant access the admin area either http://www.cellar2door.com

I know that there are lots of similar posts and the answers all seem to point to changing the php to 664.

However, I am a real noobie and have no idea where I do this. Can someone point me in the right direction so i can try and fix it.

Thanks


texts: magento 2 seperated parent and sub categories dropdowns

texts:
I want to show different input dropdown that seperate parent categories and subcategories.
Indeed, the first dropdown shows parent categories, the second dropdown empty at first sight, then loaded subcategories of selected parent category


texts:
I try put in CMS homepage, a layered navigation, the block is called but don't show any options.

in update xml i have:

 <reference name="root">
    <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="content">
    <block type="catalog/layer_view" name="catalog.leftnav.home" after="-" template="catalog/layer/homeview.phtml">
        <action method="setData"><name>category_id</name><value>2</value>

</action>
        </block>
    </reference>

homeview.phtml:

    <?php if($this->canShowBlock()): ?>
    <?php echo $this->getStateHtml() ?>

        <?php if ($this->getLayer()->getState()->getFilters()): ?>

<a href="<?php echo $this->getClearUrl() ?>"><?php  echo $this->__('Clear All') ?>

        <?php endif; ?>

        <?php if($this->canShowOptions()): ?>

                <?php $_filters = $this->getFilters() ?>

                <?php foreach ($_filters as $_filter): ?>

                    <?php if($_filter->getItemsCount()): ?>

<?php echo $this->__($_filter->getName()) ?>

                        <?php echo $_filter->getHtml() ?>

                    <?php endif; ?>

                <?php endforeach; ?>

    <?php endif; ?>

<?php endif; ?>

The block don't show anything after $this>canShowBlock(). How i do it?


texts:
We have a quick order page where customer can enter all their shopping list then order it will one click. However we want to force the customer to log in as the majority of our customers have special prices and cant see these unless they are logged in.

Is there a way of creating a pop up forcing the customer to log in before the can view the page?


texts: create extension for composer instalations with lib

texts:
Extension with next file structure:
http://joxi.ru/Vm6l0vlUvna7WA
I need to create a repository for composer installations
what i have to do in composer.json?
in the result after composer install directory lib has to be located in project root directory


texts: it's possibile to run the Magento standard Import from CLI? I have to import product every night with that standard format.


texts: Magento 2 + Newrelic (slowest components)

texts:
I am using Magento 2.2.2 EE and getting slowest component from newrelic.

env.php

  'session' =>
  array (
    'save' => 'files',
    'save_path' => '/var/lib/php7.0/session',
  ),

php.ini

session.save_handler = files
session.save_path = /var/lib/php7.0/session

If you guys have any Idea please share

Any help will be appreciated


texts: Override custom email template from admin

texts:
I created a custom module that sends a custom email daily for report reasons. Everything is working fine

Now, I'd like to customize my custom template from admin in Marketing->Email Templatessection.

How can I get that the module uses the customized template instead of the original one?


texts: Magento2 - AWS Elasticsearch connectivity

texts:
I had tried all the options to put the endpoint for Elasticsearch of AWS but no luck.
I am looking for some option for replacing the local Elasticsearch with AWS Elasticsearch.
Thanks
sayantan chakraborty


texts: How this InstallData works each line in Magento 2?

texts:
My questions:

I want know how this works by each and every line of code
I want to add new attribute here
Difference between InstallData and InstallSchema

Here is InstallData.php

<?php
namespace vendor\Module\Setup;

use Magento\Customer\Model\Customer;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements \Magento\Framework\Setup\InstallDataInterface
{
    private $eavSetupFactory;

    private $eavConfig;

    private $attributeResource;

    public function __construct(
        \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory,
        \Magento\Eav\Model\Config $eavConfig,
        \Magento\Customer\Model\ResourceModel\Attribute $attributeResource
    ) {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig = $eavConfig;
        $this->attributeResource = $attributeResource;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->removeAttribute(Customer::ENTITY, "skype");

        $attributeSetId = $eavSetup->getDefaultAttributeSetId(Customer::ENTITY);
        $attributeGroupId = $eavSetup->getDefaultAttributeGroupId(Customer::ENTITY);

        $eavSetup->addAttribute(Customer::ENTITY, 'skype', [
            // Attribute parameters
            'type' => 'varchar',
            'label' => 'Skype Account',
            'input' => 'text',
            'required' => true,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 990,
            'position' => 990,
            'system' => 0,
        ]);

        $attribute = $this->eavConfig->getAttribute(Customer::ENTITY, 'skype');
        $attribute->setData('attribute_set_id', $attributeSetId);
        $attribute->setData('attribute_group_id', $attributeGroupId);

        /*
        //You can use this attribute in the following forms
        adminhtml_checkout
        adminhtml_customer
        adminhtml_customer_address
        customer_account_create
        customer_account_edit
        customer_address_edit
        customer_register_address
        */

        $attribute->setData('used_in_forms', [
            'adminhtml_customer',
            'customer_account_create',
            'customer_account_edit'
        ]);

        $this->attributeResource->save($attribute);
    }
}
?>


texts: Migration of Product Ratings and Reviews

texts: How do you migrate products reviews and ratings from one magento site to another?


texts: VAT configuration Inside and Outside the Origin Country

texts: My shop's origin country is Germany. So my client wants a scenario If the shipping address is within Germany the VAT will be inclusive of the price. and the shipping address is outside Germany it should excluded the tax. So I request to provide me a solution how the tax rules gets managed and I am already created two store views for English and German.


texts: Magento 2: Move production environment to local machine

texts:
I have access to a remote server with Magento 2 installation.

How do I move it to my local machine so I can test things out without breaking the live site?

Do I just download the magento 2 installation, export/import the database and change a few database connection settings?


texts: Magento 2 Confirmation Emails Being Blocked by Hotmail accounts

texts: Order confirmation emails on our Magento 2 store are not being recieved by customers who use hotmail email addresses. They are coming through to Google Apps accounts and gmail users. We've recently moved the site to a new VPS and this is when the issue seems to have started. Any ideas would be greatly appreciated.


texts: Magento 2 : CRUD, Invalid method _getResource() in model when Save

texts:
Magento CE 2.2.0; I created CRUD for model 'people' and save data in to database by controller for testing.

While i try to save by using controllor Add:

$_person = $this->_objectManager->create(\MagePro\Contacts\Model\People::class);
$_person->setName($person[PeopleTable::NAME]);
$_person->setSex($person[PeopleTable::SEX]);
$_person->save();

This process will meet error:

Magento\Framework\Exception\LocalizedException: Invalid method
MagePro\Contacts\Model\People::_getResource in /home/dev-
72/Work/Magento/Web/www/vendor/magento/framework/DataObject.php:395
Stack trace:
#0 /home/dev- 72/Work/Magento/Web/www/vendor/magento/framework/Model/AbstractModel.php(647): Magento\Framework\DataObject->__call('_getResource', Array)
#1 /home/dev-72/Work/Magento/Web/www/app/code/MagePro/Contacts/Controller/People/Add.php(44): Magento\Framework\Model\AbstractModel->save()
#2 /home/dev-72/Work/Magento/Web/www/app/code/MagePro/Contacts/Controller/People/Add.php(25): MagePro\Contacts\Controller\People\Add->generatePerson('name', 'sex')
#3 /home/dev-72/Work/Magento/Web/www/generated/code/MagePro/Contacts/Controller/People/Add/Interceptor.php(24): MagePro\Contacts\Controller\People\Add->execute()
#4 /home/dev-72/Work/Magento/Web/www/vendor/magento/framework/App/Action/Action.php(107): MagePro\Contacts\Controller\People\Add\Interceptor->execute()

People Model:

<?php
namespace MagePro\Contacts\Model;
use Magento\Framework\Model\AbstractModel;

class People extends AbstractModel
{
    public function __construct()
    {
       $this->_init(\MagePro\Contacts\Model\ResourceModel\People::class);
    }
}

People Resource Model:

<?php
namespace MagePro\Contacts\Model\ResourceModel;

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
use MagePro\Contacts\Model\ConstantValue\DataTable as TablePeople;

class People extends AbstractDb
{
    public function _construct()
    {
       $this->_init(TablePeople::TABLE_PEOPLE, TablePeople::ID);
    }
}

Constant People Table:

<?php
namespace MagePro\Contacts\Model\ConstantValue;

class DataTable
{
    const TABLE_PEOPLE = 'tb_people';
    const ID = 'id';
    const NAME = 'name';
    const SEX = 'sex';
}

InstallSchema

class InstallSchema implements \Magento\Framework\Setup\InstallSchemaInterface
{
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();
    $this->createPeopleTable($setup);
    $setup->endSetup();
}

private function createPeopleTable($setup)
{
    if ($this->isExist($setup, PeopleTable::TABLE_PEOPLE)) {
        return;
    }

    $table = $setup->getConnection()->newTable($setup->getTable(PeopleTable::TABLE_PEOPLE)
    )->addColumn(
        PeopleTable::ID,
        DDL::TYPE_INTEGER,
        null,
        ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true]

    )->addColumn(
        PeopleTable::NAME,
        DDL::TYPE_TEXT,
        null,
        ['identity' => false, 'unsigned' => true, 'nullable' => true, 'primary' => false]

    )->addColumn(
        PeopleTable::SEX,
        DDL::TYPE_TEXT,
        null,
        ['identity' => false, 'unsigned' => true, 'nullable' => true, 'primary' => false]

    )->setComment(
        'Contacts Table'
    )->setOption(
        'type', 'InnoDB'
    )->setOption('charset', 'utf8');

    return $setup->getConnection()->createTable($table);
}

private function isExist($setup, $tableName)
{
    if($setup->getConnection()->isTableExists($setup->getTable($tableName))){
        return true;
    }
    return false;
}

}


texts: Magento 2 : Get all values of dropdown attribute

texts:
I want to get custom attribute like this in product detail

How can i do that?

Any help? Thank in advance.


texts: Catalog Price Rule doesn't work on a group of products

texts:
I have Magento ver. 2.2.5,
and I created a simple -20% discount rule on all products with the Catalog Price Rule. But the problem is, that the rule doesn't work on some of the products and I have no idea why.
Could anyone please help me out? I have tried everything I could but can't figure out what the problem is..

some info about the shop:
I have 2 customer groups and they have different prices for the same assortment.
(One of them can purchase the products at a "normal" price, while the other group, in which I have special key customers, can purchase all the products at a lower price. I created these special lower prices with advanced pricing, and these lower prices are displayed on the front end as it was a special sale - so the key customer can always see the normal price struck through and the reduced price next to it.)

Moreover, I have simple products and configurable products too.

The problem is that the rule does not reduce the prices which my key customers see, only those, which are for the "simple" customers.
However, if I make a cart price rule, the reduction applies to all the prices. I doesn't matter which product it is or which group the customer belongs to.

It would be great if someone could help me,

thanks a lot!!


texts:
How can storage cache be cleaned programaticaly, I have found an answer [https://stackoverflow.com/questions/15028159/magento-flush-cache-storage][1]
but this solution does not work.After I run it get this type of error
(Parse error: syntax error, unexpected 'public' (T_PUBLIC) in ..\file.php on line 6).

Is there any other solution for flushing storage cache


texts: Display categories and sub-categories : where to paste the code?

texts:
I'm very new for magento. I hire a company to create my magento website. however, there are some features that i 'd like to improve.

For displaying categories and subcategories in cms page, i found code that some kindly shared to others. But i don't know where or which file in ftp i should paste the code.

now : the page of subcategory shows only its name on left navigator.
Expectation : the page shows both parent category and all subcategories, so the customers can link to other subcategories by clicking on side menu.

This is both for products page and other pages, for example, menu "about us" has 2 subcategories : history, our vision. when the user click subcategories "our vision", it will show "about us" , "history", and "our vision" on the left side bar.

I have captured my website as belows:
parent category page ------>
subcategory page

Thank you in advance.

Code i think it may be work. (in the fact, i would like it to appear only subcategories in current category)

<?php
$_helper = Mage::helper('catalog/category');
$categories = $_helper->getStoreCategories();

foreach ($categories as $_category) {
    $category = Mage::getModel('catalog/category')->load($_category->getId());
    $subcategories = $category->getChildrenCategories();
    ?>

<?php echo $this->htmlEscape($_category->getName()); ?>

                <?php
                foreach ($subcategories as $_subcategory) {
                    echo '
getURL() . '">' . $_subcategory->getName() . '
';
                }
                ?>

    <?php

}
?>


texts: How to amend header to include background image - Magento 2.1.7

texts:
I have a custom theme on Magento 2.1.7 installation, based on the Blank theme. I am trying to amend the header block to have a background image (behind the logo - though this is not important). I have read a couple of questions and answers and nothing seems to be working.
I have amended my _theme.less file and tried two suggestions:

a)

.page-header {
    background-image: url("../images/bog_headerimage.jpg");
}

b)

.page-header {
    background-image: url('@{baseDir}images/bog_headerimage.png');
}

another suggestion was to add the background-image line in the Magento_Theme/css/source/_module.less file, i.e :

.page-header {
    .lib-css(background-color, @header__background-color);
    border-bottom: 1px solid @border-color__base;
    margin-bottom: @indent__base;
    background-image: url("../images/bog_headerimage.jpg");
}

After each change, I have flushed the cache, I have removed var/view_preprocessed and pub/static files but the image does not appear.

Am I missing some step or doing something wrong? Would be really grateful for any help with this.


texts:
I purchased a Google Tag Manager extension .
I activated it, and it supposed to inject some html code just after the body tag in my Magento 1.7 version, but it's not .
I installed it locally  (Magento 1.9) and it's working fine .

I also tried other extensions, they work flawlessly locally but not on the 1.7 remote version .

My question is, is there some permissions to set to let the extensions inject html code ? Am I missing something ?


texts: Customer Groups and product_price_index growth in Magento

texts:
Magento seems to create a product_price_index row for each product X customer_group_id even if a given customer_group_id doesn't have a price for the product.

This ends up in a problem such: I have 4675 products and 285 customers. A given customer might only have 1 special price for 1 product, and no more, but still I get 4675x285 = 1332375 rows in the index, which thus becomes un-manageable, making each reindex a real pain.

Does any one out there have any ideas about how to handle this situation?

Has somebody implemented any solution for this situation?


texts: Magento 2 theme entry in core_config_data table?

texts: After creating a new theme in magento 2, is new theme entry goes in core_config_data table? and what is the entry details?


texts: How to create a model with multi-store attributes?

texts:
I want to show data on the product's pages to the customer. This data is related to multiple products and it is multilingual.

So I want to create a new model in Magento with this data, how do I create multilingual (multistore) attributes for this model?

I could look at the Product model, but I would prefer not to use EAV, because the attributes are static.


texts: magento , sales order save after how correctly update order data

texts:
How correctly update status for order?

i have this code, but it's not working for me

public function salesOrderSaveAfter($event){

        //check for fires twice
        if(!Mage::registry('backorder_daniilkrok_observer')){
            $order = $event->getOrder();
            $orderIncrementId = $order->getIncrementId();
            Mage::register('backorder_daniilkrok_observer',true);

            Mage::log('i here');
            foreach ($order->getAllVisibleItems() as $item){
                $oldQty = (int)$item->getProduct()->getStockItem()->getQty();
                $qtyOrdered = (int)$item->getQtyOrdered();

                $differenceQty = $oldQty - $qtyOrdered;

                //increase the price by 25%
                if($oldQty > 0 AND $differenceQty <= 0 ){
                    $product_model = Mage::getModel('catalog/product')->load($item->getProductId());
                    $price = $product_model->getPrice();
                    $newPrice = $price + (($price * 25) / 100);
                    $product_model->setPrice($newPrice);
                    $product_model->save();

                    //update status for order
                    $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
                    $state = 'new';
                    $status = 'backorder_status';
                    $isCustomerNotified = true;
                    $order->setState($state, $status, $isCustomerNotified);
                    $order->save();
                }
            }
        }
    }