texts: Error with unistalling a theme through Magento-Connect

texts:
Trying to uninstall magento_classic_theme_free, through Magento connect and it is giving me the following error.

"Starting to uninstall community/magento_classic_theme_free
CONNECT ERROR: Failed to delete files: /public_html/a-mag-data/magento/downloader/.././app/design/default/default/layout/tmcore.xml
Check permissions"

And now I can't even get to the front or the back-end. It is showing me
Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

What a nightmare!


texts: How to add a image to a product attribute

texts:
I am trying to use this extension to add a image to a attribute

https://github.com/aligent/magento-attribute-option-image

added attribute 'brands' using the above exstension i set a image per brand

in the sql i got image and thumb column inside of mage_eav_attribute_option that contains a url to the image

how can i display this on the products view page


texts: How to disable the customer frontend in Magento 2?

texts:
My app only uses the Magento 2 REST API and the admin backend. How can I disable the frontend the customer interacts with?

PS:
Seen this post, but it is an older one: Disable admin or frontend route


texts: How to solve image not found or type unknown issue in dompdf in magento 2

texts:
I want to create a pdf file in magento 2.

For that I'm using dompdf from weprovide.

Pdf was generating perfectly but the image was missing. Instead of showing the image it shows an 'Image not found or type unknown'.

I've checked the HTML code that was passed to the dompdf, which has proper image link.

While I'm searching for this issue, somewhere they are mentioned to set options(isRemoteEnabled) for the PDF. Link

So can you help me to solve this issue.

If I want to set options in dom pdf means, how can I integrate that options in weprovide/dompdf code.

Thanks in advance.


texts:
i have custom tempalte. I get template store view in my block.

protected function _prepareLayout()
    {

        $this->getToolbar()->addChild(
            'store_switcher_xanka',
            'Magento\Backend\Block\Store\Switcher',
            [
                'label' => __('Store View:'),
                'template' => 'Magento_Backend::store\switcher.phtml',
                'class' => 'add primary add-design-change'
            ]
        );
        return parent::_prepareLayout();
    }

but when i try call

$section = $this->getRequest()->getParam('section');
 $website = $this->getRequest()->getParam('website');
 $store = $this->getRequest()->getParam('store');

        echo $store; echo $website ;echo $website ;die();

it return nothing. so how do get it. Any help me ? thanks


texts:
we are displaying textfield to enter zip code.

We want to validate with only numbers.

means  it should not allow to enter any alphabets or special charactars.

    <input name="zipcode" size="17" type="text" id="zipcode" value="<?php echo Mage::getModel('core/cookie')->get('zip'); ?>"
maxlength="10" class="input-text" placeholder="<?php echo $this->__('Enter ZIP Code'); ?>"/>
<button type="button" name="zip-check" title="Check" class="button" id="zip-check" ><?php echo $this->__('Check'); ?></button>

i tried pattern="\d{6}" but it did't worked for me.

Edit - checkdelivery.phhtml full code

        <?php $blockLabel = Mage::getStoreConfig('checkdelivery/general/block_title'); ?>
        <?php echo $this->__($blockLabel) ?>

            <input name="zipcode" size="17" type="text" id="zipcode" value="<?php echo Mage::getModel('core/cookie')->get('zip'); ?>"
maxlength="10" class="input-text validate-digits required-entry" placeholder="<?php echo $this->__('Enter ZIP Code'); ?>"/>

<button type="button" name="zip-check" title="Check" class="button" id="zip-check" ><?php echo $this->__('Check'); ?></button>

            <?php $defaultHtml = Mage::getStoreConfig('checkdelivery/general/default_html'); ?>

<?php if(Mage::getModel('core/cookie')->get('message')){
    echo Mage::getModel('core/cookie')->get('message');
}
else{
    $defaultHtml; } ?>


texts: Creating custom html thumbnails for cms pages - i.e. news section using title and a custom field image

texts:
Basically am wondering is if there is a way to use magento as an actual cms system.

i.e. i have an html chunk (static block?!) with some parameters (page_image, pagetitle)

[pagetitle]

I would like to loop through a set of cms pages, and print a thumbnail section with that information.

I am a complete newbie to magento, and i cant figure this out with just the basics i learned through the tutorials xd.

What am actually asking are a few points:

How can i create custom fields for specific cms-pages?
How can i loop through those specific cms-pages and print a thumbnail sort of view

links to tutorials are much appreciated!

Thank you for your patience!


texts:
I am developing a website magento version 1.9 for a client.
it would like to have a different banner per group customers.
for example;
Group 1 customers to slide 1
Group customers 2 to slide 2 etc.

the precision slide is a static block
this is the web site concerned

http://magento.site-en-prod.com/


texts: How can I override magento 2 Model Bundle Indexer Price?

texts:
I'm trying to override magento 2's default bundle indexer price :
Magento\Bundle\Model\ResourceModel\Indexer\Price
I created a module Abc_Bundlecstm with the following di.xml :
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Bundle\Model\ResourceModel\Indexer\Price" type="Abc\Bundlecstm\Model\ResourceModel\Indexer\Price" />
</config>

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

And the following Abc/Bundlecstm/Model/ResourceModel/Indexer/Price.php file:
<?php

namespace Abc\Bundlecstm\Model\ResourceModel\Indexer;

/**
 * Bundle products Price indexer resource model
 *
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class Price extends \Magento\Bundle\Model\ResourceModel\Indexer\Price

I have overwritten the private function "applyFixedBundleSelectionPrice" but even after clearing, activating and registering the module and the cache my model is never used when I run bin/magento indexer:reindex.
What am I doing wrong ?
Thanks !


texts:
when I am going to create order and in payment/review page.
give error message "An error occurred on the server. please try to place order again"
please look image also


texts: Magento 2 multistore url giving 404 error

texts:
I am trying to create a multistore in Magento 2. The base url is something like http://example.com/business/. Now the multi store url needs to be like http://example.com/business/fr/.

I have followed everything like that mentioned in this: http://docs.magento.com/m2/2.1/ee/user_guide/stores/stores-all-create-store.html

Created store view and assigned url in web for that. But its giving 404 error whilst checking.

After digging on web, found that we need to modify index.php like below:

switch($_SERVER['HTTP_HOST']) {

    case 'example.com/business':
         $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'default';
                     $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
    break;

    case 'example.com/business/fr':
         $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'fr';
                     $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
    break;
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);

Still i am getting 404. Can you just point me whats i am doing wrong here. Any kind of help will be much appreciated. Thanks in adv.


texts: How to add product image when creating via rest api?

texts:
This is how I creating product.

{
  "product": {
    "attribute_set_id": 4,
    "type_id": "simple",
    "sku": "B201-SKU",
    "name": "B201",
    "price": 25,
    "status": 1,
    "custom_attributes": {
      "description": "Heavy Duty Brake Cables",
      "meta_description": "Some describing text"
    }
  }
}


texts:
I have developed new Website in Magento 2.2.4 latest version and now trying to migrate data from old website Magento 1.9.3 version.

I have searched on forums and found some links that we can migrate data from Magento to Magento 2.

I have installed default Magento Migration tool "data-migration-tool" with composer.Module is successfully installed but I don't have idea how it will work.

I have read magento guide but I am not getting that where are the settings of databases(magento and Magento2) and how to run Migration tool.

I am following Magento 2 link:

https://devdocs.magento.com/guides/v2.0/migration/migration-migrate-settings.html

Please help me to Migrate data.


texts: Adding a BCC and CC (sales person) to the welcome email Magento 2

texts:
I've edited this function below and i'm overriding this method in app/code/FF/Customer/Model/EmailNotification.php
natively this file exists in vendor/magento/module-customer/Model/EmailNotification.php
/**
 * Send corresponding email template
 *
 * @param CustomerInterface $customer
 * @param string $template configuration path of email template
 * @param string $sender configuration path of email identity
 * @param array $templateParams
 * @param int|null $storeId
 * @param string $email
 * @return void
 * @throws \Magento\Framework\Exception\MailException
 */
private function sendEmailTemplate(
    $customer,
    $template,
    $sender,
    $templateParams = [],
    $storeId = null,
    $email = null
) {
    $templateId = $this->scopeConfig->getValue($template, 'store', $storeId);
    if ($email === null) {
        $email = $customer->getEmail();
    }

    /** @var array $from */
    $from = $this->senderResolver->resolve(
        $this->scopeConfig->getValue($sender, 'store', $storeId),
        $storeId
    );

    $ccEmail   = $this->scopeConfig->getValue('sales_email/order/copy_to', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    $bccEmail  = "myemail@gmail.com";

    $transport = $this->transportBuilder->setTemplateIdentifier($templateId)
        ->setTemplateOptions(['area' => 'frontend', 'store' => $storeId])
        ->setTemplateVars($templateParams)
        ->setFrom($from)
        ->addTo($email, $this->customerViewHelper->getCustomerName($customer))
        ->addCc($ccEmail)
        ->addBcc($bccEmail)
        ->getTransport();

    $transport->sendMessage();
}

I've also created my di.xml file and added this line of code.It resides here: app/code/FF/Customer/etc/di.xml
<preference for="Magento\Customer\Model\EmailNotification" type="FF\Customer\Model\EmailNotification"/>

I'm not sure if there is something i'm still missing but I can't get it to CC or BCC. It sends the welcome email fine like usual but my code is not working.
I can't use a plugin because it's a private method, right? I'm stuck and need some help.


texts:
I have just installed Magento 1.9 on Nginx and Ubuntu.

Everything seems to be working ok however when trying to access /oauth/initiate I am getting an HTTP 401.

I want to view the logs so I can find out more about this issue.

I have enabled the logs in system > configuration > developer however when I checked my webroot/magento/var I had no logs folder.

I created a logs file and put the files system.log and exception.log and chown'd to www-data:www-data and gave them 777 file permissions.

Magento is still not updating these log files.

Can anybody help me find out why I am getting an HTTP 401 when I try and access /oauth/initiate please?


texts: Magento 2 - new vendor package installed - how to call it?

texts:
I have installed via composer the Array2XML package (composer require openlss/lib-array2xml). The package has installed correctly, but my question is how do I now use this in my module (observer)?

I have tried:

<?php
use Openlss\Array2XML;
use Openlss\LSS\Array2XML;
use Openlss\Array2XML\Array2XML;
use Openlss\lib-array2xml\LSS\Array2XML; // this fails due to the hyphen
?>

(and just about every other combination I can think of!)

Each one of these fails with a class not found error.

This is how the package has installed:

This is the composer file that was generated:

{
     "name":                "openlss/lib-array2xml"
    ,"homepage":            "http://openlss.org"
    ,"description":         "Array2XML conversion library credit to lalit.org"
    ,"license":             "Apache-2.0"
    ,"type":                "library"
    ,"keywords": [
         "array"
        ,"xml"
        ,"xml conversion"
        ,"array conversion"
    ]
    ,"authors": [
         {
             "name":        "Bryan Tong"
            ,"email":       "contact@nullivex.com"
            ,"homepage":    "http://bryantong.com"
        }
        ,{
             "name":        "Tony Butler"
            ,"email":       "spudz76@gmail.com"
            ,"homepage":    "http://openlss.org"
        }
    ]
    ,"require": {
        "php":  ">=5.3.2"
    }
    ,"autoload": {
        "psr-0": {
            "LSS": ""
        }
    }
}

I have tried clearing cache, setup:upgrade, deleting var/generation etc but nothing has worked.
Using Magento 2.1.6

Any ideas? Thanks.


texts: magento 2 -how to show date time filter in sales order grid?

texts:
In magento 2 sales order grid default date purchase filter is there, but i want to filter with date and time both. please help me how to do.

I tried like below but i didn't get any solution.

Thanks

<column name="created_at" class="Magento_Ui/Component/Listing/Columns/Date">
<argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="timezone" xsi:type="boolean">false</item>
        <item name="filter" xsi:type="string">dateRange</item>
        <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
        <item name="label" xsi:type="string" translate="true">Created</item>
        <item name="dateFormat" xsi:type="string">MMM d</item>
        <item name="options" xsi:type="array">
        <item name="showsTime" xsi:type="boolean">true</item>
        </item>
    </item>
</argument>


texts: Getting sale price issue of the product in multistore using collection

texts:
I am getting the few product IDs collection using the code

$collection = \Magento\Framework\App\ObjectManager::getInstance()->create('Magento\Catalog\Model\ResourceModel\Product\Collection')->addIdFilter($product_ids)->setStore($this->_storeModelStoreManagerInterface->getStore())->addStoreFilter()->addAttributeToSelect($this->getUsedMagentoAttributes())->setStoreId($this->_storeModelStoreManagerInterface->getStore()->getId());

And for getting the start price of configurable product, I am using the code as

$parent->getPriceInfo()->getPrice('final_price')->getAmount() ->getValue(\Magento\Tax\Pricing\Adjustment::ADJUSTMENT_CODE);

This works when there is only one store.

But If I put the above price getting code in the multi-website loop while using the collection, I am not able to get the right prices for all the stores.


texts:
Please help me to setup a cron job to send newsletter in magento 2.1.6. Currently i'm not able to send newsletters to the subscribers. So i need to setup Cron job and check it out.

Thanks


texts: Custom module controller not working magento2

texts:
I have added a sample custom module in Magento 2. I have two controller function for admin panel page,

http://127.0.0.1/magento2/admin_magento2/sample/index/index/
http://127.0.0.1/magento2/admin_magento2/sample/sampletwo/index/

First url only display page. The second one displays 404 or redirecting to dashboard.

Please help me someone to solve this.

Note

I have added admin panel menu for first url only.

app\code\Test\Sample\Controller\Adminhtml\Index\Index.php

namespace Test\Sample\Controller\Adminhtml\Index;
class Index extends \Magento\Backend\App\Action
{
    public function execute()
    {
        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();
    }
}

app\code\Test\Sample\Controller\Adminhtml\Sampletwo\Index.php

namespace Test\Sample\Controller\Adminhtml\Sampletwo;
class Index extends \Magento\Backend\App\Action
{
    public function execute()
    {
        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();
    }
}

app\code\Test\Sample\etc\adminhtml\menu.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
    <menu>
        <add id="Test_Sample::parent" title="Sample" module="Test_Sample" sortOrder="100" resource="Test_Sample::parent"/>
        <add id="Test_Sample::index" title="Sample Index" module="Test_Sample" sortOrder="10" action="sample/index" resource="Test_Sample::index" parent="Test_Sample::parent"/>
    </menu>
</config>

app\code\Test\Sample\etc\adminhtml\routes.xml

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


texts: Magento1 to Magento2 Configurable product issue

texts:
I have import Magento1 to Magento2 Configurable product but Configurable product fronted out of stock display and not show associated simple product.

Associated simple product also qty.

How to resolve it?


texts: Magento 2 - How can I write query in Magento

texts:
I have a SQL query that joins two tables.

  SELECT ot.name, org.name from ayakil_organization as org INNER JOIN
  ayakil_organization_type as ot ON org.type_id = ot.type_id ORDER BY
  ot.name ASC

Here ayakil_organization, ayakil_organization_type are two tables.

my resolver class is like below.

$collection = $this->_organizationFactory->create()->getCollection();
$collection->getCollection()->getSelect()
            ->join(
                ['ot' => 'e25_organization_type'],
                'main_table.type_id = ot.type_id',
                array("*")
            )
            ->setOrder('ot.name','ASC');

If i use the collection query like this, i am getting an error.Can anyone help me?


texts: Get Downloable product list array in .phtml file

texts:
I need to display downloadable products on the customer account page.
I create one tab after the order tab on the customer account page.
I want to get customer ordered product list in this page.
I create a custom block and I wrote all queries and I want to get product collection and customer it inside the .phtml file.
<?php
namespace Vendor\Module\Block;
use Magento\Downloadable\Api\Data\LinkInterface;
use Magento\Downloadable\Api\LinkRepositoryInterface;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
class CustomTabs extends \Magento\Framework\View\Element\Template
{

    /**
     * @var array
     */
    private $data;
    /**
     * @var Context
     */
    private $context;

    /**
     * @var Session
     */
    protected $customer;

    /**
     * @var CollectionFactory
     */
    private $_orderCollectionFactory;

    protected $_productRepository;

    public function __construct(
        \Magento\Customer\Model\Session $customer,
        LinkRepositoryInterface $linkRepository,
        CollectionFactory $orderCollectionFactory,
        \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
        \Magento\Framework\View\Element\Template\Context $context,
        array $data = []
        )
    {

        parent::__construct($context, $data);
        $this->linkRepository = $linkRepository;
        $this->_orderCollectionFactory = $orderCollectionFactory;
        $this->_productRepository = $productRepository;
        $this->customer = $customer;
    }

    /**
     * Get list of links of Downloadable Product.
     *
     *
     * @return LinkInterface[]
     */

    public function getCustomerData(){
       $data = [];
       $dataitem = [];
        $customer = $this->customer;
        $customerId = $customer->getId();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

        $orders = $this->_orderCollectionFactory->create()
            ->addFieldToFilter('customer_id', $customerId)->addAttributeToSelect('entity_id');
         foreach($orders as $order){
            $orderId = $order->getId();

            $order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId);
            $orderItemsCollection = $order->getAllVisibleItems();

            foreach ($orderItemsCollection as $item){
               $productId = $item['product_id'];
              $productdata = $this->_productRepository->getById($productId);

                    foreach($productdata as $product){
                        $sku = $product['sku'];
                           $data[] = $product['sku'];
                        $downloadableLink = $this->linkRepository->getList($sku);
                        foreach ($downloadableLink as $link ) {
                           //echo "<pre>"; var_dump($link->getData());
                              $data[] = $link->debug();

                             //$data[$key]["downloadablelinks"]= $link['id'];
                        }

                   }

            }
         }

    return $data;
}

}

I get the last foreach loop data but the way I get it's totally wrong. can someone please give the suggestion to how I can get it. the product collection and order collection in my .phtml file.


texts:
I would like to implement the Google One Tap Login on my website but its not working.
I have followed the below guide for Google One Tap Login:
https://developers.google.com/identity/one-tap/web/guides/get-google-api-clientid
To Implement it in Magento, I have followed the below guide:
How can I login my website with Google Account?
But nothing works. Can anyone please guide me to implement the Google One Tap?


texts: Tracking info empty in shipment email in Magento 2

texts:
I have created a shipment by adding Tacking info. I am getting the shipment email with empty Tacking info.
Next time if i click on "send Tracking Information. Then I will get the tracking info in shipment email.
My Magento version is 2.3.5
here is the screenshot of shipment email

I need to get this info during shipment creation.
Hopefully its because i used this event to send shipment email automatically whenever the shipment is created.
Vendor/Module/etc/events.xml
<event name="sales_order_shipment_save_after">
    <observer name="sales_order_shipment_after"
              instance="Vendor\Module\Observer\SalesOrderShipmentAfter" />
</event>

Vendor/Module/Observer/SalesOrderShipmentAfter.php
use Magento\Framework\Event\ObserverInterface;
class SalesOrderShipmentAfter implements ObserverInterface
{
    protected $shipmentNotifier;
    protected $_logger;
    public function __construct(
    \Psr\Log\LoggerInterface $logger,
    \Magento\Shipping\Model\ShipmentNotifier $shipmentNotifier
) {
    $this->_logger = $logger;
    $this->shipmentNotifier = $shipmentNotifier;
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
    try{
        $this->_logger->info('inside shipment observer');
        $shipment = $observer->getEvent()->getShipment();
        $this->shipmentNotifier->notify($shipment);
        //$shipment->save();
    }catch (\Exception $e) {
        $this->_logger->info('--shipment observer--'.$e->getMessage());
    }
  }
}

Can anyone please help me on this. Thanks


texts: Magento 2: What is the purpose of breadcrumbs in the backend?

texts:
I'm curious if anyone has some insight. In the Magento 2 admin, as with Magento 1.x, breadcrumbs are not displayed on admin pages despite methods being available to add them via blocks/controllers.

In Magento 2 backend controllers extends Magento\Backend\App\Action which includes the method _addBreadcrumb. I have seen use of the method in many tutorials as if using it when developing a custom module should be a foregone conclusion. However, I cannot find a single admin panel that renders out breadcrumbs in any manner.

So what's the point of this? Are breadcrumbs used in the admin in some hidden manner I am not aware of? Is it, like I suspect, a common feature they just add to controller relevant classes yet will not be used in the admin unless a developer modifies admin templates? Am I going to get downvoted because I'm asking a dumb question?

I just find it strange that something so commonly referenced is not used by its own developers.


texts: How to Hide Configurable Dropdown when Apply MAP is Set to "Yes"?

texts:
Our site is programmed to show "Call for Price" when Apply MAP is set to "Yes". This is not an issue with simple products but with configurables it still shows the dropdown. We would like to "Hide" the entire dropdown when Apply MAP is set to "Yes" for Configurables. How do you achieve this? I have been looking at these two files.

frontend/package/theme/template/catalog/product/price_msrp_item.phtml
frontend/package/theme/template/catalog/product/view/type/options/configurable.phtml

*Note: Removing associated products is not a solution because doing so removes the Configurable Product from the Catalog.


texts: Magento 2 : How to remove the existing company admin grid columns from export option?

texts: In Customers->Company Admin Grid, I want to remove few columns from export data : "company_legal_name", "gender" etc. How do I do that?


texts: Get specific categories Name and URL to it

texts: In the home page of my Magento store I have created a featured category section where I have placed a button with drop down where I would like to list any specific categories name and link as a drop down list with the help of category id (Get only the category name and link to it those IDs are specified, not the sub-categories of it). How do I accomplish it in a .phtml file? Very new to magento so every help will be a lot for me.


texts:
when i after installing magento try goto CMS->Pages - i see 404 error, when i try found solution via mysql, also not working, i use this query:

DELETE FROM cms_page_store WHERE store_id NOT IN (SELECT store_id FROM core_store);

not working

can you help me with solutions?
Thanks


texts: Magento 2 - custom price can not add to subtotal and grand total after add to cart

texts:
I want to add custom price for bundle products after adding to cart. I have used "checkout_cart_product_add_after" observer to do so. But it is adding custom price to product price, not in sub total and grand total.
Following is my code:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <!-- Event for add to cart -->
    <event name="checkout_cart_product_add_after">
        <observer name="customprice_observer_set_price_for_item_add" instance="Custom\Shop\Model\Observer\SetPriceForItem"/>
    </event>
</config>

Observer class:

namespace Custom\Shop\Model\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Catalog\Model\Product\Type;

class SetPriceForItem implements ObserverInterface
{
     public function execute(Observer $observer)
     {
        $item = $observer->getEvent()->getQuoteItem();
        if ($item->getProduct()->getTypeId() == Type::TYPE_BUNDLE) {
            foreach ($item->getQuote()->getAllItems() as $bundleitems) {
                if ($bundleitems->getProduct()->getTypeId() == Type::TYPE_BUNDLE) {
                    $bundle_price = $bundleitems->getProduct()->getFinalPrice();
                    $fee = $bundleitems->getProduct()->getBuildInFee();
                    $final_price = $bundle_price + $fee;
                    $bundleitems->setCustomPrice($final_price);
                    $bundleitems->setOriginalCustomPrice($final_price);
                }
            }

            $item->getProduct()->setIsSuperMode(true);
        }
        return $this;
     }
}

  Is there anyone who can help me? Price is not adding to subtotal and
  grand total.

Following is the cart item, subtotal and grand total.

Any help???


texts:
I have a contact form on my website (https://www.clay-and-paint.com). Before it works normally, I received emails from customers but now (I have an https) it doesn't work anymore.

I have a 404 error.

My code on my CMS page contact is:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

My code on my form.phml is:

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>

<?php echo Mage::helper('contacts')->__('Contact Us') ?>

<?php
   $url = Mage::getUrl();
   if(isset($_SERVER['HTTPS']))
   {
    $url = str_replace ('http://', 'https://', $url);
   }
?>
<form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">

<?php echo Mage::helper('contacts')->__('Contact Information') ?>

...

<?php echo Mage::helper('contacts')->__('* Required Fields') ?>

        <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
        <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><?php echo Mage::helper('contacts')->__('Submit') ?></button>

</form>

For the

<form action="<?php echo $this->getUrl('contacts/index/post', array('_secure'=>true)) ?>

or:

<form action="https://www.clay-and-paint.com/index.php/contacts/index/post/" id="contactForm" method="post">

But it always returns me an 404 error.

Thank for your help.

Warui

PROBLEM SOLVED! I've made a mistake on my config.xml.


texts: Create custom avatar attribute on registration page

texts:
How can I add customer image as an avatar to be shown in customer profile.
So user can add his image from registration page.


texts: Double frontend cookies causing intermittent login issues

texts:
The site runs Magento CE 1.7.0.2.

Customers have been reporting issues with logging in. I've been able to replicate this myself on Safari only (do not know the exact steps to replicate yet though).

Somehow, 2 frontend cookies generated (this is not the issue):

frontend    fs66qk6lbfjriuf873mrbdk199  .www.foobar.com /   8 March 2014 4:34:40 pm AEDT    34 B
frontend    fs66qk6lbfjriuf873mrbdk199  www.foobar.com  /   8 March 2014 4:34:40 pm AEDT    34 B

The above is no issue, and you can still login on the frontend with the above cookies. However, sometimes the cookies look like:

frontend    deleted .www.foobar.com /   8 March 2014 4:34:40 pm AEDT    34 B
frontend    fs66qk6lbfjriuf873mrbdk199  www.foobar.com  /   8 March 2014 4:34:40 pm AEDT    34 B

The above definitely causes issues and I am not able to login.

Under System >> Config >> Web:

Cookie Lifetime: 86400
Cookie Path: /
Cookie Domain: (blank)
Use HTTP Only: No
Cookie Restriction Mode: No

Should I be setting a Cookie Domain? The symptom that the customer sees is just being redirected to the login page with no errors.


texts: How can I set configuration values in Magento 2?

texts:
Previously (in Magento 1, that is) we created a module called Setup which contained setting for the site. The upgrade scripts looks something like this:

$installer = $this;
$installer->startSetup();
$installer->setConfigData("fastsimpleimport/general/partial_indexing", 1);
$installer->setConfigData("fastsimpleimport/product/disable_preprocess_images", 1);
$installer->setConfigData('general/country/default', 'GB');
$installer->setConfigData('general/locale/firstday', 1);
$installer->setConfigData('general/locale/timezone', 'Europe/London');
$installer->setConfigData('general/store_information/merchant_country', 'GB');
$installer->setConfigData('design/header/welcome', 'Enter your value');
$installer->setConfigData('design/head/title_suffix', 'Enter your value');
$installer->setConfigData('currency/options/base', 'GBP');
$installer->setConfigData('currency/options/default', 'GBP');
// ...

I can't figure out how to do the above in M2.

In other words: How do I go about setting config data in M2?


texts: I encountered an error while trying to move MAgento website from FTP to localhost on WAMP

texts:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'XXX.tag_summary' doesn't exist, query was: SELECT tag_summary.popularity, tag.* FROM tag_summary
 INNER JOIN tag ON tag.tag_id = tag_summary.tag_id AND tag.status = 1 WHERE (tag_summary.store_id = '1') AND (tag_summary.products > 0) ORDER BY popularity DESC LIMIT 20


texts: Disable auto invoice paypal express checkout

texts:
I Need to stop automatic invoices with PayPal express checkout. I just edited files:

app/code/Mage/Sales/Model/Order/Payment.php

and

app/code/core/Mage/PayPal/Model/Ipn.php

but problem persist.

When a customer create a new order and the payment is captured, the order status change in ORDER and INVOICED, but I need to create invoice only after shipping.

I also tested extension "Disable automatic generation of invoice" but the issue remains.

Can I disable auto invoice with PayPal Express Checkout? My version is 1.8.1 and with standard PayPal there is no problem.

Thank you


texts: How Can I Retrieve the Product Image Absolute Path

texts:
How can I pull the product image absolute path in a product?

This returns the product along with the URL:

Mage::helper('catalog/image')->init($_item, 'small_image')->resize(160, 128)

But I needed to access this the _newFile from this object:

    object(Mage_Catalog_Helper_Image)#3877 (14) {
  ["_model":protected] => object(Mage_Catalog_Model_Product_Image)#3876 (34) {
    ["_width":protected] => int(160)
    ["_height":protected] => int(128)
    ["_quality":protected] => int(90)
    ["_keepAspectRatio":protected] => bool(true)
    ["_keepFrame":protected] => bool(true)
    ["_keepTransparency":protected] => bool(true)
    ["_constrainOnly":protected] => bool(false)
    ["_backgroundColor":protected] => array(3) {
      [0] => int(255)
      [1] => int(255)
      [2] => int(255)
    }
    ["_baseFile":protected] => string(90) "/file/path/media/catalog/product/V/V/123.jpg"
    ["_isBaseFilePlaceholder":protected] => bool(false)
    ["_newFile":protected] => string(151) "/file/path/media/catalog/product/cache/6/small_image/160x128/9df78eab33525d08d6e5fb8d27136e95/V/V/VV123.jpg"

Thank you!


texts:
When I have one, more or all child products of a grouped product with currently active special prices I'd like to see a 'sale' note in my frontend.

For simple products I do this in my template by

if ($_product->getFinalPrice() != $_product->getPrice()) { ... }

However a grouped product has no own price and I kind of fail trying to iterate over its child product in the template (I encountered errors, getPrice() didn't work on the child products as it seemed they weren't fully loaded or it took enormously long to load)...

So what would be a working and efficient way to do it (ideally starting only from the ID of the grouped product in the template)?


texts:
I am getting this error when trying to load the homepage of the website:

  a:4:{i:0;s:37:"Object DOMDocument should be created.";i:1;s:13313:"#0 /var/www/vhosts/fakedomain.com/httpdocs/vendor/magento/framework/View/Element/UiComponent/Config/Reader.php(95): Magento\Framework\View\Element\UiComponent\Config\DomMerger->getDom()

any idea whats wrong or how to get around this?


texts:
I have a problem with my site. When i select a swatch on mobile, the price of the product doesn't change. This is only a problem on the mobile version of the site and not present on the desktop version.

I get the following error:
cannot call methods on priceBox prior to initialization; attempted to call method 'option'


texts: How to select a shipping method if the default address is present in checkout page in Magento 2?

texts:
I need to select the first method rendering in the list as the default selected among the shipping methods in the checkout page for a customer whose default shipping address is pre-populated in the checkout page.

How can we achieve this?


texts: Access the Product Grid Collection from the Product Edit Page

texts:
I'm trying to access the product grid collection from the product edit page, so that I can find where this currently edited product resides in the product grid collection. Ultimately, I want to provide a previous and next button on the edit page. Here is what I have so far:

<?php

class Tloc_Test_Block_Adminhtml_Catalog_Product_Edit extends Mage_Adminhtml_Block_Catalog_Product_Edit {
    protected function _prepareLayout() {
        parent::_prepareLayout();

        /*
         * Get the product_filter param directly from the session
         */
        $session = Mage::getSingleton('adminhtml/session');
        $gridFilterParams = $session->getData('productGridproduct_filter');

        if (!empty($gridFilterParams)) {
            $decodedParams = base64_decode($gridFilterParams);
            if (!empty($decodedParams)) {
                parse_str($decodedParams, $params);
                Zend_Debug::dump($params);
            }
        }

        /*
         * Get the product_filter param through the Widget_Grid block.
         */
        /** @var Mage_Adminhtml_Block_Widget_Grid $gridBlock */
        $gridBlock = Mage::getSingleton('core/layout')->createBlock('adminhtml/widget_grid');
        $gridBlock->setId('productGrid');
        $gridBlock->setSaveParametersInSession(true);
        $gridFilterParams = $gridBlock->getParam('product_filter');

        if (!empty($gridFilterParams)) {
            $decodedParams = base64_decode($gridFilterParams);
            if (!empty($decodedParams)) {
                parse_str($decodedParams, $params);
                Zend_Debug::dump($params);
            }
        }

        die('stop');

        return $this;
    }
}

Both methods of setting $gridFilterParams work, but ideally I would like to use the built-in block class.

What I want to do at this point is turn the params that I have into filters on a collection. My first choice would be to have Mage_Adminhtml_Block_Widget_Grid do this, but I have two problems: 1) I would first need to add Columns to the class, and I'm not sure how to do that, and 2) I'm up against a number of protected methods.

I could use a bit more of a manual approach and build a new collection myself, and use addAttributeToFilter to filter the collection, but I'm not sure how well that's going to work with custom grid columns that other modules have added.

Any one have any thoughts?


texts:
I am trying to add a custom link(contact us) in navbar menu and wanted to add the contact us page link.
how to add that?


texts: How to get only disabled product in Magento 2 Controller?

texts:
How to get only disabled product In Controller I have getting all the products
<?php
namespace Mageplaza\HelloWorld\Controller\Index;

use Magento\Catalog\Model\Product\Attribute\Source\Status;
use Magento\Catalog\Model\ResourceModel\Product\Action;

class Index extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
private $scopeConfig;
protected $_productCollectionFactory;
private $productAction;

public function __construct(
Action $productAction,
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Framework\View\Result\PageFactory $pageFactory,
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
){
$this->productAction = $productAction;
$this->_pageFactory = $pageFactory;
$this->scopeConfig = $scopeConfig;
$this->_productCollectionFactory = $productCollectionFactory;
return parent::__construct($context);
}

public function execute()
{
$product_ids = [];

$onlydisproduct = $this->_productCollectionFactory->create();
$onlydisproduct->addAttributeToSelect('*');
$onlydisproduct->setFlag('has_stock_status_filter', false);
foreach ($onlydisproduct as $key => $value) {
    $product_ids[] = $value->getId();
}
//print_r($product_ids);

die('aaaa');
//return $this->_pageFactory->create();
}
}

Product Screenshot

I am applying $onlydisproduct->setFlag('has_stock_status_filter', false); but still getting all products.


texts:
we have upgraded a very buggy Magento 2.1.9 website to Magento 2.4.1 and are about to launch the new website. It's taken a few months to upgrade and build a new theme. but obviously the orders are now out of synch.
How can I migrate the orders from the 2.1.9 live site to the new 2.4.1 development site?
(I did look at the Aitoc import/export order extension, but the tech support guys were awful and after a month of them ignoring an installation issue, I have to start from scratch again).


texts: I need to add space between Price and "Rs"

texts:
I try to find the phtml file to add space between price and currency "Rs".

But haven't found in final_price.phtml.

Any help would be appreciated.


texts: Create Observer to set session before site loads

texts:
I have created a new module :

 <?xml version="1.0"?>
 <config>
 <modules>
   <Net_Customobservers>
       <active>true</active>
      <codePool>local</codePool>
      <version>0.0.1</version>
     </Net_Customobservers>
 </modules>
 </config>

In app\local\Net\Customobserver\etc\config.xml :

<?xml version="1.0"?>
<config>
<modules>
<Net_Customobservers>
  <version>0.0.1</version>
</Net_Customobservers>
 </modules>
    <global>
      <events>
    <controller_front_send_response_before>
        <observers>
            <custom_observer>
                <class>customobservers/observer</class>
                <method>setUsertype</method>
            </custom_observer>
        </observers>
      </controller_front_send_response_before>
       </events>

      </global>
     </config>

In app\local\Net\Customobserver\model\Observer.php :

  class Customobservers_Model_Observer
 {
   public function setUsertype($observer = null)
   {
    echo '1';
   }
 }

I need to set session in this method to set usertyp, but it doesn't come here though Module is enabled.


texts: How to add custom link in main menu in Magento 2?

texts:
I want to add CMS pages and Contact page link in the main menu.

How to add these links in the main menu and their submenu as well?


texts: Admin URL and DB config for development area

texts:
I recently created a Development/Staging copy of my site/database and everything seems to be working correctly on the front end. So when I visit dev.mysite.com I am able to browse my store and it stays on dev.mysite.com.

But when I try to login/access the admin area at dev.mysite.com/admin/ it keeps redirecting me to www.mysite.com/admin/

I updated my core_config_data table in the Dev DB for both secure and insecure url's to dev.mysite.com/. I know that the front end is using the dev DB because I update my local.xml.

I can actually access dev.mysite.com/index.php/admin/system_config/edit/section/web/... but i have to manually change the URL in the address bar. When I click around the admin area it always sends me back to www

I am also noticing that in the Dev Admin when i navigate to System>Configuration>Web>Base URL it is still showing www.mysite.com/ which is leading me to believe that the Dev admin area is still using the Production DB and not the Dev DB.

Is there some sort of caching or setting(s) that I am not aware of?

Please help. Thanks.


texts: Order - Sale related email not going in Magento 2.2.7

texts:
Recently I did following task on a Magento Store:

Upgrade from 2.2.6 to 2.2.7 - After upgrade, everything was working fine.
Chanaged server to higher configuration - shared hosting to shared hosting.

Order confirmation mails stopped after server move. To test I registered a dummy user and got the welcome email.

There was some cron related issue. which i discussed and implemented as per my other question. Error in Cron with Directoy list - Magento 2.2.7

Below is the current cron setting. When cron was created using Magento SSH command, cron run time was all (*). Now its changed to */15 - by it self - not changed by me.

I checked many previous answers but, most of the answers suggest some code change. I am a not technical person. Since emails were going out on previous host, I feel this is a some setting related issue.

Please guide.

Thanks,
Niraj


texts: Magento 2.3.x Checkout problem Safari browser - blank page

texts:
we are facing a strange behavior using Magento 2.3.x (now 2.3.3 but also with Magento 2.3.1 the same error occured.

Problem is, that clients using SAFARI browser get a blank page during checkout. Footer and header remain normal but checkout page gets blank.

Something seems not to work properly. Safari here not in private mode. All other browser seem to work fine and without problem.

Does anyone have a clue why this happens possibly, or where to look for the bug?

Thanks in advance and Regards.


texts: How to improve reindexing magento 2.3.3 [EE]?

texts:
How to improve reindexing Magento 2.3.3 [EE]?
60K products
It takes around 20min to reindex full.
Thanks


texts: Configurable Product Sold Out - Showing in stock / Add to Cart and Drop Down Blank

texts:
We have set a configurable product and it has sizes below.

When all sizes are sold out the add to cart is still present and the drop down for size is visible with no item i.e small

The product also shows "in stock" which is wrong


texts: Magento2 : How to use default captcha code in footer newsletter?

texts: How to validate user entered captcha and image captcha validation.


texts: Magento: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

texts:
I have Configured Magento With Valid Credentials. But, it shows SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
.
I have Cleared Cache(Deleted var Folder).

Cross Checked app/etc/local.xml

Gave 777 Permission to root folder.

I Checked by Renamed/Deleted app/etc/local.xml still it shows the same Error.


texts: How to set special price for specific customer group

texts: Guys I'm wondering how to add special price for specific customer group? For example, I have a group called "VIP", I want to set 10% discount on every product for this specified group only. Thank you in advance.


texts:
How do you set the alignment for a grid header (th) element when implementing ui-component? We can set the "fieldClass" config option to center the column contents (td), but there's nothing to indicate how to set the column's header to match.
<column name="field">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            ...
            <item name="fieldClass" xsi:type="string">a-center</item>
            ...
        </item>
    </argument>
</column>


texts: Magento addAttrtibuteToFilter() not working

texts:
OK, so I'm in the related.phtml page and I'm trying to load in the realeted products only those who are in stock. So there was this code already in the page:

$productCollection = Mage::getResourceModel('catalog/product_collection')
       ->addCategoryFilter($category)
       ->setCurPage(0)
       ->addAttributeToSelect('*') // add all attributes - optional
       ->addAttributeToFilter('status', 1) // enabled
       ->addAttributeToFilter('visibility', 4)
       ->setPageSize(4);

and I want to filter with the products that are in stock. So I'm adding another one filter in the code:

$productCollection = Mage::getResourceModel('catalog/product_collection')
         ->addCategoryFilter($category)
         ->setCurPage(0)
         ->addAttributeToSelect('*') // add all attributes - optional
         ->addAttributeToFilter('status', 1) // enabled
         ->addAttributeToFilter('visibility', 4)
         ->joinField('qty',
             'cataloginventory/stock_item',
             'qty',
             'product_id=entity_id',
             '{{table}}.stock_id=1',
             'left')
         ->setPageSize(4);

but it still brings me products that are out of stock. I also try this:

$productCollection = Mage::getResourceModel('catalog/product_collection')
      ->addCategoryFilter($category)
      ->setCurPage(0)
      ->addAttributeToSelect('*') // add all attributes - optional
      ->addAttributeToFilter('status', 1) // enabled
      ->addAttributeToFilter('visibility', 4)
     ->addAttributeToFilter('is_in_stock', array('eq' => '1'))
     ->setPageSize(4);

but I still get product that are out of stock. What is wrong with the code?

Thank you

EDIT: I've also set the Display out of stock products to No in the Admin Panel in Catalog->Inventory


texts: How to get json data on frontend in magento

texts:
I have a custom module, which uses for email varification in frontend of magento. This module will appear as a popup in homepage while it loads. I want to do  some other functionings such as display register form etc. in the same popup section, according to the output obtain from this email varification form...

Email varification happens in controller and it look like this

class Realuk_Login_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{

    $this->loadLayout();
    $this->renderLayout();
}
public function loginAction()
{
    $session = Mage::getSingleton('customer/session');
    //check whether session exist or not
    if ($session->isLoggedIn())
    {
        return;
    }

    $result=array('error'=>'noError','success'=>false);
            /*
                email varification code comes here; according to this section
                $array will set;

            */
            //json encoding happens here
            $jsonData=$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); /
    $this->_redirect('home'); //this is my home page redirection
}
}

my frontend file that render popup section contains this code..

<?php
       $array = Mage::helper('core')->jsonDecode($jsonData);
       if(!empty($array))
       {
            echo "<pre>";
            print_r($array);
            echo "</pre>";
       }
       else
       {
            echo "no json data exists";
       }
 ?>

It seems that $array is empty every time in frontend. However in controller $jsonData posses some values. My url look likes www.mydomain.com/home/ and no json value can see there

My question is..

1)Is this the proper way to get results from controller to frontend?

2)How to accomplish json decoding in frontend phtml file ?

Please share your thoughts.. It will help me and others also.

Thanks in advance


texts: Magento 2: What's the `page_layout` folder for?

texts:
In addition to containing familiar folders like layout, and templates, a Magento 2 module's view folder also contains a page_layout sub-folder.

view/adminhtml/page_layout
view/frontend/page_layout

What is this folder for?  How would I, as a Magento module developer, use this folder?  Or is this something reserved for core Magento modules that has no functionality exposed for third party developers?


texts: What to do against the latest vulnerability: stolen credit card data?

texts:
After the news came out a few days ago, I haven't heard much - and no official statement - about the newest vulnerability. Sucuri says that it is possible to receive credit card information, or even all $_POST-data including admin-passwords and the like.

I have not had yet a case where a client was hacked, but don't want to wait until this happens to take action. Has anyone seen a patch yet?


texts: Magento 2 : Newsletter Subscription Event

texts:
Is there an event in Magento 2 for Newsletter Subscription from the Profile page?

How do I find out when a user updates their newsletter subscription preference from this page?


texts: Magento 2 javascript plugin after method is executed in wrong time

texts:
Following this post answer I have used mixins of shipping.js file to change the result of validateShippingInformation method. My requirers-config.js file is:

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/view/shipping': {
                'Vendor_checkoutShipping/js/shipping-method-mixin': true
            }
        }
    }};

and shipping-method-mixin.js file:

define([
'jquery',
'mage/utils/wrapper',], function ($, wrapper) {
'use strict';

return function (shipping) {

    var newMethod = wrapper.wrap(shipping.validateShippingInformation, function (originalFunction) {
        var result = originalFunction();
        return after(result);
    });
    console.log(newMethod);
    shipping.validateShippingInformation = newMethod;

    return shipping;
};});

Problem I have: The file is read by browser when page is loaded (identified by breakpoints) and right then executed. But the method in original file that i tray to extend by using after method is executed by button click in front-end (why is the file not running after the original method is executed). I do not need the script I added to run when the page is loading(reloaded) and I do not want to override the original javaScript file.

I need to change validateShippingInformation value before the method setShippingInformation if sentence is being executed. The if sentence in shipping.js file is:

if (this.validateShippingInformation()) {.(I need to allow or disallow this code to run based on my additional logic. How can i do it?).}


texts: How to add a multiselect field to system config field table?

texts:
I want to add a table to a config section, where one column is a multiselect field.

Code is simliar to https://www.integer-net.com/how-to-create-tables-in-magento-system-configuration/, but Magento only supports select (not multiselect) fields.

Similar to this, just add mutliselect field instead of text field

Any ideas how to solve it?

Btw ... I'm pretty sure that a working solution was already posted at github/gist a long time ago as a Hackathon project, but I can't find it anymore ...


texts: Change product tabs expand/collapse icons

texts:
I want to change the expand / collapse icons of the product tab from @icon-up / @icon-down to @icon-expand / @icon-collapse (mobile view). I changed the mage-init and added the icons options like written in the docs. The new icons just got added as a span, but they did not replace the up/down icons. After that I looked for the classed in my _extend.less and _theme.less (luma) but the only thing I found was a class named .abs-toggling-title which is not used by the tabs. I don't understand why the tabs are not overwritten.

 <div class="product data items the-grid-pda-col-1"
         data-mage-init='
         {
            "tabs":{
                "openedState":"active",
                "active":"false",
                "icons": {
                    "header": "ico-expand",
                    "activeHeader": "ico-collapse"
                    }
            }
         }
        '
    >

The ico-expand and ico-collapse in mage-init are classes which are adding a svg via the icon lib.


texts: Extending bundle product in custom type ends up without "add option" button

texts:
I need a custom product type to be able to use other transaction mail templates.
For that purpose I am using an existing module which contains the following code:

<vendor>/<module>/etc/product_types.xml:

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
        <type name="customtype" label="Custom Product Type" modelInstance="<vendor>\<module>\Model\Product\Type\Custom" composite="true" indexPriority="110" sortOrder="110">
            <priceModel instance="Magento\Bundle\Model\Product\Price" />
            <indexerModel instance="Magento\Bundle\Model\ResourceModel\Indexer\Price" />
            <stockIndexerModel instance="Magento\Bundle\Model\ResourceModel\Indexer\Stock" />
            <allowedSelectionTypes>
                <type name="simple" />
                <type name="virtual" />
            </allowedSelectionTypes>
            <customAttributes>
                <attribute name="refundable" value="true"/>
            </customAttributes>
        </type>
    </config>

<vendor>/<module>/Model/Product/Type/Custom.php:

<?php

namespace <vendor>\<model>\Model\Product\Type;

class Custom extends \Magento\Bundle\Model\Product\Type
{
    const TYPE_ID = 'customtype';
}

<vendor>/<module>/Setup/UpgradeData.php:

<?php
namespace <vendor>\<module>/Setup;

use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Eav\Setup\EavSetup;
use Magento\Catalog\Model\Product;
use <vendor>\<module>\Model\Product\Type\Custom as CustomProductType;

/**
 * Upgrade Data script
 * @codeCoverageIgnore
 */
class UpgradeData implements UpgradeDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;

    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        if (version_compare($context->getVersion(), '0.0.6') < 0) {
            /** Version under 0.0.6 -> Upgrade */
            $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

            $fieldList = [
                'price',
                'special_price',
                'special_from_date',
                'special_to_date',
                'minimal_price',
                'cost',
                'tier_price',
                'weight',
                'price_type',
                'sku_type',
                'weight_type',
                'price_view',
                'shipment_type',
                'tax_class_id',
            ];

            foreach ($fieldList as $field) {
                $applyTo = explode(
                    ',',
                    $eavSetup->getAttribute(Product::ENTITY, $field, 'apply_to')
                );
                if (!in_array(CustomProductType::TYPE_ID, $applyTo)) {
                    $applyTo[] = CustomProductType::TYPE_ID;
                    $eavSetup->updateAttribute(
                        Product::ENTITY,
                        $field,
                        'apply_to',
                        implode(',', $applyTo)
                    );
                }
            }
        }
    }
}

The Upgradescript runs successfull and I can see according changes in catalog_eav_attribute's apply_to column.

With all that done I lack the option to add options for containing products:


texts: How to Alphabetize Store Location Listings

texts:
I have a "Locations" module in our Magento store, but it spits out all of our store locations in a random order. It does list them by "State", but if there's 5 New Jersey listings, it doesn't alphabetize based on the Store name. This is the code we have now. This is the live locations page

http://www.jennyyoo.com/index.php/locations/

US LOCATIONS:

            <?php for ($i = 65; $i <= 90; $i++): ?>

<a href="<?php echo $this->getUrl('jennyyoo_locations') ?>#letter-<?php echo chr($i) ?>"><?php echo chr($i) ?>

            <?php endfor; ?>

<a href="<?php echo $this->getUrl('jennyyoo_locations/international') ?>">INTERNATIONAL

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

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

        <?php foreach ($states as $state): ?>

                <h5 <?php if (!in_array(substr($state['region'], 0, 1), $used_letters)) {echo 'id="letter-' . substr($state['region'], 0, 1) . '"'; $used_letters[] = substr($state['region'], 0, 1); } ?>>
                    <?php echo $state['region']; ?>

                <?php $locations = $this->getStateLocations($state['region']); ?>
                <?php foreach ($locations as $location): ?>

                            <?php echo $location['name']; ?>
                            <?php if ($location['bridal_gowns']){?>
                                <img src="<?php echo $this->getSkinUrl('images/bridal-gowns.gif'); ?>"/>
                            <?php }?>
                            <?php if ($location['bridesmaids']){?>
                                <img src="<?php echo $this->getSkinUrl('images/brides-maids.gif'); ?>"/>
                            <?php }?>

                        <address>
                            <?php echo nl2br($location['address_display']); ?>
                        </address>
                        <a href="<?php echo $location['website_url']; ?>"><?php echo $location['website_url']; ?>

                <?php endforeach; ?>

        <?php endforeach; ?>


texts: How to find core test names to generate specific tests

texts:
I am trying to run MFTF tests only for Checkout.

In the DevDocs there are various examples how to generate and run specific tests(MFTF - Getting started - Step 4 - Run a simple test, Generate tests by test name, Generate and run particular tests).

I've had a look at the MFTF action group reference but it seems like these are not the test names required to generate and run specific tests.

Where can I find these test names?


texts: Magento 2 : Check out page shipping address form Country State city sort oder

texts:
I am working on magento 2.1.3

I want to change the sort order of shipping address form elements Country State and City in checkout page.

Country should load first then State and finally city


texts: magento 2 migrate from local to cloud server

texts:
how to move magento 2community edition .zip file to cloud server

uploading through ftp it take too much time how to upload through putty by Magento cli commands


texts: Widgets sort order in different design packages

texts:
I'm wondering if I'm doing something wrong, or there's a 'bug' in Magento.

When I add a couple of widgets in the same package/theme, say 'base/default', the sort order works just fine.

But, when I want to add a widget in a different package (customer/default) that has to show between those widgets, it's not working, this widget shows up at the end of all the base/default widgets.

So for example:

Widget 1 - base/default - Sort order 1
Widget 2 - base/default - Sort order 2
Widget 3 - customer/default - Sort order 3
Widget 4 - base/default - Sort order 4

This is not working correctly, Widget 3 shows up after Widget 4.
Is this a bug, or am I doing something wrong, or does this work 'as designed'?

Thanks in advance!


texts: Is there any way to create Magento Bundle product option dependent with another option group?

texts:
I have a bundle product with multiple Options Groups Like
Option group A, group B, group C.
Now when user select product from group B then user can not select product from group C and vise-versa.
Please suggest me and help me on this.
Thank You,


texts:
I work on Magento 2.1.

I have one website, store and store view. I understand that if in future client needs to add another language to store he will add just a store view. Am I correct?

Now, I have to save some values in core_config_data. What is the best way to save them, to not disturb adding stores/store views/websites in future (especially store view is interesting for me) in future?

Now when I track saving values in adminhtml - they are saved in Default config and in db in column scope they get default and in column scope_id they get 0. Is this correct policy to leave it like that?

I use method saveConfig from \Magento\Framework\App\Config\ConfigResource\ConfigInterface,

like this:

$this->config->saveConfig('path/to/field', 1, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $this->provideAdminStoreId());

Is that correct way?


texts:
In Magento admin, I tried to create new page for different language (in CONTENT > PAGES). However, when I enter the same URL Key (i.e. home) and save, it prompt out error.

  URL key for specified store already exists.

I expected all three pages in different store views should belong to the same URL, anyone got any idea?


texts: Change of SEO Url for product and category URL

texts:
Magento version: 2.2.5

The categories are:

level 1

level 1.1

level 1.2

level 2

level 2.1

level 2.2

when I go to level 1.2 the url shows up as mysite/level 1.2

But I expect url to be as mysite/level 1/level 1.2


texts: ifconfig to disable part of an extension

texts:
I have added a Column to the New Order -> Customer Grid. I am having a really tough time getting the system config to disable this code if turned off. I was hoping I could use a simple ifconfig in the sales_order_create_customer_block.xml or the di.xml to check but it does not work. I have tried calling isNewOrderCustomerGridEnabled() as an if before but I get a cannot be null error.

In the other grids, I added the column with a Plugin and the ui_component xml. Which I was able to add a specific class Ui/Component/Listing/Column/Company.php which checks the Data.php and displays the information depending on the system config setting.

Here is some of the code. Please let me know if you need any more information.

sales_order_create_customer_block.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="adminhtml.customer.grid.container">
        <arguments>
            <argument name="dataSource" xsi:type="object">Trucatch\CompanyColumn\Model\ResourceModel\Order\Customer\Collection</argument>
        </arguments>
        <referenceBlock name="adminhtml.customer.grid.columnSet">
            <block class="Magento\Backend\Block\Widget\Grid\Column" as="billing_company" after="name">
                <arguments>
                    <argument name="header" xsi:type="string" translate="true">Company</argument>
                    <argument name="index" xsi:type="string">billing_company</argument>
                </arguments>
            </block>
        </referenceBlock>
    </referenceBlock>
</body>
</page>

di.xml

<preference for="Magento\Sales\Model\ResourceModel\Order\Customer\Collection" type="Trucatch\CompanyColumn\Model\ResourceModel\Order\Customer\Collection"/>

Data.php

const CONFIG_PATH_GENERAL_NEW_ORDER_CUSTOMER_GRID = 'companycolumn/general/new_order_customer_grid_enabled';

public function isNewOrderCustomerGridEnabled()
{
    return $this->scopeConfig->getValue(
        self::CONFIG_PATH_GENERAL_NEW_ORDER_CUSTOMER_GRID,
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );
}

Collection.php

protected function _initSelect()
{
    parent::_initSelect();
    $this->joinAttribute(
        'billing_company',
        'customer_address/company',
        'default_billing',
        null,
        'left'
    );
    return $this;
}


texts: Magento UPS shipping methods displaying “Sorry, no quotes are available for this order at this time”

texts:
my store view is multi store view for US.

I have configured UPS in Magento 1 store.

I am having this problem at checkout, it keeps displaying "Sorry, no quotes are available for this order at this time." for all products.

Here is my test Billing address place at checkout

I have checked the error log, there is no log for shipping.


texts: Magento2 : How to add Edit link also existing shipping address in checkout page

texts:
How to add Edit link also existing shipping address in checkout page in Magneto 2?

How to update the selected address data when i click the  radio button of the shipping address.

I was saw the my console process:

**Default working process Edit link:**
addressInformation: {,…}
billing_address: {countryId: "IN", regionId: "615", regionCode: "IN-JH", region: "Jharkhand", street: ["test"],…}
city: "hyderbad"
countryId: "IN"
firstname: "test"
lastname: "hello"
postcode: "500001"
region: "Jharkhand"
regionCode: "IN-JH"
regionId: "615"
saveInAddressBook: null
street: ["test"]
telephone: "08096554505"
extension_attributes: {}

address: {street: ["test"], city: "hyderbad", region_id: "615", region: "Jharkhand", country_id: "IN",…}
city: "hyderbad"
country_id: "IN"
firstname: "test"
lastname: "hello"
postcode: "500001"
region: "Jharkhand"
region_id: "615"
save_in_address_book: 1
street: ["test"]
telephone: "08096554505"

I have added the below process to Edit link:

Below file contain some code for edit address:

  Magento\Customer\view\frontend\web\js\model\customer\address.js

getCacheKey: function() {
return this.getKey();
},
isEditable: function() {
return false;
},
canUseForBilling: function() {
return true;
}

in magento 2 given fixed value for edit: return false.

but Here I have added the edit: return true. Edit link is working but selected address doesn't showing in popup

I was observed my console Please check below :

addressInformation: {,…}
billing_address: {customerAddressId: "9047", countryId: "IN", regionId: "631", regionCode: "IN-TS", region: "Telangana",…}
city: "hyderabad"
countryId: "IN"
customAttributes: {zoylo_address_id: {attribute_code: "zoylo_address_id", value: ""},…}
customerAddressId: "9047"
customerId: "264691"
firstname: "test1"
lastname: "hello1"
postcode: "500070"
region: "Telangana"
regionCode: "IN-TS"
regionId: "631"
saveInAddressBook: null
street: ["test"]
telephone: "9152454343"
extension_attributes: {}

{"addressId":"9047"}


texts: SnowdogApps Menu error on Magento EE 2.2

texts:
I have installed a menu module from SnowdogApps from here https://github.com/SnowdogApps/magento2-menu. Install went fine, all tables were created successfully, but when I create a new menu in the admin, I get the following error:

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'v.entity_id' in 'on clause', query was: SELECT `e`.`entity_id`, `e`.`parent_id`, `v`.`value` AS `name` FROM `catalog_category_entity` AS `e`
 INNER JOIN `catalog_category_entity_varchar` AS `v` ON v.entity_id = e.entity_id AND v.store_id = 0
            AND v.attribute_id = 45 WHERE (e.level > 0) AND (e.created_in <= 1) AND (e.updated_in > 1) ORDER BY `e`.`level` ASC, `e`.`position` ASC

Exception #1 (PDOException): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'v.entity_id' in 'on clause'

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'v.entity_id' in 'on clause', query was: SELECT `e`.`entity_id`, `e`.`parent_id`, `v`.`value` AS `name` FROM `catalog_category_entity` AS `e`
 INNER JOIN `catalog_category_entity_varchar` AS `v` ON v.entity_id = e.entity_id AND v.store_id = 0
            AND v.attribute_id = 45 WHERE (e.level > 0) AND (e.created_in <= 1) AND (e.updated_in > 1) ORDER BY `e`.`level` ASC, `e`.`position` ASC

I found out that the field in catalog_category_entity_varchar to which it is referring to (entity_id) does not exist in Magento Enterprise Edition and is replaced by row_id.

Where should I reflect this change in the module's code?


texts: We can't find products matching the selection in magento 2.3

texts:
On every listing page, I'm getting We can't find products matching the selection. I followed this also but dint helped We can't find products matching the selection. I'm attaching a screenshot for your reference

I tried changing elasticsearch version also but that also doesn't worked. Currently, I'm using elasticsearch 6.8.x. Please help.

Note: Every category have almost 1000s of products and all of them are enabled. I have done all settings from the backend that needs to be done to show products on the frontend.


texts: In Magento 2, what does `translate="true"` really do in XML?

texts:
When I add translate="true" to my XML declarations of my own custom module, will Magento translate them automagically (given that I have the proper i18n CSV files for this)? Or is it only served as a flag for the bin/magento i18n:collect-phrases-command?

For example: I have the following XML file:

<type name="Example\Foo\Model\Foo">
    <arguments>
        <argument name="stuff" xsi:type="array">
            <item name="hello" xsi:type="string" translate="true">Hello World!</item>
        </argument>
    </arguments>
</type>

And the following class:

namespace Example\Foo\Model;

class Foo {
    public function __construct(array $stuff = [])
    {
        var_dump($stuff);
    }
}

Will $stuff['hello'] contain the translated string? Or do I still need to implement my own translation logic and is translate="true" merely a flag used by the collect-phrases-command?


texts: Magento 2: How to reset Per Page Record Show in Admin

texts:
I'm on Magento Admin -> Customers -> All Customers

I have 5K Customers. I have set 1000 per page to show record.

Now it's not loading & giving "Script Load" Error. I have checked on another browser it saved my 1000 set per page.

How to reset it?

I think Browser not able to handle.


texts: How to create new product customize option type with dynamic price?

texts:
I want to create new product customize price with dynamic price.
I have added a custom type "flexible" extend from "select". However it can't show grid field "title, price, sku....." like multiple select (it also extend from Select)

Also, I would like to have this custom type can use flexible price in frontend.
Anyone can help me about this?


texts: Migrate theme from Magento Community to Magento Enterprise

texts: I am creating a website in Magento2. I am currently working in the Theme Creation. My client suddenly have plans to go to Magento Enterprise/Cloud. Can someone help if my theme will work there or do I have to write the theme from scratch?


texts: We have added a product (Rs. 70000) in admin panel and also it show in front end fine. But Some of the customer placed the order with lower price. We are not able to reproducible.Checking with different browser, its working fine for me. This issue faced some customer only. Kindly check and let me know. Please help, this is urgent.


texts: Category Default Sort Direction When Clicked

texts:
I'd like Magento to always apply a descending sort direction if a user sorts a category by a certain attribute, for instance "price".
PLEASE NOTE: I am not asking how to choose a default sort attribute for a specific category. (i.e in this question: How to list products in descending order?)
I'm asking how - in the event that a user chooses a specific sort option - for Magento to automatically apply descending as the sort direction. Native functionality applies an ascending sort.
Thanks in advance.


texts: Magento 2 how to get current cart details and customer cart details?

texts:
In Magento 2 how to get current cart details without customer login and get cart details with customer login like minicart ?

I checked with this \Magento\Checkout\Model\Cart & \Magento\Checkout\Model\Session both are not working

I want to get this(cart details) on my custom page(or my custom popup)

I already searched and checked in magento stackexchange,magento community and others blog not get actual results.

I am using this code -

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

// retrieve quote items collection
$itemsCollection = $cart->getQuote()->getItemsCollection();

// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();

// retrieve quote items array
$items = $cart->getQuote()->getAllItems();

foreach($items as $item) {
    echo 'ID: '.$item->getProductId().'
';
    echo 'Name: '.$item->getName().'
';
    echo 'Sku: '.$item->getSku().'
';
    echo 'Quantity: '.$item->getQty().'
';
    echo 'Price: '.$item->getPrice().'
';
    echo "
";
}

That code only working on cart page but not working in other pages.
That code is also fine when cache disable but how it will works without cache disable ?


texts: How to change shipping rate based on shipping address

texts:
I have added a new shipping method module for my magento store. This module allows the user to set shipping rates based on shipping address country.I have added an observer on customer shipping address save after, the code is below.
In config.xml I added new event.

<events>
             <checkout_controller_onepage_save_shipping_address_after>
                <observers>
                    <zones>
                        <type>model</type>
                        <class>zones/observer</class>
                        <method>getShippingMethods</method>
                    </zones>
                </observers>
            </checkout_controller_onepage_save_shipping_address_after>
        </events>

After that I have dispatched the event in OnepageController > SaveShipping method like,

Mage::dispatchEvent('checkout_controller_onepage_save_shipping_address_after', array('page' => $model, 'request' => $this->getRequest()));

This calls the observer when I save my shipping address. But I have no idea how to change the shipping method charge as per the shipping address country.
I have used this thread http://www.opencart60s.com/magento/changing-or-set-shipping-price-on-fly-from-event-or-observer-in-magento.html-13407.html to change the shipping cost. But without success.
I need to change my shipping flat rate as per the country.I have already created the module which will store the country and shipping rate details. I can get the shipping rate using that module. Now, I just have to update the flat rate value with the custom shipping rate value.
Please help me setting my flat rate as per the country code. Thanks..


texts: The invoice can't be saved at this time. Please try again later

texts:
I have 2 problems with orders:
1st, I can't change my orders status:

2nd, I can't generate invoice from my orders:


texts: Magento 2 - MySQL privilege error on module install

texts:
I am getting the following error when installing a module on AWS.

General error: 1419 You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable), query was: CREATE TRIGGER newsletter_subscriber_updated_at_before_insert BEFORE INSERT ON newsletter_subscriber FOR EACH ROW SET NEW.magemail_updated_at = CURRENT_TIMESTAMP;

I am using AWS RDS.

Is there a work around for this?


texts: Understand product attribute type multiselect

texts:
Do you know why magento saves multiselect attribute type as varchar and relative product assocations in catalog_product_entity_varchar as array?

With array is not possible join between
catalog_product_entity_varchar and eav_attribute_option_value on value=option_id

when value is varchar like 1,2,3, because option_id is int.

Isn't better considerer multiselect as multiple int and insert multiple record in catalog_product_entity_int?

So is possible join correctly catalog_product_entity_int and eav_attribute_option_value on value=option_id


texts: Magento 2.3 transfer from localhost to live server issue

texts:
I have a specific question as a beginner in magento.

I built my magento 2.3 in localhost with xampp on windows.
I exported my database as a .sql
I exported all magento files to the server
I changed the core-config_data  URL entries to the server URL`s
I entered the server new infos in env.php
I imported the database in phpMyadmin

all seems to be well done, but once I try to connect my shop in browser, it still redirect to local url : 127.0.0.1 impossible access error.

So my question is : is there another file to edit in Magento that still redirect to the local 127.0.0.1 URL ?

Thank you so much
yves


texts: What is the purpose of the LESS lib-css mixin?

texts:
The .lib-css() mixin is used heavily in Magento 2 LESS files. However its purpose is not apparent, and the mixin definitions don't provide any helpful documentation:

//
//  Add any css property
//  ---------------------------------------------

.lib-css(
    @_property,
    @_value,
    @_prefix: 0
) when (@_prefix = 1)
  and not (@_value = '')
  and not (@_value = false)
  and not (extract(@_value, 1) = false)
  and not (extract(@_value, 2) = false)
  and not (extract(@_value, 3) = false)
  and not (extract(@_value, 4) = false)
  and not (extract(@_value, 5) = false) {
  -webkit-@{_property}: @_value;
       -moz-@{_property}: @_value;
        -ms-@{_property}: @_value;
}

.lib-css(
    @_property,
    @_value,
    @_prefix: 0
) when not (@_value = '')
  and not (@_value = false)
  and not (extract(@_value, 1) = false)
  and not (extract(@_value, 2) = false)
  and not (extract(@_value, 3) = false)
  and not (extract(@_value, 4) = false)
  and not (extract(@_value, 5) = false) {
    @{_property}: @_value;
}

I could see why you would want to use the mixin to add vendor prefixes to bleeding edge CSS properties (although there are few properties where that is necessary any more), but the reason for outputting normal CSS properties using this mixin is not clear. Can anyone shed light on this?


texts:
I have created a new theme which is inheriting from Luma.

Let's say I want to change the .page-header color, what is the best approach to do this?

Should I use a _extend.less file? Or should I copy a Luma .less file to my theme?

Thanks in advance,
Klevis


texts:
I would like to remove the discount code block but have it manageable.

I know if I want to remove it I can do

<?xml version="1.0" encoding="UTF-8" ?>
<layout>
<checkout_cart_index>
<reference name="content">
<remove name="checkout.cart.coupon"/>
</reference>
</checkout_cart_index>
</layout>

However if I try to add ifconfig="module/manage_settings/enable_module" it doesnt work

I have also tried

<action method="unsetChild" ifconfig="module/manage_settings/enable_module">
                <name>checkout.cart.coupon</name>
            </action>

Could someone please advise


texts: Magento 2: Change text Upsell in Magento2 Product Edit

texts: How to Change Up-Sell text in Product Edit from admin(Products -> Catalog-> Edit) in Magento 2.


texts: I am trying to add a multi select attribute with a collection ( custom created ) , the attribute has been added successfully but when I edit collection to fill this new field value it shows an error Failed to load node  from config


texts: I installed magento version 2.3.4 and I have a problem with the order list. If the order is placed through the site in the front-end with the credit card there are no problems, if instead I create the order directly from the management panel in the back end the order is not visible. What can be the problem and how can it be solved?


texts: Magento 2.1: adminhtml errors on the edit product page

texts:
We are running into some strange errors with our Magento 2.1.9 installation. When opening a edit product page in the backend, the page shows some different inline errors:

Unable to resolve the source file for 'adminhtml/Magento/backend/nl_NL/Magento_Ui/templates/form/components/single/switcher.html' #0

 [path-to-magento-public]/vendor/magento/framework/App/StaticResource.php(97): Magento\Framework\View\Asset\File->getSourceFile() #1
 [path-to-magento-public]/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\StaticResource->launch() #2
 [path-to-magento-public]/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource)) #3 {main}

There are numurous errors on the page, all related to the adminhtml/Magento/backend/nl_NL/Magento_Ui/templates/form/components/single reference.

I've been trough the loop a few times here with the following commands:

php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

And even more. I've cleared caches, removed di/generation folders, switched deployment modes back and forth, but still no luck.

I'm running out of ideas here, so I was hoping someone ran into the same problem and managed to find the culprit. I've added a screenshot to give you guys/gals some reference.


texts: While printing store_id field value differs at both frontend and backend

texts:
I have printed the value for Product in both frontend and admin but value for store_id differs. In frontend it gives 1 and at backend it gives 0. Any specific reason why?

I have used this code also

$storeId = Mage::app()->getStore()->getStoreId();

Frontend it gives 1 and at backend it gives 0.


texts: Rest API - magento 1.9 - Return 403 Access denied - Magento\Framework\Webapi\Exception::HTTP_FORBIDDEN - format - https://abc.in/api/rest/customers

texts:
Error : Rest API for customer return 403 access denied error.

Format : website/rest/api/customer -> 403 access denied error

Magento\Framework\Webapi\Exception::HTTP_FORBIDDEN


texts: Add attribute name to configurable select option in Magento2?

texts:
By default, the drop-down box for configurable products displays 'Choose an option...'. I'd like to change this to 'Select {attribute label}'.

I found the code for this in:

vendor\magento\module-configurable-product\view\frontend\templates\product\view\type\options\

Here the following code can be added to change to the required value:

<option value=""><?php /* @escapeNotVerified */ echo __('Select ').strtolower($block->escapeHtml($_attribute->getProductAttribute()->getStoreLabel())) ?></option>

When the page initially loads this seems to work, however, once the page loads this value gets instantly replaced by 'Choose an Option...' which I found loads from here:

/vendor/magento/module-configurable-product/Block/Product/View/Type/Configurable.php

Where it appears like this:

'chooseText' => __('Choose an Option...'),

Any idea how to insert the attribute name here or stop this from overwriting the change I have already made?


texts: What does getItemHtml() function mean in Magento 2

texts:
What does this line basically mean in the code?

<?php echo $this->getItemHtml($itemStartLv, true, $id); ?>

I have searched for this but no clear explanations out there or maybe someone can explain it more clear here.


texts:
I've seen many examples like this one about how to do per-module translations. It looks like this:

"Product Name","Items in Your Cart"

becomes

"Mage_Checkout::Product Name","Items in Your Cart"

However, in all of the versions of Magento I've tried it on, (1.7.0.0,  1.9.1.0 and 1.14.0.0) this doesn't work.

Is this for an outdated version of Magento, or am I doing something wrong?


texts:
I have HTML code for slideshows and [CSS and javascript] but on the static block in magneto 2.3 I can not add a link to CSS and javascript Example

.

before  save

<script src = "http://localhost:8080/style_slideshow/1.css" type="text/javascript"></script>

But after save

<div>&nbsp;</div>

on magneto 1.9 it working


texts: Magento2: Get category product count which is show in admin after the category name

texts:
I want to show category product count which is shown in admin after the category name.
As of now I write this code but it's not working properly.

$category->getProductCollection()->count();

Please see the image to get better idea.

Magento Backend

Magento Frontend


texts: catalog_product_collection_load_after causing maximum nesting issue for configurable products

texts:
i have written modules that changes price of all products on product details page, including related showing on bottom .

what modules does
here i am passing some product id in get parameter and adding price of it in all products on product detail page

Issue facing
My module works fine for simple products issue comes $_GET['id'] is id of configurable product.

Error i get
Fatal error: Maximum function nesting level of '500' reached, aborting! in PATH\lib\Zend\Db\Adapter\Pdo\Mysql.php on line 117

after debug found calling $pricetoadd = Mage::getModel('catalog/product')->setSkipCustomPriceObserver(true)->load($_GET['id']);  causes error when $_GET['id'] is configurable products id why so ?

config.xml

<catalog_product_collection_load_after>
    <observers>
        <setname>
            <type>model</type>
            <class>Mour_Customgroup_Model_Observer</class>
            <method>modifyallname</method>
        </setname>
    </observers>
</catalog_product_collection_load_after>

Observer.php

    public function modifyallname(Varien_Event_Observer $observer) {
        $products = $observer->getCollection();
        foreach( $products as $product )
        {

            if($_GET['id']==""){
                break;
            }
            $pricetoadd = Mage::getModel('catalog/product')->setSkipCustomPriceObserver(true)->load($_GET['id']);
            //this will set a flag that will be handled by the if statement above. If this flag is true your code will not be executed.
            $originalprice = $product->getPrice();

            $model = Mage::getModel('eav/entity_attribute_set');
            $currentattribid = (int)$product->getAttributeSetId();

            $customprice = $originalprice+$pricetoadd->getPrice();

            if ($customprice > 0) {
                $product->setFinalPrice($customprice);
                $product->setMinimalPrice($customprice);
            }

        }
   }


texts: How to get the collection location address (origin) of store

texts: I am building an extension for Magento 2. I am trying to get the collection (origin) address of the store.


texts: What is core_file_storage table in Magento?

texts: I have core_file_storage table in Magento with very huge size. What is it's functionality? Can I remove and replace functionality? Is it affects to the speed of my database? Thanks.


texts:
I have an extension: cmsmart extension search ajax and in the search I need to translate: "All categories". I tried this but its not working:

Add the translation into
app/design/frontend/default/MI_THEME/locale/es_ES/translate.csv
Translate in line. This word not appear with a red border.
In admin configuration.

What can i do?


texts: Product pages load at the bottom of the screen

texts:
My product view is suddenly loading at the bottom of the page requiring visitors to scroll up. This is affecting all of my products.

What code I can use to force the page to the top upon load so that visitors are not required to scroll up?


texts: I have an issue with the share wishlist emails in outlook (images are not rendered properly). I didn't find the table that renders items for the wishlist. Which exactly file displays the items, So I can add style to images. I can set template from admin but the code {{var items|raw}} coming from code, Need to find this.  thanks


texts: Updating product price overrides every single property of default store view

texts:
I have a schema with multiple websites, one store for each website, and multiple storeviews for each store / website.

I want to update a price in the Default Values with the following code:

$product = Mage::getModel('catalog/product')->load($productId);
$product->setPrice($price)->save();

The price is updated, but the model API overrides every single property of the product for the default store view of the store of the default website (with overrides I mean that the Use Default Value tick box is untoggled after the update).

How can I avoid this?


texts: Get Dropdown Value from a Custom Customer Address Attribute

texts:
I'm trying to get the frontend label of my custom address attribute and trying this:$address->getCustomAttribute("custom_attribute")->getValue(), gives me the value "95905" instead of the label.

How can I get the frontend label instead?


texts:
How to solve Catalog Rule Product Status: REINDEX REQUIRED
Hi,
I have a problem in admin, One or more indexers are invalid. Make sure your Magento cron job is running.
I am using cpanel in host. How can i solve this problem?

Thank you for your help!
Angelo


texts:
In the observer i want to exclude the General Group from getting an email when group is change.

Observer

 <?php
 class Group_Model_Observer
 {
    public function sendEmail(Varien_Event_Observer $observer)
    {
        Mage::log('I am coming here');

        $customer=$observer->getEvent()->getCustomer();
        if($customer->getId()){
            if($customer->getOrigData('group_id')!=$customer->getData('group_id')){

                $senderName = Mage::getStoreConfig('trans_email/ident_support/name');
                $senderEmail = Mage::getStoreConfig('trans_email/ident_support/email');
                $sender = array('name' => $senderName,'email' => $senderEmail);
                $recepientEmail = $customer->getEmail();
                $recepientName = $customer->getFirstname().' '.$customer->getLastname();
                $store = Mage::app()->getStore()->getId();

                $storeObj = Mage::getModel('core/store')->load(Mage::app()->getStore()->getId());

                $emailTemplate = Mage::getModel('core/email_template')->loadDefault('customer_group');

                $groupname = Mage::getModel('customer/group')->load($customer->getData('group_id'))->getCustomerGroupCode();
                $vars = array('customerName' => $recepientName,'customerEmail' => $recepientEmail,    'customerGroup'=>$groupname);

                $translate  = Mage::getSingleton('core/translate');
                $emailTemplate->setSenderName($senderName);
                $emailTemplate->setSenderEmail($senderEmail);
                $emailTemplate->setType('html');
                $emailTemplate->setTemplateSubject('Congratulations your now part of the Squad!');
                $emailTemplate->send($recepientEmail, $recepientName, $vars);

                $translate->setTranslateInline(true);

            }
        }
    }
 }

Any help would be great.


texts: Programmatically show parent and child categories on frontend

texts:
Currently these are being rendered with cms blocks. Is there a way to include this type of functionality in a template which gets categories and subcategories and displays them like so:

We just want to ensure that if links change or categories change in the admin panel that the links on the frontend will adjust automatically. What's the most efficient way to achieve this?


texts: SQL Query to fetch all child SKUs by using the configurable SKU

texts:
I am trying to create a SQL query that will display all the SKUs of a simple product that are related to a configurable product. I will add the configurable SKU via a form field that I want to query.

Magento 1.9.2


texts:
How does the Identification of admin user happen in Magento?

I have an admin module, how do I make sure that the url route is not accessible from outside the admin area?

Thanks!


texts: getting error of 400 on creating shipment for an order magento 2.3.1p

texts:
showing error while sending this request
[URL=https://.in/rest/V1
/order/330/ship, METHOD=POST, HEADERS={Authorization=Bearer *******************, Host=.in, Accept=application/json, Content-Type=application/json},
BODY={"appendComment":true,"comment":{"comment":"*******"},"items":[{"orderItemId":"857","qty":1}],"notify":true,"tracks":[{"trackNumber":"test12","carrierCode":"custom
","title":"self"}]}, PROXY-HOST=null, PROXY-PORT=null]
Http Sender warning url:https://toothless.in/rest/V1/order/330/ship, status code:400


texts:
I set up a multi store (under the same website) in my Magento instalation. However, even having different root categories set up for each store, I get all of the products (from both root categories) when I search for a product in any of the stores.

In fact, I need to have different products on each store. They cannot share products. Is it possible to do it only with different stores? Or do I need to create different websites? if I need to create different websites, how can I do that?

What I need is:

example.com  -> store 1 with products x
example.com/secondstore -> store 2 with products y

Please, help me!

Thanks!


texts:
I have around 100 new categories to add to a website, ideally I'd like to go about it as efficiently as possible. Is there any way or perhaps a free extention that will allow adding of new categories on mass in Magento?

Thank you.


texts: Magento 2 Customer session logsout automatically

texts:
We are in Magento 2.3.6 version. Recently on our website, we are facing customer session logout issues randomly.

Customer login redirects to the same login page without any session set.
Forgot password emails are not sent to customers.
On the checkout page when the submit Order button is clicked, the session gets logout.
After placing an order, the session gets logout and the success page loads as a 404 page since there is no customer session.

All these above issues are happening randomly in different scenarios. We couldn't reproduce it sometimes. We know there is some issue with the session. But we couldn't find or debug what it is exactly?


texts:
I have added script in phtml file for faq (cms page).

<script>
    require([
        'jquery',
    ],
            function ($) {
                $(".faqs-question").click(function () {console.log($(this).next());
                    $(this).next().attr('style', 'display: block');
                    $(".faqs-answer").attr('style', 'display: none');
                });

            });
</script>

After minifying js the click event not working properly in chromium...it takes double click to open faqs..

But in firefox its working correctly.

How to fix the problem

If anyone faced these type of issue?

Thanks.