texts: Save customer attribute programmatically in Magento 2

texts:
I'm trying to save the value of some custom customer attributes programmatically.
I have seen a few examples and everyone is proposing to create a controller for this. But I would like to save the attribute value without creating a controller and without calling it from the Object Manager.
In Magento 1 the code was this and it was enough to reload the page for it to work:
$customer = Mage::getSingleton('customer/session')->getCustomer()
$customer->setmyattribute(date('Y'));
$customer->save();

In my Magento 2 this is my code that i tried but not work:
namespace vendor\module\Block;

class SaveData
{

protected $customer;

protected $customerRepository;

public function __construct(
    \Magento\Customer\Model\Customer $customer,
    \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
)
{
    $this->customer = $customer;
    $this->customerRepository = $customerRepository;
}

public function saveDatagruppo()
{
    $customer_id = 3;

    $customer_repo = $this->customerRepository->create();
    $customer = $customer_repo->getById($customer_id);

    // get Custome Attribute value
    $cust_att = $customer->getCustomAttribute("datagruppo")->getValue();
    print_r($cust_att);

    //set custom Attribute value
    $add_id = "2021";
    $customer->setCustomAttribute("datagruppo",$add_id);
    $customer_repo->save($customer);

}
}

And this is the code in frontend
$blockPHPCuong = $block->getLayout()->createBlock('\vendor\module\Block\SaveData');
$blockPHPCuong->saveDatagruppo();

How can I do so that I can save my attribute on page load?
Thanks


texts:
I have the following code:

umask(0);
Mage::app();
$category =new Mage_Catalog_Model_Category();
$category->load($cid);

if ($status == "2") {
    $products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addFieldToFilter('status',Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
    $products->load();
}

if ($status == "1") {
    $products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*');
    $products->load();
}

I want to add a filter of stock qty to filter the products, I tried:

    $products = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect('*');
    **->addAttributeToFilter('qty', array("gt" => 0));**

But not succuessful, any ideas?


texts: How to include category id in url on category list page?

texts:
i want to include category id included in url on category list page.
My default category url is listed below::

http://magento2.shelltag.com/women/bags/backpacks

I want to show it like this :

http://magento2.shelltag.com/women/bags/backpacks-6

I want URLs for different categories when a user opens a Category page

magento2.shelltag.com/women/bags/backpacks-6
magento2.shelltag.com/women/bags-8
magento2.shelltag.com/women-10

How can it be achieved?


texts:
We have noticed since upgrading from Magento 1.9 to Magento 2.2.6 that wheres the VAT figure was being passed and stored in the paypal transaction it is not now - always 0 - even though the total figure is correct.

This is an issue as we rely on this for paypal reconciliation with the shop.

Has anyone else found this or know if there is a fix.

See example from this morning.


texts: programmatically creating attribute options - escaping

texts:
I'm using a script to programmatically create attribute options - the code is as follows:

            echo "Creating option ....\n";
            $attr_model = Mage::getModel('catalog/resource_eav_attribute');
            $attr = $attr_model->loadByCode('catalog_product', $key);
            $attr_id = $attr->getAttributeId();
            if (!$attr_id){
                    echo "Cannot find Attribute $code\n";
                    return 0;
            }else{
                $option['attribute_id'] = $attr_id;
                $option['value'][$value][0] = $value;
                $option['value'][$value][1] = $value;

                $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
                $setup->addAttributeOption($option);

            }

And for most values it's working absolutely fine.

However certain values are not being created - it's not throwing any errors, but it doesn't create the options.

One example is 55 mg/kg, which makes me suspect that it's an escaping issue.

Are there any particular escaping rules that I need to follow for this?

Thanks!


texts: Get all images besides thumb, small and base

texts:
Following up to this question here I am wondering with my code I have right now
<?php
$_collection = Mage::getResourceModel('catalog/product_collection')
    ->addAttributeToSelect('name')
    ->addAttributeToSelect('price')
    ->addAttributeToSelect('product_url')
    ->addAttributeToSelect('product_reviews')
    ->joinAttribute('image', 'catalog_product/image', 'entity_id', null, 'left')
    ->addAttributeToFilter('entity_id', $this->getPid())
    ->setPageSize(1);

if ($_collection->getSize()) {
    $_product = $_collection->getFirstItem();
    $_productImage = Mage::helper('catalog/image')->init($_product, 'image');
    $_productName = $_product->getName();
    $_productReview = $_product->getReviewsSummaryHtml($_product, 'default', false);
    $_productPrice = $_product->getPrice();
    $_productUrl = $_product->getProductUrl();
}
?>

Then i thought i can iterate through the gallery images like this
<?php
$sliderImage = array();
if(count($_product->getMediaGalleryImages())) {
    foreach ($_product->getMediaGalleryImages() as $_image) {
        $bannerImage = $_image->getSlider();
        if ($bannerImage) {
            $sliderImage[]  = $_image;
        }
    }
}?>

I always get the base image of the product.
However I have around 5-8 images per product, and besides the standard ones, base, small and thumb i would like a different picture to be loaded here.
Is it possible to somehow get a different image? I have them all in a sort order so for example I would like the image with sort order 3.


texts: Getting id_path or request_path or target_path of current category or product page

texts: I have many store views. I need to be able to retrieve id_path or request_path or target_path of current category or product page, so that I could retrieve target_path of the same category or product page for a different store view.


texts: How to get Custom Image Attribute in Block in Magento 2.1

texts:
I created a custom image attribute in admin panel (image_big) to show a specific image as a background in single product page, but I am not being able to fetch it inside the Block Class or phtml file.

Block:

<?php
    namespace MyVendor\ImageBig\Block;

    class ProductBigImage extends \Magento\Catalog\Block\Product\View\AbstractView
    {
    }

Template:

<?php
// $product = $block->getProduct()->getId(); // this works I get the correct ProductID
$product = $block->getProduct();
$productImageAttr = $product->getCustomAttribute( 'image_big' );
$productImage = $this->helper('Magento\Catalog\Helper\Image')
    ->init($product, 'image_big')
    ->setImageFile($productImageAttr->getValue());

What am I doing wrong?

Thanks


texts: Is the .probe line essential in a VCL file?

texts:
To make Varnish work, I need to remove this part:

.probe = {
    .url = "/pub/health_check.php";
    .timeout = 2s;
    .interval = 5s;
    .window = 10;
    .threshold = 5;
}

If I leave it, there is an Error 503 Backend fetch failed.

My configuration : Magento 2.3.3 - PHP 7.2 - Debian/Plesk - Varnish Docker


texts: How to get decimal value of weight in mini cart?

texts:
How to get decimal value of weight in mini cart.
I need to display only 2 decimals 11.00 instead of 11.0000


texts: Magento 2 Programatically clear all tax and Add custom in Observer

texts:
I am customize tax calculation on and adding custom tax.I am doing this using observer:
Magento Version is 2.3.4 ,below code is working fine and adding custom rates but My requirement to add clear all added tax before adding new one.
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_quote_address_collect_totals_after">
        <observer name="changeTaxTotal" instance="Vendor\CustomTax\Observer\ChangeTaxTotal"/>
    </event>
</config>

and observer file is
<?php

namespace Vendorname\CustomTax\Observer;

use \Magento\Framework\Event\ObserverInterface;
use \Magento\Framework\Event\Observer;

class ChangeTaxTotal implements ObserverInterface
{

    public function execute(Observer $observer)
    {

        /** @var Magento\Quote\Model\Quote\Address\Total */
        $total = $observer->getData('total');

        $subtotal = $total['subtotal'];
        $customTax = ($subtotal * 9)/100;

        if (trim($total['shipping_description']) == "Shipping_methode_name") {
           ------------in this line I want to clear all tax -------
            $total->addTotalAmount('tax', $customTax);
        }

        return $this;
    }
}

I want to Clear all added tax before adding my custom rateand also want to add tax title.
$total->addTotalAmount('tax', $customTax);
If anyone have idea please share me.


texts:
I would like to know when a product goes out of stock by user purchase.  I think there should be an event for this.  I am not able to find it though.

Also, in general, has Magento 2 published the official list of events somewhere?  That list would be to have.


texts: Issue with upgrading Magento 2 from 2.3.5-p2 to 2.3.6

texts:
I'm trying to upgrade Magento 2 with the latest release Magento 2.3.6 and getting an error while running the upgrade command.
Unable to apply data patch Magento\Elasticsearch\Setup\Patch\Data\InvalidateIndex for module Magento_Elasticsearch. Original exception message: Notice: Undefined index:  in /var/www/html/vendor/magento/framework/App/Route/Config.php on line 93
Currently we are using Magento 2.3.5-p2 version and algolia for search.
Previously we used Wyomind Elastic search and now the modules are disabled.
Do anyone have an idea about the issue? Please help me to resolve the same.


texts:
Some of the products weren't showing up in the search results on a site that I've been working on.

After looking at it for a while and logging the sql queries I've found that it's only searching the default category (category_id = 2).
The first query is:

SELECT `s`.`product_id`, 0 AS `relevance`
FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e`
ON e.entity_id = s.product_id
WHERE (s.store_id = 1) AND ((`s`.`data_index` LIKE '%denim%'))

which has 26 results, the next query is:

SELECT COUNT(DISTINCT e.entity_id)
FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_index_price` AS `price_index`
ON price_index.entity_id = e.entity_id
  AND price_index.website_id = '1'
  AND price_index.customer_group_id = 0
INNER JOIN `catalog_category_product_index` AS `cat_index`
ON cat_index.product_id=e.entity_id
  AND cat_index.store_id='1'
  AND cat_index.visibility IN(3, 4)
  AND cat_index.category_id = '2'
WHERE (`e`.`entity_id` IN(<the previous product_ids>))

since the products aren't in the default category they aren't showing up. My question is how to change this so it searches all queries.


texts:
I have to add about 100 attributes to product, but the file length is about 3000 lines.In installer I only add new attribute set, attribute group and attributes.

I have attributes data in separate method that only return multidimensional array (length 2900 lines).

Should I separate this attribute configuration in any way, if yes then how?


texts: Magento Pager is not showing in product list.phtml

texts:
In magento I override product list.phtml, its working fine but pager is not showing. I already included code in xml as well as in list.phtml for pager but not showing. Please help.

Thanks in advance

below code for list.phtml

$this->getToolbarHtml()

And for xml code

     <catalog_category_default translate="label">
                <reference name="head">
                    <action method="addJs"><script>varien/product.js</script></action>
                    <action method="addJs"><script>varien/configurable.js</script></action>
                    <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
                    <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
                    <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
                    <action method="addItem"><type>skin_js</type><name>js/bundle.js</name></action>
                </reference>
         <reference name="content">

        <block type="catalog/product_list" name="product_list" template="quickview/catalog/product/list.phtml">
        <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
         <block type="page/html_pager" name="product_list_toolbar_pager"/>
                        </block>
                    </block>

                </reference>
</catalog_category_default>


texts: get attribute option image from database magento

texts:
I want to display attribute option image on product detail page.

I have a variable that returns an array of option ID, but i  need the corresponding image to display the image:

<?php echo $_product->getProductTools(); ?>

I've tried this code but don t know how to replace 4550 by the result of the variable, and also the output should be an image(or list of image) not the url of image

$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$sql        = "SELECT `image` FROM `eav_attribute_option` WHERE `option_id` = 4550";
$rows       = $connection->fetchAll($sql); //fetchRow($sql), fetchOne($sql),...
Zend_Debug::dump($rows);


texts: Magento 2: Add/Remove class from div if minicart hasitem

texts: i want to add custom class if the minicart is empty and remove the class if minicart has items.


texts: From Default Luma to an actual store - How?

texts:
So, I've successfully installed Magento2, and I see the Luma theme with a Homepage that says CMS homepage content goes here.

I added a couple of sample products, but for the life of me I can't get those products to display.  I've tried adding the product list widget to the home page in the CMS, but that doesn't seem to do anything.  And yes, I refreshed the caches and indexes.

Is there a good step-by-step tutorial out there on how to get Magento CE to a state where it can actually act as a store?


texts: Magento 2 : Not able to override Magento_Payment::info/default.phtml

texts:
I have tried to override this template file by overriding the whole block where its called i.e Magento\Payment\Block\Info
But i am not able to override this file Magento_Payment::info/default.phtml
Is their any way we can override this file ?


texts:
I want to remove some list on the sidebar in My Account page like in picture below. How can i do it?

Sidebar :


texts: Magento2: I want to get customer cart item collection without customer login

texts:
How to get customer cart item collection without customer login?

I want to also get cart item through item id.

Got the null value

<?php

namespace vendor\module_name\Block\Index;

class Approveitem extends \Magento\Framework\View\Element\Template
{

    protected $_coreRegistry;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Framework\Registry $coreRegistry,
        \Magento\Quote\Model\Quote\ItemFactory $quoteItemFactory,
        \Magento\Quote\Model\ResourceModel\Quote\Item $itemResourceModel
    )
    {
       $this->_coreRegistry = $coreRegistry;
       $this->quoteItemFactory = $quoteItemFactory;
       $this->itemResourceModel = $itemResourceModel;
       parent::__construct($context);
    }

    public function getCartDetails(){
        $itemId = $this->_coreRegistry->registry('itemId');

        $quoteItem = $this->quoteItemFactory->create();
        $item = $this->itemResourceModel->load($quoteItem, $itemId);

        return $item;
    }
}


texts:
How can I add DHL Market Place in my Magento 2 admin? Been searching on how to enable it but can't find any solution. Should I just copy the download file into the app folder? or do I need to go to the admin panel?

Note: Beginner here


texts: magento 2: how to checked use default value for product status programmtically?

texts:
I have to update and checked checkbox for use default field for product status. But I do not know how to update and checked that checkbox ?

here is my code
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

        $productId = 1;
        $status = 1;
        $store = 1;

        $product = $objectManager->create('Magento\Catalog\Model\Product')->load($productId);

        try {
            $product->setStoreId($store);
            $product->setStatus($status);
            $product->save();

        } catch (\Exception $e) {
            echo "Error Id : " . $productId;
        }


texts:
I created a customer group but if I add a customer into this group he does not see any products anymore. If I switch him back to group "general" all products are visible again.

How do I make products visible to a customer group?


texts: Magento 2 error when merging and minifying JS and CSS files

texts:
I merged and minified JS files and CSS files and now my Magento 2 is throwing below error:

Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: Argument 4 passed to Magento\\Developer\\Model\\View\\Asset\\PreProcessor\\FrontendCompilation::processContent() must be an instance of Magento\\Framework\\View\\Asset\\File\\FallbackContext, instance of Magento\\Framework\\View\\Asset\\File\\Context given, called in vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php on line 90 and defined in vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php:107\nStack trace:\n#0 vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php(90): Magento\\Developer\\Model\\View\\Asset\\PreProcessor\\FrontendCompilation->processContent('c7e57e76387ecc5...', '@import 'source...', '', Object(Magento\\Framework\\View\\Asset\\File\\Context))\n#1 vendor/magento/module-developer/Model/View/Asset/PreProcessor/PreprocessorStrategy.php(74)...\n'

How to solve this?


texts: Installed Russian Language Pack - security issue?

texts:
A language pack has appeared in my configuration menu: "ET Russian Language Pack"

I didn't install it, and have manually deleted it.

It is coincident with increased bogus registrations, which makes me suspicious.

Any help, please?

Thanks, Brian


texts: Magento 2 : do not add products to compare if attributes set different

texts:
Case : Suppose i have products Shirts and Electronics, now if i add Shirt A and Mobile B to compare it allows but i want to restrict compare if same attributes sets .

So i user add Shirt to compare and trying to add Electronics to compare he will be shown error you can not compare Shirt to electronics.

How can this be achieved, please help us on it .


texts:
I am currently trying to create a module for Magento to show if the payment method used is Paypal Express via credit card or via Paypal account.

Digging through the files I come accross app/code/core/Mage/Paypal/Model/Api/Nvp.php

There is a line in Request/response for GetRecurringPaymentsProfileDetails where the code is:

protected $_getRecurringPaymentsProfileDetailsResponse = array('STATUS', /* TODO: lot of other stuff */);

What does this code do?


texts: Is there any way to set different theme depends on customer group?

texts:
I want to show different theme depends on customer group.Is there any way to set different theme dynamically?

For Eg.: Theme A for General customer group and Theme B for Wholesale customer group.

Thanks in advance


texts: Cart Price Rules - 2 Requirements: Exclude Special Price and Have Minimum Order Value

texts:
So...
I want to offer customers £50 off orders over £100.
However I want to exclude items that are already discounted (special price).
I've set it up and it works on individual items. However if my cart has 2 items (one discounted already) then it doesn't work. But the other item is over £100 - and therefore eligible.
Any ideas?


texts: Magento 1.9 preselect of configurable options (swatches)

texts:
Is there a way to have Magento 1.9 auto select one of its simple products from a configurable product when page loaded?

Pre select first item is good enough for me.


texts: Magento /pub/static is not writable - Permissions error

texts:
So I'm fairly new to Magento, in fact, it's my first time messing with Linux permissions.
I've been asked to change a few things on a website, and I can't even pass through the permissions part.

I think that I messed the permissions on the machine that the website is stored on, in fact, I know that I did it.

I searched stack overflow and Magento StackExchange for similar questions and all the solutions I found did not work on my problem, or at least they haven't applied the right way:

The commands I used:

Permission

sudo find . -type  f -exec chmod 644 {} \;
sudo find . -type  d -exec chmod 755 {} \;

Magento CLI Commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush

I have little to no experience using Linux/Unix commands and I think it might be that that is making me have a hard time understanding

Thanks in advance for the help, I'm trying my best to understand this


texts: when run the magento2 site I getting this errors in GTmetrix

texts:
When run the magento2 site in GTmetrix I'm getting google recpatcha issues. how to resolve these.
can some one please help me.


texts:
I am simply looking to get the shipping rates from the current quote and override them via a plugin/interceptor but have no idea where I'm going wrong here:
<?php

namespace Vendor\Module\Plugin\Model\Quote\Address\RateResult;

use \Psr\Log\LoggerInterface;

class MethodPlugin
{
    protected $_customerSession;
    protected $_logger;

    public function __construct(
        LoggerInterface $logger,
        \Magento\Customer\Model\Session $customerSession
    )
    {
        $this->_logger = $logger;
        $this->_customerSession = $customerSession;
    }

    public function beforeSetPrice($subject, $price)
    {
        $this->_logger->debug("Current price is " . $price);

        return $price;
    }

    public function afterSetPrice($subject, $price)
    {
        $price = 3.33;
        $this->_logger->debug("New price is " . $price);

        return $price;
    }
}

My thinking was that the beforeSetPrice() method would log the current price (which it does) and the afterSetPrice() method would log the new price (which it does) AND update the price shown in the shipping rates on checkout (which it doesn't)


texts:
I wanna export CSV from sales -> orders grid with only selected lines and not all commands like with the default button.

If there's a solution for that ?

Thank you for advance


texts: Convert Magento 1 (migrated) email templates to Magento 2 (variables)

texts:
Migrated Magento 1 into Magento 2 does not seem to contain any 'default' Magento 2 email templates (using the Magento 2 migration tool). It only contains the Magento 1 email templates that were migrated.
(If this Magento 2 installation had it, I could have used them as reference)
None of the templates variables work in Magento 2 when previewing or emailing.
The following Magento 1 email template (account registration completed):

Dear {{htmlescape var=$customer.name}},

Account Registration successfully completed.

Results in this :
Magento 2 articles found does not mention anything about Magento 1 migrated templates.
I checked the following articles, but mostly they just discuss changes between Magento 2 versions:

Email templates
Email Magento 2 migration

None of those assist me in changing Magento 1 variables into Magento 2 versions.
Question
Where / how can I find the equivalent versions.
For instance this template has {{var logo_url}}, {{var logo_alt}}, {{htmlescape var=$customer.name}}
A reference, or a way to browse the code to find the what is the customer/order/email address/etc variables versions of Magento 2.


texts: Custom field in checkout saved in quote_address and sales_order_address not shown in order summary

texts:
I have added a custom field to shipping and billing data in the checkout form. It's value is correctly stored in an extra column in tables quote_address and sales_order_address.

Now the goal is to show the value(s) from this field in the order summary like so:

And I've read somewhere that this can be done by changing the customer's configuration address templates, i.e. the HTML template with something like this:

  {{if custom_var_code}}{{var custom_var_code}}{{/if}}

Only it doesn't work. Clearly I left something out, but I've got no clue what.
Can anybody enlighten me?


texts:
How to send sms when an item quantity is out of stock in magento ?
i have used :

<catalog_product_save_before>
    <observers>
        <Metro_Notify>
            <type>singleton</type>
            <class>notify/Productobserver</class>
            <method>productSaveBefore</method>
        </Metro_Notify>
    </observers>
</catalog_product_save_before>

in my observer

private function lowStockReportSendEmail($product,$toEmailAddress)
{
    $stockItem = $observer->getEvent();
    Mage::log($stockItem,null,'stockitem.null');

    if($stockItem->getQty() < $stockItem->getNotifyStockQty())
    {
       //stock is lower than the notify amount, send email
       $product = $observer->getProduct();
       $productName =  $product->getName();
       $productId =  $product->getId();
       $supplierId = $product->getSeller_id();
       $supplierData = $this->_getSupplierData($supplierId);

       // $product = Mage::getModel('catalog/product')->load($stockItem->getProductId());

        $body = "{$productName} :: {$product->getSku()} just Ran out of stock:\n\n";
        $body .= "Current Qty: {$stockItem->getQty()}\n";
        $body .= "Low Stock Date: {$stockItem->getLowStockDate()}\n";

        $vars['PRODUCTID'] = $productData->getId();
        $vars['PRODUCTNAME'] = $productData->getName();
        $vars['SUPPLIERNAME'] = $supplierData->getFirstname();
        $vars['SUPPLIERNO'] = $supplierData->getSupplier_no();
        $vars['QTY'] = $stockItem->getQty();
        $vars['PREVIOUSQTY'] = $stockItem->getQty() - $stockItem->getOrigData('qty');

        $categoryManagerTemplateId = 'categorymanager_template_lowstock_report';
        $adminTemplateId = 'admin_template_lowstock_report';
        $fromEmailId = $supplierData->getEmail();
        $sender = array('name' => $fromEmailId,'email' => $fromEmailId);

        if(!empty($toEmailAddress))
        {
            $categoryManagerEmail = $toEmailAddress;
            $adminEmail = $toEmailAddress;
        }
        else
        {
            $categoryManagerEmail = $supplierData->getSupplier_cat_manager_email();
            $adminEmail = $this->_getAdminEmailAddress();
            $this->log('categoryManagerEmail',$categoryManagerEmail);
            $this->log('adminEmail',$adminEmail);
        }

        /* $storeId = Mage::app()->getStore()->getId();
        $templateId = 'supplier_product_stock_update';
        $fromEmailId = $supplierData->getEmail();
        $sender = array('name' => $fromEmailId,'email' => $fromEmailId);
        $toEmail = $supplierData->getSupplier_cat_manager_email();
        $name = $supplierData->getFirstname();
        $mailSubject = "Supplier Low Stock Notification"; */
        $name = $supplierData->getFirstname();

        $mailCategorySubject = "Out of Stock".$productName."(".$productId.")";
        $mailAdminSubject="Out of Stock".$supplierName;

        $this->_sendNotifyEmail($categoryManagerTemplateId, $sender, $categoryManagerEmail, $name, $mailCategorySubject,$vars, $storeId);
        $this->_sendNotifyEmail($adminTemplateId, $sender, $adminEmail, $name, $mailAdminSubject,$vars, $storeId);
        $this->log('LowStockReportEmail',$vars);
    }
}


texts:
I'm really struggling getting a simple product import to work on Magento 2. I've done this several times in ver 1.x without trouble, but M2 is driving me crazy

The code should be simple

    $product = $this->productFactory->create();
    $product->setTypeId($document->product_type);
    $product->setAttributeSetId($attributeSetId);
    $product->setVisisbility(4);
    $product->setUrlKey($queue->getSku());
    $product->setWebsiteIds($arrAllStores);
    $product->setStockData([
        'use_config_manage_stock' => 0, //'Use config settings' checkbox
        'manage_stock' => 0, //manage stock
        'min_sale_qty' => 1, //Minimum Qty Allowed in Shopping Cart
        'max_sale_qty' => 2, //Maximum Qty Allowed in Shopping Cart
        'is_in_stock' => 1, //Stock Availability
        'qty' => 100 //qty
        ]
    );
    foreach ($product_attributes as $key => $attr) {
        $product->setData($key, $attr);
    }
    $product->save();

Problem is, that Magento randomly decides in what store view it would like to strore the various attributes.

So I end up only having two values stored in store 0 while most others are set to store id 2 (which is the default frontend view). I'm running the code in admin, so this shouldn't happen. In my opinion it shouldn't happen at all. It should only be saved on store view level if specifically requested, anything else should be stored in view 0.

I've been trying adaptions of "setCurrentStore" like

$this->objectManager->get('Magento\Store\Model\StoreManagerInterface')->setCurrentStore(0);

But they have no effect.

I just can't figure out what I'm doing wrong. A framework should make things simpler, but in Magento it is always the opposite. I'm doing my best to follow guidelines, but this is just motivating me to write directly to the DB, because that way at least things work the way they should.


texts: How to set option of selecting customer group on customer registration form

texts: I want to give option to customers to select there customer group in magento 2 on customer registration page.


texts:
On the website I have two languages configured (Polish and English).
I have set up the main language of the Polish website after entering.

Unfortunately, when I enter the website in the private eye (after clearing browser cookies) the page displayed in English language.
In Attachment add screenshot  that I have correct configured page display in Polish.


texts:
When will the watermark bug be fixed in Magento 2.2.2 -- will this be an issue in Magento 2.2.4?

I have tried to add a watermark and I get this error:
Backend model is not specified for watermark_image_image

I have been told that it is a known bug.


texts: Product Star Ratings Summary not displaying Magento Enterprise

texts:
Star is not showing on review tab. Please help me
Please refer this screenshot: https://i.imgur.com/R7s9lVO.png


texts: Handling multiple stock locations or warehouses

texts:
The Magento database contains the table cataloginventory_stock with a single entry in there called 'Default'. I know this is the place to start for handling multiple stock locations.

I'm wondering if any of you have had experience in this and what the pitfalls are.

I'm looking to:

Be able to track product stock across various physical locations (shops/warehouses/etc)
Be able to identify where a product's stock is to be picked from for each customer order

If anyone could provide a link to an article or tutorial on this or just share their experience going down this path that would be great. Whether you've developed it yourself or have used a third party module, I'd love to hear from you.

Edit: I ended up writing my own multi-inventory module that adds extra rows to the existing cataloginventory_stock table. It required overriding a few observers and models that check the stock location. In many places the stock ID of 1 was hard coded into the core.

In another project I have used Demac's multi inventory location module. While it's not perfect, it worked out of the box and is written well. I was able to easily extend and customise it for my needs.


texts: Magento 2.4 database table catalog_product_attribute_cl has grown to millions

texts:
I've just noticed that the catalog_product_attribute_cl database table has 26 millions lines.
What is the purpose of this table, is this normal? can i safely delete all those rows?


texts: Where is located the function run by the invoice capture buton

texts:
When an invoice is in state_open, a "Capture" button apprears in the upper right of the invoice detail page.

Natively, clicking this button set the invoice state to paid, and the corresponding order state is set to processing.

In my case, I would like to set the order state to complete.

I am then thinking of rewriting the function linked to this button, but I do not manage to find where is located the function...

I read the html of the invoice view page and saw that the url called by the button was :

<button id="id_cd3d65d85e2f0df22c032a0847da7f6d" title="Capturer" type="button" class="scalable save" onclick="setLocation('http://www.myshop.fr/index.php/admin/sales_order_invoice/capture/invoice_id/77/key/485c21c1646791f987c44c5cdffdea2c/')" style="">Capturer</button>

I followed the path but did not manage to find the function...

Any help please?


texts:
How would I use

$collection = Mage::getModel('catalog/product')->getCollection();

to only return products that have a special price and my own custom attribute set to yes?


texts: How to set a fixed order for each group of attributes under attribute set name?

texts:
I have several attributes.

Some of them have been specifically created for this store. In Catalog --> attributes --> manage set of attributes they are grouped under a custom group called "technical data"

I have several set of attributes (one for every product categories) and they have different attributes under the group "technical data"

This attributes are showed in alphabetical order on the frontend in page product if their field are compiled.

I would like to change the order to present them using a customized order


texts:
How to add the new field in sales order item at Magento 1.9.x

And save the field in the database.

Add that table field


texts:
i want to add a hover effect on an image in a magento block.
i have this code in may block:

and i want to apply this kinde of hover on its image:

<!DOCTYPE html>

how can i do that?


texts: Install extension via composer - permission denied

texts:
I try Install via composer free extension Magento 2 SMTP.

installation guide:
https://www.mageplaza.com/magento-2-smtp/download/

I run  first command:

php composer.phar require mageplaza/module-smtp

Then I get error(permission denied):

Anyone know how to solve it ?
Thanks.


texts: Magically special_from_date is set whenever product is updated

texts:
I got a weird issue i can't see to find the reason behind it.
When i update product with a special_price and the special_from_date is NULL (empty) it updates the special_from_date to today.. And i can't seem to find why..

Is this a common bug? (i don't think so) but i also can't seem to find the root of the problem.
thanks in advance!

And for a short workaround how can i safely disable special_from_date or just don't let it update?


texts: How to load the block with Header,Footer,Left navigation, Right navigation in magento 2?

texts:
How to load the block with Header, Footer, Left navigation, Right navigation in Magento 2?

step by step please tell me


texts: How to programmatically disable a category?

texts:
$category_id = 8711;
$cat = Mage::getModel("catalog/category")->load($category_id);
$cat->setData('is_active', 0);
$cat->save();

it does not work...

thanks!


texts: Discount Rule Gets Deactivated Randomely

texts:
I have created one discount rule for entire store. As per the rule the all products are sold with 15% off. There is no other rule at any level.

This rule gets deactivated randomly. To again activate it, I have to run reindex command using ssh.

Just to try I created one cron job for reindexing by reading some article. This cron job runs at every 12hrs.

Issue not resolved.

Thanks,
Niraj


texts: Magento 2.0.12, 404 error(whoops, our bad) on all pages except Home, after fresh installation

texts:
After doing a fresh installation of Magento 2.0.12.
I am getting "whoops, our bad" page for all pages except the homepage(index).
The homepage load fine but for all other pages/links , I m getting this 404 error.

I tried adding Rewritebase / in the .htaccess, but it didn't change anything.

Can please someone help.
Here's is how the values in .htaccess looks like.

DirectoryIndex index.php

    php_value memory_limit 768M
    php_value max_execution_time 18000
    php_flag session.auto_start off
    php_flag suhosin.session.cryptua off

    php_value memory_limit 768M
    php_value max_execution_time 18000
    php_flag session.auto_start off
    php_flag suhosin.session.cryptua off

    SecFilterEngine Off
    SecFilterScanPOST Off

    SSLOptions StdEnvVars

    RewriteBase /
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]

    AddDefaultCharset Off
    AddType 'text/html; charset=UTF-8' html

    ExpiresDefault "access plus 1 year"
    ExpiresByType text/html A0
    ExpiresByType text/plain A0

    RedirectMatch 403 /.git

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

        order allow,deny
        deny from all

ErrorDocument 404 /pub/errors/404.php
ErrorDocument 403 /pub/errors/404.php

    Header set X-UA-Compatible "IE=edge"

        Header unset X-UA-Compatible


texts: How to find where a value is stored in magento database

texts: I have an extension that has allowed us to add some custom customer attributes to the database for use on their profile. I am looking to use one of the attributes ina  SQL join in an extension, but I can't find where exactly the value is being saved. I have found the description and setup of the attribute itself in the EAV_attribute table and the backend_type value for it is "varchar" but I can't seem to find exactly what table name to find the actual information.


texts: Magento 2: How to add row in an product attribute view

texts:
I've been searching on how to do this. I want to display my attributes like this image: https://s29.postimg.org/8yd26i0w7/Capture.png

Each product attributes have it's own row, which makes reading it very easy :)

Anyone?

Thanks!


texts: How Can I Customize Magento Default URL (Product URL and Category URL)

texts:
Suppose i have the following URL:

For Categories (example : apparels category):
http://example/apparels.html

For Categories (example : product under apparels category):
http://example/apparels/songket-batik-merah.html

I'd like to know how can i rewrite the above URLS so that for category URL it can contains '/category/' and for product URL it can contains '/product/' so the end result would become something like this :

http://example/category/apparels.html

http://example/product/songket-batik-merah.html

I know one solution for this is by doing it manually for each Category / Product via Back Office > Catalog > URL Rewrite.

Is there a better way to do this ?


texts: Can't get any order details in extension template when used in email template

texts:
I'm trying to get a custom attribute from an order into the new order transactional email template, BUT I need to pass it through some custom PHP for a bit of formatting first.

In the email template I use the following declaration:

{{block type='mymodule/myblock' area='frontend' template='mynamespace/mymodule/mytemplate.phtml'}}

With a block like this:

class Mynamespace_Mymodule_Block_Myblock extends Mage_Core_Block_Template
{
    public function getValue()
    {
        return "Some value";
    }
}

and mytemplate.php like this:

echo $this->getValue();

This all works and I get "Some value" appearing where I expect in the transactional email.

The problem I have is that I cannot get any information about the order within the block or template. Using code such as this:

$orderid = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($orderid);

just gives me NULL. For some reason by the time it get to processing my block the session data has been cleared.

I've tried changing my block to extend Mage_Sales_Block_Items_Abstract as the core magento email template does, but then when I copy the code in app/design/frontend/base/default/template/email/order/items.phtml to my template the checkout process doesn't complete on step 5 and it just keeps showing the 'place order' button.


texts: Magmi not importing pricing format correctly

texts:
pricing formats are working correctly except when a price is over 1000.00
for example we have a product that is 1075.00 and it is showing up as $1.75


texts: "invalid Domain for site key" issue in Captcha in contact us form in magento 2

texts:
While opening contact us form it shows error like below

Please provide me a solution to sort out this.


texts:
I have made the custom category layout update named as catalog_category_view_selectable_3_Test.xml in Magento_Catalog/layout.
When I checked in admin panel in custom layout update the options is not showing.

Kindly provide a solution to custom layout update for category for magento 2.4.


texts:
How do I parse this JSON with PHP:

a:6:{s:15:"info_buyRequest";a:6:{s:4:"uenc";s:148:"aHR0cHM6Ly9lcy5lLW1vc3NhLmV1L2FjY2Vzb3Jpb3MtcGFyYS1jb2NoZS1mdW5kYXMtcGFyYS1hc2llbnRvcy1kZS1jb2NoZS11bml2ZXJzYWwtbWFzdGVyLTU5MDI1MzgxNzA4NTcuaHRtbA,,";....

There are some metadata in there and json_decode is not working.

Please advice me on this.


texts: Page builder banner background image is not responsive

texts:
I want to show the Text Over Image in the content section of pdp page. Since, I'm using Magento 2 Enterprise Edition, there is a page builder bundled with Magento. So I have tried with banner and added some text over the image but when I see the image in frontend, the image is not responsive.
Is there any solution for this?


texts: what payment gateway do you use on your Magento 2 CE?

texts: We recently migrated from Magento 1.9.3.8 to Magento 2.2.7. We were using CyberSource as the payment gateway when we were using Magento 1. Right now our team is looking at the payment gateway again to see if we have any other options. I am not saying CyberSource is good or bad, I am just simply looking for other options here. And yeah we are aware of Paypal too, I think it always comes with Magento. Thanks!


texts:
I have module created with UMC ( ultimate module creator ) named consultancy. I have successfully added a field on Add/edit page with following code which I found in form.php file.

$fieldset->addField(
            'price_usd',
            'text',
            array(
                'label' => Mage::helper('abhi_consulting')->__('Price USD'),
                'name'  => 'price_usd',
            'required'  => true,
            'class' => 'required-entry',

           )
        );

other fields were added same way so i just copy pasted and changed the key, now the field is available but the value is not saving and showing blank.

I looked into the code but didnt find any save function. How do I save value for new added field ?


texts: Basic clarity on some magento default function

texts:
I had gone through a interview process. They fired some questions below which I don't know answers and couldn't find in google. The questions are below.

How to create a object and why we need to create objects ?
What is use of EAV database structure ?
Why the plugin is used ?
What is the use of requireJS ?
Why magento uses knockout JS ?
What the generated/code folder containers ?
What means interceptors ?
Why we use reindex command ?
Why Js and css are compiled and saved in PUB folder what is the use of it ?
When We should use public,protected and private functions?


texts: Magento 2 - add a custom input field below the cash on delivery radio button and save to quote_payment table

texts:
Need to add an input field below the Cash on delivery radio button.

Implemented the code by this link where the input is added below COD radio but the value is not added to the database.

Can anyone check what the wrong is on that code else provide the best solution to accomplish this?

Thanks in advance !!!!


texts: Magento2x equivalent class for Mage_Core?

texts:
What is the equivalent Magento2 class for the below

1)  Mage_Core_Controller_Front_Action

2) Mage_Core_Block_Template

Basically for Core ?


texts: Cms Pages Layout Update Xml not from admin

texts:
Hi i'm using below code in my cms page->design->layout update xml

<reference name="left">
<block type="cms/block" name="Cms Pages Left Sidebar" as="Cms Pages Left Sidebar" before="-">
       <action method="setBlockId"><block_id>cms_pages_left_sidebar</block_id></action>
    </block>
</reference>

Everything working fine, but i have more then 200 pages, so it's a tidious process to update in all pages.

So i've added the same in mytheme's config.xml but now the issue is it's coming in product and category pages too.

Is there any way to show them only in cms pages ?


texts: Magento 2.X: Change sequence of Tabs in Product details Page For Porto Theme

texts:
I had few tabs in product detailed page and I want to show those tabs in order like Details, Key Specifications, contents Of Package, More Information, Warranty, Reviews
i didnt write any code and i add extra tabs from amin panel
For reference please find the attached image


texts: Best way to keep product attribute updated which depends on order status

texts:
I've a product attribute "Pending Shipping quantity" available for all products. It value will be counted based on Order status. If an order is placed for product having SKU 100 and order state is processing, Pending shipping quantity of this product will be the quantity ordered.

So, for SKU 100, if there is an order in processing state, the quantity ordered in that order will be the Pending shipping quantity.( If same product is available in another order in processing state, Pending shipping quantity will be the sum of the quantity of product ordered in both the orders).

Pending shipping quantity should decrease if the order status changes.

What should be the best approach to achieve it?

Possibility 1:

Use observer method sales_order_place_after or sales_order_save_after and increase Pending shipping quantity when state changes to processing.
Use observer method sales_order_save_after and decrease Pending shipping quantity if state change from processing to something else.

Possibility 2:

Get sales order collection filtered by state processing. Get all items attached to these orders and based on ordered quantity Pending shipping quantity.Though this process looks a bit more complex.

Is there any other way to achieve it keeping performance in mind?


texts: Exception Error in my Magento home page: client denied by server configuration

texts:
I am getting an error message when I am hitting my Magento home page URL. The error message is:

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 1106250235

I have checked the error log and there I am getting the error message as
client denied by server configuration: C:/wamp/www/magento-new/app/etc/local.xml


texts: Magento module that filter by status and change it to another one

texts:
i'm new on Magento. I'm trying to do a module that move the order from one status to another on a selected due date/time.

I have the following code on my Observer:

    $selectedStatusUnformated = Mage::getStoreConfig('expiry_options/expiry_selection/expiry_status_in');
    $selectedStatusIn = "'".$selectedStatusUnformated."'";
    $selectedStatusOut = Mage::getStoreConfig('expiry_options/expiry_selection/expiry_status_out');
    $selectedDays = Mage::getStoreConfig('expiry_options/expiry_selection/expiry_day');
    $selectedTimeUnformated = Mage::getStoreConfig('expiry_options/expiry_selection/expiry_time');
    $selectedTime = str_replace(',', ':', $selectedTimeUnformated);
    $selectedIsEnabled = Mage::getStoreConfig('expiry_options/expiry_selection/expiry_enable');

      if($selectedIsEnabled == '1'){
              $orderCollection
                ->addFieldToFilter('status', $selectedStatusIn)
                ->addFieldToFilter('created_at', array(
                'lt' =>  new Zend_Db_Expr("DATE_ADD('".now()."', INTERVAL -'$selectedDays $selectedTime'  DAY_SECOND)")))
                ->getSelect()->order('entity_id')->limit(10)
              ;

      $orders="";

      foreach($orderCollection->getItems() as $order){
        $orderModel = Mage::getModel('sales/order');
        $orderModel->load($order['entity_id']);

        if(!$orderModel->canCancel())
                          continue;

        $orderModel->cancel();
        $orderModel->setStatus($selectedStatusOut);
        $orderModel->save();
      }

But when i try to run this job it returns me:

Fatal error: Uncaught Error: Call to a member function addFieldToFilter() on null in C:\xampp\htdocs\magento.local\app\code\local\Resultate\PaymentDeadline\Model\Observer.php:32 Stack trace: #0 C:\xampp\htdocs\magento.local\app\code\community\Aoe\Scheduler\Model\Schedule.php(213): Resultate_PaymentDeadline_Model_Observer->cancelUnpaidOrders(Object(Aoe_Scheduler_Model_Schedule)) #1 C:\xampp\htdocs\magento.local\app\code\community\Aoe\Scheduler\controllers\Adminhtml\JobController.php(105): Aoe_Scheduler_Model_Schedule->runNow(false) #2 C:\xampp\htdocs\magento.local\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Aoe_Scheduler_Adminhtml_JobController->runNowAction() #3 C:\xampp\htdocs\magento.local\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('runNow') #4 C:\xampp\htdocs\magento.local\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #5 C:\xampp\h in C:\xampp\htdocs\magento.local\app\code\local\Resultate\PaymentDeadline\Model\Observer.php on line 32

Where line 32 is "->addFieldToFilter('status', $selectedStatusIn)"


texts:
Anyone can suggest how to override below class

Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav.php file


texts: I have a module to download a file on S3 by magento 2. When I click button download, it will down a file csv, now I want if this file does not exist so display a popup message on screen by 1 notification sentence and 1 button OK. How can I do that? Help me!!! Tks !!!


texts: How can I migrate from X-Cart to Magento with high security?

texts: My store is using X-cart. I have plan to migarate it to Magento. Could anybody tell me which migration tool is secured?


texts:
My system is not booting properly as it shows a error on booting
It shows error on booting ERROR=>"Read Error"
Can anyone provide me solution for this


texts: How to show the static block only for logged in customers globally?

texts:
I have created static block in admin panel and want to show that block only for logged in customers. I have tried it via creating the module and in template file I have written a condition to show the block for logged in customers but how can I make globally and not for specific page. For example, If I call that block in cms page that time as well the condition has to work.
<?php if ($customerSession->isLoggedIn()) { ?>
<?php
echo $this->getLayout()
->createBlock('Magento\Cms\Block\Block')
->setBlockId('testblock')
->toHtml();
?>
<?php } ?>

Please guide


texts: Magento Reporting - Is it bucketing by UTC?

texts:
I expected that the magento reporting (specifically, sales > orders report) would bucket days by local time.

This doesn't seem like it's the case, at least on magento 1.14.2.2. By comparing the raw orders with the order report, it is clear that some orders are not bucketed correctly in the report, because it's bucketing by UTC as opposed to local timezone.

The timezone is set correctly in the system, and lifetime statistics have been refreshed.

I have tried with Magento 1.9.2.2 and the result seems to be bucketed by local timezone. I guess this means it could be a configuration issue, or perhaps a bug?

Can anyone confirm or deny this issue?


texts: Magento Order Email Notification not sent to customer and to admin

texts:
Am facing problem on order email notification not sent to customer.

I don't know why, but when i search some articles it maybe cause of cron jobs not working.

Here's my error log:

exception 'Varien_Exception' with message 'Invalid method Mage_Sales_Model_Order::queueNewOrderEmail(Array
(
)
)' in /home/ohmyprimus/public_html/lib/Varien/Object.php:653
Stack trace:


texts: Magento 2 : Selected Category Not Shows in UI Form

texts:
I add category selector in UI form

<field name="catalog">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Catalog\Ui\Component\Product\Form\Categories\Options</item>
        <item name="config" xsi:type="array">
            <item name="sortOrder" xsi:type="number">50</item>
            <item name="label" xsi:type="string" translate="true">Select Category</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="componentType" xsi:type="string">field</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="component" xsi:type="string">Magento_Catalog/js/components/new-category</item>
            <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
            <item name="source" xsi:type="string">item</item>
            <item name="breakLine" xsi:type="boolean">true</item>
            <item name="filterOptions" xsi:type="boolean">true</item>
            <item name="showCheckbox" xsi:type="boolean">true</item>
            <item name="disableLabel" xsi:type="boolean">true</item>
            <item name="multiple" xsi:type="boolean">true</item>
            <item name="visibleValue" xsi:type="string">3</item>
            <item name="levelsVisibility" xsi:type="number">1</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="required" xsi:type="boolean">false</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">false</item>
            </item>
            <item name="listens" xsi:type="array">
                <item name="${ $.namespace }.${ $.namespace }:responseData" xsi:type="string">setParsed</item>
            </item>
        </item>
    </argument>
</field>

It's working fine but it's not show selected value on dropdown after save.

In database save Category Id like:


texts:
I'm searching for the best approach to extend the CSS of the default Venia header component without copying the entire default file.

I've already looked up the render chain and created the component directories, copied the components and updated the import statements and now I'm looking for a way to extend the default CSS which is imported and used via the following lines of code:

import defaultClasses from '@magento/venia-ui/lib/components/Header/header.css';

const classes = mergeClasses(defaultClasses, props.classes);

I thought of additionally importing an extra file and merge this together in const classes but this doesn't seem to work.


texts:
I am calling REST PUT to change a category name (one that I am testing) and the response is 200 with the correct new name. When I do a REST GET on the id to get the category back it is again the correct name.

But when I am in administration the category name has not changed.

Could it be related to cron jobs not running?

I ran them manually but still no change.

UPDATE: When testing the same process with a product it works fine. I can POST a product and update it's name with a PUT.

UPDATE2: Logged a bug with Magento.

UPDATE3: In the db the REST PUT call seems to insert a new record with the wrong store ID (1). With sample data loaded the store ID should be 0. Need to figure out how to set the store ID through REST PUT.

UPDATE4: REST PUT works but it changes the name in Default Store View level and not at root level (All Store Views). I have yet to find a way to set the store view ID to 0 in the REST PUT call (or why it defaults to 1)


texts: prepend field to onepage checkout billing form

texts:
The onepage layout's file billing.phtml offers the following entry point:

<?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>

So I can hook into that and do:

<checkout_onepage_billing>
    <reference name='checkout.onepage.billing'>
        <block type='checkout/onepage_billing' name='checkout.onepage.billing.extra'
               template='billing_myform.phtml'></block>
    </reference>
</checkout_onepage_billing>

I also found out that you can place blocks "wherever" you want with the before and after attribute.

<block type="core/template" name="my_block" before="not-sure-what-should-go-here-the-id?" template="billing_myform.phtml"/>

So is there a way to add my field to any place in the billing form?
Say right before the company input?


texts: Magento 2.3 - Transform add to compare link in list to checkbox

texts:
By default the Magneto 2.3x add to compare is a link, but we want to change this into a checkbox, so it become easier to check multiple products on the catalog product overview (list page).

How can we achieve this?


texts: Fotorama zoom functionality add for child product images of group product : M2

texts:
I want to add fotorama zoom functionality for child product images of group product at product details page.

i have update this ("Magento_GroupedProduct\templates\product\view\type\grouped.phtml") file, so now using magento2 script i got child images for group product.

can any one guide me for this functionality.

I have try using this script but it's not working.

require([
        'jquery','jquery/ui',
        'fotorama/fotorama'
    ], function ($, fotorama) {
        'use strict';

    $('.fotorama').fotorama({
      width: 700,
      maxwidth: '100%',
      ratio: 16/9,
      allowfullscreen: true,
      nav: 'thumbs'
    });
});

thanks.


texts:
I have set default country as UK in admin, after the configuration is done, In checkout one empty drop down is showing before the UK country.

so I have used below plugin to remove that empty dropdown.

di.xml

 <type name="Magento\Directory\Model\ResourceModel\Country\Collection">
    <plugin name="country_empty_dropdowns" type="Vendor\Module\Plugin\Country\Collection" sortOrder="1" disabled="false" />
</type>

Collection.php

namespace Vendor\Module\Plugin\Country;

class Collection
{
/**
 * Arguments processing.
 *
 * @param \Magento\Directory\Model\ResourceModel\Country\Collection $subject
 * @param bool $emptyLabel
 *
 * @return bool|array
 */
public function beforeToOptionArray(
     \Magento\Directory\Model\ResourceModel\Country\Collection $subject,
    $emptyLabel = null
) {
    return is_null($emptyLabel) ? [''] : null;
  }
}

Seems code is correct, but still i can see empty dropdown before the default country in checkout as well as in cart page.

Please anyone look into it and update your thoughts. Thanks


texts: How to var_dump data in the file controller and Model

texts:
How do I var_dump data in the file controller and Model?

I tried: var_dump and die

and view source ... but it's not displayed


texts: Magento 2 + How to import the custom city collection from the database into a dropdown (for the city textarea)

texts:
I'm a bit confused with creating a city dropdown with my custom cities. I have already imported the cities into a table and also created the Model, ResourceModel, Collection. Now I need to get those cities into a dropdown.

Below image is the table of my custom cities:

Below is my code to implement the 'getAllOptions()' function:

namespace Talliance\SwyftShippingMethod\Model\Customer\Source;

use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
use Talliance\SwyftShippingMethod\Model\ResourceModel\SrilankanCity\CollectionFactory as SrilankanCityCollectionFactory;

class SrilankanCity extends AbstractSource
{

   protected $_srilankanCityCollectionFactory;

   protected $_logger;

   public function __construct
   (
       SrilankanCityCollectionFactory $srilankanCityCollectionFactory,
       \Psr\Log\LoggerInterface $logger
   )
   {
       $this->_srilankanCityCollectionFactory = $srilankanCityCollectionFactory;
       $this->_logger = $logger;
   }

   public function getAllOptions()
   {
       if (!$this->_options) {
           $this->_options = $this->_createCitiesCollection()->toOptionArray();
           $this->_logger->log(100, print_r($this->_options, true));
       }
       return $this->_options;
   }

   /**
    * @return \Talliance\SwyftShippingMethod\Model\ResourceModel\SrilankanCity\Collection
    */
    protected function _createCitiesCollection()
    {
        return $this->_srilankanCityCollectionFactory->create();
    }
}

This is my output in my debug log file:

What am i doing wrong here?
Thanks in advance.


texts:
For service reasons, we need to be able to create two different customer accounts with the same email.
My platform, access from another website where I have my "users / customer" and I can have different users with the same email.
I need to modify that magento behavior. Any addon or documentation to work on it?


texts: Magento2: What exactly is stored in Redis "page and default cache"?

texts:
We figured out that we are a bit unsure about what exactly is stored in redis "page and default cache".

Until now, we thought it is only about configuration, and maybe some page templates. But today, we rolled back a deployment in a test system, and at least one feature was not rolled back until we cleared the redis cache.

That one feature was a patch to a module in the vendors directory.

We wonder now what exactly is cached in the redis and default cache in order to know in which situations after a deployment we have to clear the cache.

Any suggestions?


texts: How to retrieve reward point amount for order using REST API in Magento 2

texts:
The Magento 2 (Enterprise) REST API for endpoint: /V1/orders/{entity_id} is missing the field containing the redeemed reward points for an order, called reward_currency_amount.

I have checked the Swagger doc and pulled requests into Postman, but don't see anything matching that field.

How can I retrieve the redeemed reward amount for an order via API method?

REST API JSON structure for order request:
https://jsfiddle.net/4rua50cd/

Sample JSON from application:
https://jsfiddle.net/ce83wfo0/


texts: How i can work with extension attributes using collection?

texts:
Hello i have to add extension attributes to Magento\Catalog\Api\Data\ProductInterface

So i added this one to extension_attrributes.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface">
        <attribute code="custom_attribute" type="int"/>
    </extension_attributes>
</config>

And to di.xml added:

<type name="Magento\Framework\EntityManager\Operation\ExtensionPool">
        <arguments>
            <argument name="extensionActions" xsi:type="array">
                <item name="Magento\Catalog\Api\Data\ProductInterface" xsi:type="array">
                    <item name="read" xsi:type="array">
                        <item name="customAttributeReader" xsi:type="string">Vendor\Custom\Model\Product\CustomAttribute\ReadHandler</item>
                    </item>
                    <item name="create" xsi:type="array">
                        <item name="customAttributeCreator" xsi:type="string">Vendor\Custom\Model\Product\CustomAttribute\SaveHandler</item>

                    </item>
                    <item name="update" xsi:type="array">
                        <item name="customAttributeSaver" xsi:type="string">Vendor\Custom\Model\Product\CustomAttribute\SaveHandler</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </type>

So it`s work fine. When i get product entity using ProductRepository or load() function in Product model, all my extension attributes loads successful. But i have some issue when i work with Collection:

When i do something like:

$productCollection->addFieldToFilter('custom_attribute', 2);

My code don't wok and it's expected because my model not contains this attribute.

So i have a question. How i can filter by my extension attribute using collection ?

Also if i do:

$productCollection->getFirstItem()->getExtensionAttributes()

I get empty array.

So i need your help. I'll be very grateful!!!


texts:
I'm trying to enable the "Save in address book" option to be Checked by default for all new orders placed by the Admin.
I've edited the file app/design/adminhtml/default/independ/template/sales/order/create/form/address.phtml

Which is fine on initial load. However, if I change the Dropdown and select "Add New Address" the box then un-checks itself. I'm assuming that there is some Javascript somewhere that's doing this, but I couldn't find any easily so I'm hoping someone has done this before.


texts:
Very new to Magento and need some guidance.

We are running a promotion and need to remove tiered pricing however we want to re activate it after the promotion.

Is there a way I can export all products (inc tier pricing info), make a copy of the csv, delete tiered pricing info in the csv copy, then re-import/update the original csv after the promotion?

Thanks for any suggestions.


texts: Magento 2 + I want remove United Parcel Service Title

texts: We are using the UPS shipping method, but I want to hide United Parcel Service from all over the site, is there any easy way so we can remove or hide that from Cart, Checkout (Billing & Shipping), and emails.


texts:
protected $cart;

 \Magento\Checkout\Model\Cart $cart,

 $this->cart = $cart;

Why returns null ?

$this->cart->getQuote()->getAllItems();

and

$this->cart->getQuote()->getAllVisibleItems();

And with session same result.


texts: How to create custom menu in Magento admin panel? System>configuration>Custom

texts: How to create custom menu in Magento admin panel system > configuration >


texts: Magento 2: Cache problem Cart items drops

texts:
Have been struggling with this problem for some time now and its a bit confusing.
The problem is the following that my cart drops the products added when I visit a new category on the site.

When FPC is disable all works fine.

Have been testing and testing and have found out the the problems occur when the page on the site is not cached.
If I have visited the site one time before then its not problem to add the product, but is the category/page in the cache all the items in the cart is droped and when I add the product from the unpages cached this will be the number 1 item in the cart and the other is gone.

Need to find a solution for this problem so I can put the site live and replace my M1 current site.
Or maybe M2 is still to full of bugs so its better to wait some time.

There is not problem at all when the FPC is disable then all the items remain in the cart.

Magento 2.3.
site: http://kasperstestdev.prod42.magentohotel.dk/

Happy new year btw :)


texts: Center products on category if only 1 product exists?

texts: I have some categories where the category only has 1 product that exists. Is there a way to center this product? Should really center up to 3 products since 4 completes the row.


texts: Magento 2 : Triggering Event While Clicking Custom Button

texts: The custom event should be triggered while clicking the button. I do not have much idea in creating custom events and observers...please help me


texts: Magento2 : Getting error while updating the data using API

texts:
I am getting the following error while updating the record using the Magento 2 REST API.

  Error:

  (
          [message] => Request does not match any route.
          [trace] =>
      )

I am explaining my code below.

$customerData = [
        'customer' => [
            "id" => 25,
            "email" => "subhra@email.com",
            "firstname" => "subhrajy",
            "lastname" => "pradhan",
            "storeId" => 1,
            "websiteId" => 1,
             "customAttributes" => [
        ],

        "addresses" => [

        ]
    ],
        "password" => "subhra123@"
    ];

    $headers = array("Authorization: Bearer $token");
    $requestUrl='http://hostapp.com/index.php/rest/V1/customers/25';

    $ch = curl_init();
    $ch = curl_init($requestUrl);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($customerData));
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . $token));
    $result = curl_exec($ch);

    $result = json_decode($result, 1);
    echo '<pre>';print_r($result);

Here I trying to update only the password using entity_id and getting the above error. I am using the postman and setting the PUT method there. Here I need to update those data for a customer.


texts: Play sample file as inline and files from my account as attachment

texts:
I am working on the downloadable products.i want my preview file on the frontend should play and customers should able to download the products from their account from my downloadable products.

I know their is one configuration given by magento. Under Sys > Config > catalog > Downladable Information. use content disposition to inline both preview and products from my account will play.

and if i use content disposition as attachement then then preview file and products from my account downlad as attachment

Now actually i want preview to be played (inline) and products from my account should be downladed (attachment)


texts:
I would like to have the index page of concrete5 and magento 2 store. How do I configure nginx to use the index of concrete5 and not that of magento 2.
This site is multilanguage, use map to redirect in to the domain ITA/ENG/DE

Thank you!


texts: Magento 2.3.3 showing Pending Payment status after successful order complete

texts:
I have configured Website Payments Pro Hosted Solution in magento 2.3.3 for paypal and card payment methods.

When placing an order using paypal, once the order is successful, order status changing to processing.

But when placing an order using card payments, once the order is successful, status is not changing to processing still it shows Pending Payment.

Any help on this issue?


texts: Magento Administration Configuration Page blank after upgrade to 1.9.1.0

texts:
I have seen many similar posts describing the problem I am experiencing, but I have been so far entirely unsuccessful in trying to resolve it. I recently upgraded to Magento CE 1.9.1.0, and now I get a blank page when navigating to System > Configuration in the back-end. The rendered page contains only empty html and body tags.

The error:

The only error that I get (in the logs or on screen with display_errors enabled in the index.php) when opening the configuration page (or any other admin page) is the following:

  Fatal error: Call to undefined method Zend_Locale::getAlias() in app/code/core/Mage/Core/Model/Locale.php on line 243

Referer: http://example.com/index.php/magento/index/index/key/.../

The relevant line from Locale.php is:

$allowedAliases[Zend_Locale::getAlias($code)] = $code;

I have attempted:

Refreshing and/or disabling all caches.
Disabling all non-Mage modules in app/etc/local.xml (disable_local_modules), app/etc/modules (<active>false</active>), app/code/local and app/code/community (removing all files).
Tried both PHP 5.4.16 and 5.5.21
Comparing all files in app/ and lib/ with those from a fresh install. None were missing, but I attempted refreshing them anyway.
Refreshing the user permissions by opening and saving the Administrator role in System > Permissions > Roles.
Checked and re-checked file permissions, having tried both the Magento recommended perms and fully permissive (777).

System specs:

CentOS 7
Magento CE 1.9.1.0
PHP 5.4.16 or 5.5.21


texts:
Checkout with Multiple Addresses and Onepage. Both save at sales_order table in database. But I don't know what function it call to save at sales_order table. Who can help me?

This is my di.xml

<config>
    <type name="Magento\Multishipping\Model\Checkout\Type\Multishipping">
        <plugin name="logging-checkout-multi" type="TTV\OrderLog\Plugin\Log" sortOrder="1"/>
    </type>
    <type name="Magento\Checkout\Model\PaymentInformationManagement">
        <plugin name="logging-checkout" type="TTV\OrderLog\Plugin\Log" sortOrder="2"/>
    </type>
</config>

function in TTV\OrderLog\Plugin|Log

    public function beforeSavePaymentInformationAndPlaceOrder()
    {
        $this->_log->pushHandler(new \Monolog\Handler\StreamHandler('var/log/information.log'));
        $productList = $this->_sessionCheckout->getQuote()->getAllVisibleItems();
        foreach ($productList as $product) {
            $productName = $product->getName();
            $productQty = $product->getQty();
            $productPrice = $product->getPrice();
            $this->_log->info("Product Name: " . $productName . " - " . "Product Quantity: " . $productQty . " - " . "Product Price: " . $productPrice);
        }
    }


texts: How to override search request? Magento 2

texts: Tell me, please, how can I programmatically override the search query? For example: the user enters "Any word" in the search field, and the search is performed using the "Custom word". And as a result on the search page we get the goods found on the query "Custom word".


texts: How to run cron job at a particular time in Magento 2?

texts:
I want to create a cron job which update product price which are disabled and the cron run at a specific time 1 time in a day.
I have created a custom basic module from taking reference from https://www.mageplaza.com/devdocs/magento-2-create-cron-job/
My crontab.xml (path : app/code/Product/Cron/etc/crontab.xml )
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
    <job instance="Product\Cron\Cron\Test" method="execute" name="mageplaza_helloworld_cron">
        <schedule>*/1 * * * *</schedule>
    </job>
</group>
</config>

my test.php is
<?php

namespace Cron\Run\Cron; (path : app/code/Product/Cron/Cron/Test.php )

class Test
{

public function execute()
{

    $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/cron.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);
    $logger->info(__METHOD__);

    return $this;

}
}

But it does't show me message in cron.log file.
What am i missing any help is appreciated.


texts: Require specific Magento 2 Github commit with composer

texts:
There are some explanations on Stackexchange on how to require a specific commit with composer, for example these:

https://stackoverflow.com/questions/25878984/can-i-pull-a-specific-commit-with-composer
https://stackoverflow.com/questions/21314381/how-to-correctly-require-a-specific-commit-in-composer-so-that-it-would-be-avail

However, I can't figure out how to do this for the Magento 2 repository. I want to have this commit in my repository: https://github.com/magento/magento2/commit/beeae93d25ca4a35e7b4879f9447cc82119872aa

What I have tried so far

1.) composer require magento/magento2 "dev-develop#beeae93"

Error:

  The requested package magento/magento2 could not be found in any
  version

2.) composer require magento/product-community-edition "dev-develop#beeae93"

Error:

  The requested package magento/product-community-edition dev-developer#beeae93 exists as magento/product-community-edition[2.1.8, [...]`

My composer.json file

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.0.10",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        "foomanartifacts": {
            "type": "artifact",
            "url": "vendor/fooman/packages"
        },
        "iways_paypalplus": {
            "type": "git",
            "url": "git@github.com:i-ways/magento2-paypal-plus.git"
        }
    },
    "require": {
        "magento/product-community-edition": "2.1.8",
        "composer/composer": "@alpha",
        "iways/module-pay-pal-plus": "^1.0"
    },
    "require-dev": {
        "phpunit/phpunit": "4.1.0",
        "squizlabs/php_codesniffer": "1.5.3",
        "phpmd/phpmd": "2.3.*",
        "pdepend/pdepend": "2.2.2",
        "sjparkinson/static-review": "~4.1",
        "fabpot/php-cs-fixer": "~1.2",
        "lusitanian/oauth": "~0.3 <=0.7.0"
    },
    "config": {
        "use-include-path": true
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/"
        },
        "psr-0": {
            "": "app/code/"
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "alpha",
    "prefer-stable": true,
    "extra": {
        "magento-force": "override"
    }
}


texts:
on stock level = zero a product should offer the following:

i) Allow backorders, i.e. allow user to order even though stock is zero; and

ii) show the "Alert me when this product is back in stock" link.

I think it makes sense to allow those customers who want to pay money in advance to do so, and to allow the others who just want an alert to do so too.

However I've found that Magento only allows you to have one or the other.

Any help appreciated!


texts: Add image in category menu before category-name Magento 2

texts:
I'm create new attribute is small image for category.In admin i have save image for category-1 then i get this image in menu category but image exist for all category.Although in admin i just save image for category-1.Same this image  red box is category save image in admin.pls see help me.
I Will add image in file custom Topmenu.php
 `

 $objectManager = \Magento\Framework\App\objectManager::getInstance();
        $cate = $objectManager->get('\Magento\Catalog\Model\Category');
        $id = substr($child->getId(),14);
        $item  = $cate->load($id);
   $image = $id !='' ? 'getSmallImageUrl().'" width="30" height="30">' :'';
        $outermostClassCode = '';
        $outermostClass = $menuTree->getOutermostClass();

        if ($childLevel == 0 && $outermostClass) {
            $outermostClassCode = ' class="' . $outermostClass . '" ';
            $child->setClass($outermostClass);
        }

        if (count($colBrakes) && $colBrakes[$counter]['colbrake']) {
            $html .= '

';
        }

        $html .= '
_getRenderedMenuItemAttributes($child) . '>';
        $html .= 'getUrl() . '" ' . $outermostClassCode . '>'.$image.'' . $this->escapeHtml(
            $child->getName()
        ) . '' . $this->_addSubMenu(
            $child,
            $childLevel,
            $childrenWrapClass,
            $limit
        ) . '
';
        $itemPosition++;
        $counter++;`


texts: Magento 2 - product passed to helper parameter is NULL

texts:
I created this helper method:

app\code\Company\Base\Helper\Product.php

public function test($product = null)
{
    if (!empty($product)) { exit("TRUE, product is not empty!"); } else { return false; }
}

And injected it into a block, so I can use it there:

THEME\Magento_Catalog\layout\catalog_category_view.xml

<referenceBlock name="category.products.list">
    <arguments>
        <argument name="test" xsi:type="helper" helper="Company\Base\Helper\Product::test" />
    </arguments>
</referenceBlock>

Then I call my helper in THEME\Magento_Catalog\templates\product\list.phtml

<?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
<?php foreach ($_productCollection as $_product) :?>
<?php echo $block->getTest($_product); ?>

This is the template for the category view btw.

But I never get to see "TRUE, product is not empty!".

The same code works great in other locations e.g. on the block product.info.media.image with template
Magento_Catalog::product/view/gallery.phtml


texts: Magento 2 with blank theme : no product on the homepage

texts:
With Blank Theme activated on my fresh install of Magento 2.1.3, all the sample data products of the front page don't show up anymore.

Is this a bug ? If not, how can I get the products to show up in my custom theme which inherits from the blank theme ?


texts: http://myurl/api/rest/categories is not working

texts:
I want to get category tree in magento 1.9 using REST API using
 this code http://myurl/api/rest/categories
but i am getting error 404.

Please help me in to get over this error


texts:
http://example.com/dev/index.php/organic-wheat-flour-500g.html#.WCK-4bnpVBw
.WCK-4bnpVBw dont know why this happen
Afer Url 11 digit tracking code are available.
How to remove this from url?


texts:
I am working on M2 Payment Extension our merchant need us to send items details along with order

Everything works fine but $order->getAllItems(); or $order->getAllVisibleItems(); returning simple and configurable parent products so

if I have 2 products in Cart

1 Simple Product
1 Associated of configurable product

so instead of getting two products I am getting three ; one simple , associated product and its parent product;

I can try to extract correct products but I am sure it must be some other

    /** @var \Magento\Sales\Model\Order $order */
    $order = $payment->getOrder();
    /**
     * Get All Items of Products
     */
    $productItems = $order->getAllItems() // returning 3 products where I have 2 in cart
    $productItemsTest = $order->getAllVisibleItems(); // returning 3 products where I have 2 in cart


texts: Magento 2 i would like to add a weight unit in grams

texts: As I am new in Magento 2 development I am trying to add a weight unit Grams in weight drop down on product addition page on admin console but I can't get success. Can anyone please help me on this to add a new weight unit Grams?


texts: Adding checkout link to success message list

texts:
I would like to add checkout link to
. I have problem with adding below code to app/code/local/Mage/Core/Block/Messages.php. How could it be done?

<a href="<?php echo Mage::helper('checkout/url')->getCheckoutUrl(); ?>">Checkout


texts: How to add customer prefix option in Magento 1?

texts:
I try to add an option for the "prefix" dropdown in "Customer Information > Addresses > Edit Customer's Address"

Where can I add this new value ?


texts: I'm using Magento 1.9 version and i would like to set the different price per customer. Default magento comes with tier price for a customer group, i want the similar feature to set it for a specific customer. I know there are few paid plugins which achieves what i have asked for(prices are too high), but i want to achieve the same by without using any paid versions. Step by procedure is most welcomed. Thank you in advance


texts: Magento 1.8 order product quantity per 0.1 decimals

texts:
I’m using Magento 1.8 and I am amazed that I cannot get the system to allow orders of 0.1 quantity. I’m building this store to sell fabrics, per 10 cm’s. So that would be 0.1 meters and I do not want the quantity to represent centimeters to avoid long numbers and customers ordering something in 251 cm’s.

I’ve tried the qty_increment field in the Admin > System > Configuration > Inventory but it only accepts full integers.

What I’ve tried so far:

http://www.magentocommerce.com/boards/viewthread/228756/ <- same bug in Magento 1.5 but produces big fat PHP error in 1.8.
think about making all the fabrics a configurable product, but this would mean creating a selection pull down list from 0.1 to 25.0 or so in steps of 0.1 ... very ugly IMHO.

Anybody know how to solve this or is Magento simply not meant for this?


texts: Magento 2 redirects url to https but not admin panel

texts:
I know this question is more about apache config, but it involves Magento too. Currently i have configured my Magento with 2 different URLs,

for port 443 or
https I have an url like this:
https://subdomain.domain.org/

for http i have:
http://subdomain.domain.org/folder

I want to redirect whenever a user types subdomain.domain.org to https://subdomain.domain.org, but if i do this my admin panel redirects there too, i have tried RewriteCond but no one of them worked, my admin panel url is:
http://subdomain.domain.org/folder/admin , this link should not be redirected.

Can someone help me to figure out how to do this?

Thank you!


texts: How can I show the Category Products instead of sub category?

texts:
I need to show the Category products instead of sub category in main navigation dropdown.
For eg:

Men is main category and Tops and Bottoms is sub category, so I have to show the Men category products in dropdown.


texts: How to set two page layout in category page?

texts:
I using a theme in Magento 2.1.7. In my category page I am having 2-column-left layout with this I am getting this look of my category page given in the

Image-1

I want this look in my category page given in Image-2

Where I need to change for this? If I am changing in my 1 column page_layout then it is affecting my home page also. Any Help?


texts:
I attempted to upgrade a theme I had installed in the past.  When the upgrade failed (for whatever reason) I reverted back to a backup.  Though outwardly the site looks fine, when I go into the design options for the theme (Theme Name > Theme Options v1.6 > Design Options), I get these errors:

Fatal error: Call to a member function toOptionArray() on a non-object in /home/be2ue8tp/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 463

Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /home/be2ue8tp/public_html/lib/Varien/Autoload.php on line 93

Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /home/be2ue8tp/public_html/lib/Varien/Autoload.php on line 93

Warning: include() [function.include]: Failed opening 'Mage.php' for inclusion (include_path='/home/be2ue8tp/public_html/app/code/local:/home/be2ue8tp/public_html/app/code/community:/home/be2ue8tp/public_html/app/code/core:/home/be2ue8tp/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/be2ue8tp/public_html/lib/Varien/Autoload.php on line 93

Fatal error: Class 'Mage' not found in /home/be2ue8tp/public_html/app/code/core/Mage/Core/functions.php on line 244

Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /home/be2ue8tp/public_html/lib/Varien/Autoload.php on line 93

Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /home/be2ue8tp/public_html/lib/Varien/Autoload.php on line 93

Warning: include() [function.include]: Failed opening 'Mage.php' for inclusion (include_path='/home/be2ue8tp/public_html/app/code/local:/home/be2ue8tp/public_html/app/code/community:/home/be2ue8tp/public_html/app/code/core:/home/be2ue8tp/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/be2ue8tp/public_html/lib/Varien/Autoload.php on line 93

Fatal error: Class 'Mage' not found in /home/be2ue8tp/public_html/app/code/core/Mage/Core/Model/Resource/Session.php on line 108

I spoke to the developers of the theme and they claim it's magento errors and not their theme. I'm fairly new with Magento so any help would be appreciated.


texts: Magento 1: How to get pending order list outside Magento 1 framework?

texts:
I'm on a mission to list all pending/processing and completed order lists on my external application from a Magento 1 site.

I learnt by using following code I can get all orders from the site. But how do i get order listing based on order status?

require_once 'app/Mage.php';
Mage::app();
$orders = Mage::getResourceModel('sales/order_collection');

foreach ($orders as $order):
    echo $order->getRealOrderId().' - '.$order->getCreatedAtStoreDate().' -
('.$order->formatPrice($order->getGrandTotal()).')<br>';
endforeach;

Thank you,


texts:
Currently I am working on Magento 2

So my Question is

Why wysiwyg editor appends // in script tag? While saving CMS page or CMS block

// are appended after script tag starts and before script tag close

it is continuously appending // while save page or block

Is there any reason of it?
If want to overcome that than how to do that?

EXAMPLE

<script type="text/javascript" xml="space">
// <![CDATA[
//
//
//
   require(['jquery'],function($){
      jQuery(document).ready(function() {
        alert("test")
      });
   });
//
//
//
// ]]></script>


texts: Magento 2.2.4 - Adding 'Declared Value' to UPS Shipping Calculations

texts:
It appears the UPS integration inside Magento 2 does not include the declared value when calculating shipping quotes which can drastically make the quotes way off.

Anyone else experience this and find a way to have this included?

EDIT:

I found this module: https://github.com/xantek/magento2-ups-declared-value

However when DI Compiling, I receive this error;

Xantek\UpsDeclaredValue\Model\Carrier
Incompatible argument type: Required type:
\Magento\Framework\HTTP\ClientFactory. Actual type: array; File:
/app/code/Xantek/UpsDeclaredValue/Model/Carrier.php

Total Errors Count: 1

[Magento\Framework\Validator\Exception]
Error during compilation


texts: Capture error message in custom mddule from helper to controller to admin phtml with ajax call :-)

texts:
in the process of creating a custom module to learn the magento structure but I am stuck in how to handle errors. Well maybe the way I created my module is already off but it works for now. Only want to add some error feedback. So let me explain.

With this tutorial I created my module.

https://www.atwix.com/magento/add-button-to-system-configuration/

So in my adminhtml I have an ajax button calling my controller function check

<script type="text/javascript">
    //<![CDATA[
    function check() {
        new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
            method:     'get',
            onSuccess: function(transport){

            if (transport.responseText){
                alert('Checked')
            }
            }
        });
    }
    //]]>
</script>
<?php echo $this->getButtonHtml() ?>

In my controller file I am calling multiple helper files

public function checkAction()
{
Mage::helper('Module/Copy')->copy();
Mage::helper('Module/Changexml')->changexml();

Example helper file

class Module_module_Helper_Copy extends Mage_Core_Helper_Abstract
{

    public function copy()
    {

    $source = Mage::getBaseDir();
    $dest = Mage::getStoreConfig('Module/module/folder');
    shell_exec("cp -r $source $dest");

    }

What I now want to add is if something goes wrong in my helper function  I actually show that message in the admin through the button.phtml file (first code). The code I added is just an example and in the original tutorial the function was like this

public function checkAction()
{
    $result = 1;
    Mage::app()->getResponse()->setBody($result);

is it even ok to call multiple helper file after each other from an observer file? Sorry for the questions, eager to learn how this should be done.!


texts: How to remove the product price for the order summary section in magento 2

texts:
Only i need to show the number of quantity items in the Order Summary.

if any one know the answer please share the exact code and folder structure. since i'm new to magento.

Any help would be appreciated. Thank you!

Order Summary screenshot:


texts: How to disable Two factor Authentication module in Magento 2.4

texts:
Anyone, please help me with how to disable the Two-factor Authentication module using a command-line.
Thanks.


texts: Observer to fire on customer login Page Url (baseUrl."customer/account/login") magento 2

texts:
I want to fire observer on customer login Page url(baseUrl."customer/account/login") magento 2.

I tried customer_login event but it's firing after customer login.

  etc/events.xml

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

    <event name="customer_login">
        <observer name="redirect_to_ccp_login" instance="Vendor\Module\Observer\RedirectccpLogin" />
    </event>
</config>

  Vendor\Module\Observer\RedirectccpLogin.php

<?php
namespace Vendor\Module\Observer;
use Magento\Framework\Controller\ResultFactory;
class RedirectccpLogin implements \Magento\Framework\Event\ObserverInterface
{
    protected $_logger;
    protected $resultFactory;
    protected $_responseFactory;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
         \Psr\Log\LoggerInterface $logger,
         \Magento\Framework\Controller\ResultFactory $resultFactory,
         \Magento\Framework\App\ResponseFactory $responseFactory
    ) {
        $this->_logger = $logger;
        $this->resultFactory = $resultFactory;
        $this->_responseFactory = $responseFactory;
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $this->_logger->info("ccp customer login fire");

    }

}


texts:
Does Magento have any plugins that would allow me to use FraudTrackr?  Or would that require a custom plugin to be created?

How difficult would this API be to use?  https://www.fraudtrackr.com/developer-api.php


texts:
Hi I have an inline translation which is no longer showing up with a red box around it, and so I am unable to edit the content from the front end.

Inspecting the element it should be held in "mage_catalog" is there a way to go directly into the database and make the amendments?

If not is there a workaround to target this field and change the text.

<span translate="[{
"shown":"

Please call for details
0203 011 1968<\/td><\/tr><\/table><\/div>",
"translated":"

Please call for details
0203 011 1968<\/td><\/tr><\/table><\/div>",
"original":"Out of stock","location":"Span element","scope":"Mage_Catalog"}]">


texts: Magento-2 order is not created after Successful Payment - PayPal

texts:
In my Magento website, Customer has placed an Order, PayPal received the amount with the Magento Order ID. But still, Customer didn't get to reach the Success page. Also that Order not listing at the backend as well.

I have searched about this issue, and some of them faced the same issue, and suggested me to disable  Asynchronous indexing from Stores > Configuration > Advanced > Developer > Grid Settings > Asynchronous indexing.

But I can't get the reason, why the issue happening, at what case, can anyone guide me on this.?

It would be much appreciated.

Thanks in advance.


texts: How can I get the locale inside a requirejs-config file?

texts:
I am trying to add a googlemaps path to my requirejs-config file, but I need to put the locale on the end of the string. Here is what my requirejs-config file looks like. I need a way to get the local in javascript to put on the end of this url.

var config = {
    'map': {
        "*": {
            'googlemaps': '//maps.googleapis.com/maps/api/js?key=mykey&libraries=places&language=' + NEED-LOCAL-HERE
        }
    }
};

I would like to do this inside of //Magento_Checkout/web/template/shipping-address/form.html. This is what I have in that file right now.

<form class="form form-shipping-address" id="co-shipping-form" data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">

            <input type="checkbox" class="checkbox" id="shipping-save-in-address-book" data-bind="checked: saveInAddressBook" />

</form>


texts: How can I move product page swatches after the quantity input and before add to cart button?

texts: I have been trying to move the swatches and can't get them to work inside of the addtocart.phtml. There must be an easier way.