texts: Magento 1.9.0.1 - Parse error: syntax error, unexpected '"' in /path/to/magentoroot/app/code/core/Mage/Payment/Model/Method/Cc.php on line 117

texts:
I have Magento CE 1.9.0.1 installed in one of my client's website and when I add any product to cart and go to checkout - onepage, I am getting below error:

Parse error: syntax error, unexpected '"' in /path/to/magento/app/code/core/Mage/Payment/Model/Method/Cc.php on line 117

Nothing else is there in the php error log and I have tried replacing the app/code/core/Mage/Payment/Model/Method/Cc.php with the original Magento 1.9.0.1 's app/code/core/Mage/Payment/Model/Method/Cc.php file too, but no luck.

PHP version running on the server is 5.6.31 and have also tried installing this patch - https://gist.github.com/renttek/29beaaa1e90909639501, but the error is still there when going to checkout in guest mode.

I don't think any major changes has been done to any of the core files.

Anyone faced this same issue before or any ideas ?


texts: How to programmatically edit a customer account outside Magento directory?

texts:
I am using magento customer session outside magento. I have added section to signup and login from outside. But I  dont know how to edit the customer accounts from outside magento.
This code, I used to get customer values from customer account.

require_once ("../app/Mage.php");
umask(0);
Mage::app();
Mage::app()->loadArea('frontend');
Mage::getSingleton('core/session', array('name' => 'frontend'));
$layout = Mage::getSingleton('core/layout');
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
    $customer = Mage::getModel('customer/customer')->load(Mage::getSingleton('customer/session')->getId())->getData();
    $address = Mage::getModel("customer/address");
    $shipping = $address->load($customer['default_shipping'])->getData();
    ?>
    <form action="" method="post" name="thisForm">
<input type="hidden" name="customerId" id="customerId" value="<?= $customer['entity_id'] ?>" />
<input type="text" name="customerEmail" id="customerEmail" value="<?= $customer['email'] ?>" />
<input type="text" name="customerFirstname" id="customerFirstname" value="<?= $customer['firstname'] ?>" />
<input type="text" name="customerLastname" id="customerLastname" value="<?= $customer['lastname'] ?>" />
<input type="hidden" name="customerDefault_billing" id="customerDefault_billing" value="<?= $customer['default_billing'] ?>" />
<input type="hidden" name="customerDefault_shipping" id="customerDefault_shipping" value="<?= $customer['default_shipping'] ?>" />
<input type="hidden" name="shippingId" id="shippingId" value="<?= $shipping['entity_id'] ?>" />
<input type="hidden" name="shippingParent" id="shippingParent" value="<?= $shipping['parent_id'] ?>" />
<input type="hidden" name="shippingFirstname" id="shippingFirstname" value="<?= $shipping['firstname'] ?>" />
<input type="hidden" name="shippingLastname" id="shippingLastname" value="<?= $shipping['lastname'] ?>" />
<input type="text" name="shippingStreet" id="shippingStreet" value="<?= $shipping['street'] ?>" />
<?php
$collection = Mage::getModel('directory/region')->getResourceCollection()
                ->addCountryFilter('IN')->load();
?>
<select class="txtbox" name="shippingRegion" id="shippingRegion">
    <?php foreach ($collection as $region) { ?>
        <option value="<?= $region['region_id'] ?>" <?php if ($region['region_id'] == $shipping['region_id']) { ?> selected="selected" <?php } ?>><?= $region['name'] ?></option>
    <?php } ?>
</select>
<input type="text" name="shippingTelephone" id="shippingTelephone" value="<?= $shipping['telephone'] ?>" />
<input type="text" name="shippingRegion" id="shippingRegion" value="<?= $shipping['region'] ?>" />
<input type="text" name="shippingCity" id="shippingCity" value="<?= $shipping['city'] ?>" />
<input type="text" name="shippingPostcode" id="shippingPostcode" value="<?= $shipping['postcode'] ?>" />
<input type="text" name="shippingCountryId" id="shippingCountryId" value="<?= $shipping['country_id'] ?>" />

How to update the values in the form into Magento customer account?


texts: What's the reference block for the billing in Paypal Express review?

texts:
I could have sworn that I had this but now I can't seem to get the correct reference block for the billing address in paypal express review. My module's layout.xml is:

...
<paypal_express_review>
    <reference name="paypal.express.review.address">
         <action method="setTemplate">
              <template>new_layout/address.phtml</template>
         </action>
    </reference>
</paypal_express_review>
...

I'm obviously looking to overwrite the default one. It looks as if it should be "paypal.express.review.address" but it's not. I must have tried 50 combos. Anyone got this?


texts: How to update `catalog_category_view` using observer?

texts:
I am trying to set a root template to handler catalog_category_view through an observer. I know I can achieve it through layout update. But believe me I really need to dynamically set root template for handler. :)

The event that I am observing is controller_action_layout_generate_blocks_after and my observer is shown below

Observer.php

<?php

class Programmerrkt_Productperrow_Model_Observer

    public function setPrdouctListPage($observer)
    {
        $layout = $observer->getEvent()->getLayout();

        $layout_template = 'page/2columns-left';

        $layout->getUpdate()->addHandle('catalog_category_view')->addUpdate('<reference name="root"><action method="setTemplate"><template>'.$layout_template.'</template></action></reference>');

        return;
     }
}

Please note that, my event is observing my magento. Means config settings are correct.

But the code didn't work. It is not updating catalog_category_view handler. What is the possible cause for this.?

EDIT

When I output all layout, layout handler look like this

[catalog_category_view] => Mage_Core_Model_Layout_Element Object
(
    [reference] => Mage_Core_Model_Layout_Element Object
    (
       [@attributes] => Array
       (
           [name] => product_list
       )

       [action] => Mage_Core_Model_Layout_Element Object
       (
           [@attributes] => Array
           (
               [method] => addPriceBlockType
           )

           [type] => bundle
           [block] => bundle/catalog_product_price
           [template] => bundle/catalog/product/price.phtml
       )

    )

)

As you can see its not updating.

Share your thoughts please.


texts: Magento 2: Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Perfectmirrors\PmmLayout\Block\Head

texts:
I am really not sure how to create the block class Pmm\PmmLayout\Block\Head , function of which $block->getAllPagesJSContent() should be called inside my phtml file pmm_head.phtml

   <referenceBlock name="head.additional">
        <block class="Perfectmirrors\PmmLayout\Block\Head" name=""pmm_head" before="-" template="Pmm_Pmmlayout::pmm_head.phtml"/>
    </referenceBlock>

In the phtml file pmm_head.phtml, I should be able to do something like below to read the contents from a JS file.

$block->getAllPagesJSContent() to output the contents.


texts: In responsive mode css is taking from this file , automatically generating this file in root folder/media/css directory in magento

texts:
File name is
media/css/0e0a33446067e9918f5a6f676ebf323f.css

I dont want to generate this file auto, What i have to do , please suggect me,

Thank You

Jagdish


texts: change how payment type shows on front end in magento 1.9

texts: i have created some(6) custom payment methods but i don't  want them to show in a select format, i want them in a drop down form at frontend, i tried protected $_canUseCheckout = false; to hide it from front end and used


texts:
my 1column.xml file

<referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header slide" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
    </referenceContainer>

here i want insert my custom html inside header.container

so all i did was inside my frontend/{mypachage}/{theme}/Magento_Theme/templates/html/custom-header.phtml now i want to inject header.phtml inside header tag so inside  my theme/Magento_Theme/layout/default.xml  i edited and added  line

<referenceContainer name="header_container">
  <block  type="page/html" name="asd" template="html/header.phtml" />
</referenceContainer>

But nothing happens


texts:
I'm trying to setup Magento to communicate with Redis via a socket. I've used the following configuration:

...
 <server>/var/tmp/redis.sock</server>
<port>0</port>
...
 <persistent>0</persistent>

Before implementing, I disable the cache, flush the cache, restart the service and access the website but get a exception error: (yes I bumped up the connect_retries to 11 to see if it would make a difference)

a:4:{i:0;s:45:"Connection to Redis failed after 11 failures.";i:1;s:2137:"
/home/website/public_html/lib/Credis/Client.php(362): Credis_Client->connect()
/home/website/public_html/lib/Credis/Client.php(362): Credis_Client->connect()
/home/website/public_html/lib/Credis/Client.php(362): Credis_Client->connect()
/home/website/public_html/lib/Credis/Client.php(362): Credis_Client->connect()
-
/home/website/public_html/lib/Credis/Client.php(440):  Credis_Client->__call('select', Array)
/home/website/public_html/lib/Cm/Cache/Backend/Redis.php(117): Credis_Client->select(0)
/home/website/public_html/lib/Zend/Cache.php(153): Cm_Cache_Backend_Redis->__construct(Array)

/home/website/public_html/lib/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)
 /home/website/public_html/app/code/core/Mage/Core/Model/Cache.php(137): Zend_Cache::factory('Varien_Cache_Co...', 'Cm_Cache_Backen...', Array, Array, true, true, true)
 /home/website/public_html/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Cache->__construct(Array)
/home/website/public_html/app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/cache', Array)
/home/website/public_html/app/code/core/Mage/Core/Model/App.php(401): Mage::getModel('core/cache', Array)
/home/website/public_html/app/code/core/Mage/Core/Model/App.php(295): Mage_Core_Model_App->_initCache(Array)
/home/website/public_html/app/code/core/Mage/Core/Model/App.php(337): Mage_Core_Model_App->baseInit(Array)
/home/website/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
/home/website/public_html/index.php(87): Mage::run('', 'store')
 {main}";s:3:"url";s:43:"/eng/4gb-ddr2-400-ecc-rdimm-343057-b21.html";s:11:"script_name";s:10:"/index.php";}

The permissions for the Redis socket file is redis:redis listed as 0 bytes,

Redis is working fine through the TCP connection, so is there something I'm missing?


texts:
I've created a button on magento2 admin. This button activates a controller using an Ajax request. I'm trying to display an overlay notification - or any other kind of message to the user that will indicate the success\failure of the operation.
I thought that $('messages').update(html) will add a notification of some sort to the admin page i'm viewing - but it didn't show anything.
How can I properly show a notification on the admin?

<?php echo $this->getButtonHtml(); ?>


texts: magento 2 remove leading zeros from order number everywhere

texts:
In magento 2 i want to remove leading zeros from the order numbers.

Order Number looks like:  0000012351

i want order number to look like 12351 without any leading zero.

How can i modify it?


texts: Magento 2.4.1 Disabling MSI Modules (responsible for inventory) after Upgrade to 2.4.1

texts:
We have a Magentoshop (2.4.1) running with elastic-search. Because there is no need of any inventory-tracking, I disabled all the modules according to the following suggestions:
https://devdocs.magento.com/extensions/inventory-management/
Also here is another suggestions for modules to disable:
https://meetanshi.com/blog/disable-magento-msi/
I get the following error, when running setup:upgrade:
Dependency declaration 'cataloginventory_stock' in 'catalogsearch_fulltext' to the non-existing indexer

That is obviously because of the dependency of the indexers, which is defined in the file:
vendor/magento/module-elasticsearch/etc/indexer.xml

I tried to just remove the indexer from this file (via a composer-patch), but this doesn't help. Then I would get a mysql-error and I don't think it would be a good idea to fix the indexer itself. Any suggestions or help?


texts: Get quote item collection by using quote item id in Magento 2

texts:
I get the quote_item_id like this:

$orderItems = $order->getAllItems();
foreach($orderItems as $orderItem){
    $qouteItemId = $orderItem->getQuoteItemId();
}

I need to load quote item collection using quote_item_id.

Is there a way to do it?


texts: How the Base folder will help on Magento 2 modules or themes fallback mechanism

texts:
As from official docs :

  base : used for both front end and admin html.

As the part of Magento Theming, how and when to use base folder and how the fallback work with base folder.
As i observed in the modules, we are using base, for example \vendor\magento\module-wishlist\view\base\layout\catalog_product_prices.xml
As of my knowledge both( Module & theme level) are for overriding, but how Magento 2 will handle the fallback logic for final rendering or merging the changes.

Knowledge sharing will be appreciated.


texts: What is the difference between ('catalog/layer') and ('catalog/category')?

texts:
What is the difference between

$category = Mage::getSingleton('catalog/layer')->getCurrentCategory();

and

<?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>

Someone kindly explain.


texts: Magento m1 to m2 ce-to-ce Data migration issues

texts:
We are trying to Migrate Magento 1.7.x to 2.1.x data migration using the Magento Data Migration Tools Script.

below errors are display,

  [2017-09-06 14:00:03][INFO][mode: data][stage: integrity check][step:
  EAV Step]: started

  [2017-09-06 14:00:03][INFO][mode: data][stage: integrity check][step:
  Customer Attributes Step]: started

  [2017-09-06 14:00:03][INFO][mode: data][stage: integrity check][step:
  Map Step]: started

  [2017-09-06 14:00:06][ERROR]: Source documents are not mapped:

  [2017-09-06 14:00:06][ERROR]: Source documents are not mapped:
  addtocart_device,addtowishlist_device,banners,banners_store,bannerslider,core_directory_storage,ebizmarts_ecomm360,ebizmarts_mailchimppro,elasticemail_transaction,gtspeed_image,gtspeed_stat,ibanners_banner,ibanners_group,interaktingslider_slide,interaktingslider_slide_position,interaktingslider_slide_store,m_attribute,m_db,m_db_log,m_edit_session,m_filter,m_filter2,m_filter2_store,m_filter2_value,m_filter2_value_store,m_filter_datetime,m_filter_decimal,m_filter_int,m_filter_text,m_filter_varchar,magazento_socialgp,magebuzz_testimonial,magenotification,magenotification_extension_feedback,magenotification_extension_feedbackmessage,magenotification_log,mobicommerce_applications2,mobicommerce_applications_settings2,mobicommerce_category_icon2,mobicommerce_category_widget2,mobicommerce_devicetokens,mobicommerce_licence,mobicommerce_notification,mobicommerce_widget2,mobistorelocator_holiday2,mobistorelocator_image2,mobistorelocator_location2,mobistorelocator_rating2,mobistorelocator_specialday2,mobistorelocator_store2,mobistorelocator_store_value2,mobistorelocator_storereviews2,neotheme_blog_category,neotheme_blog_comment,neotheme_blog_post,neotheme_blog_tag,payucheckout_api_debug,plumbase_product,pricecalculator,pricecheck,pws_productqa,qaz_qbanner,qaz_qbanner_category,qaz_qbanner_image,qaz_qbanner_page,qaz_qbanner_store,slide,snippet,themeswitcher_theme,themeswitcher_theme_browser,themeswitcher_theme_platform,twlogin_customer2,web,widgento_login

  [2017-09-06 14:00:06][ERROR]: Source fields are not mapped. Document:
  catalog_product_option. Fields: regex,regex_message,validators

  [2017-09-06 14:00:06][ERROR]: Source fields are not mapped. Document:
  catalogrule. Fields: attribute_to_select

  [2017-09-06 14:00:06][ERROR]: Source fields are not mapped. Document:
  catalogrule_product. Fields: attribute_to_select

  [2017-09-06 14:00:06][ERROR]: Source fields are not mapped. Document:
  sales_flat_order. Fields:
  onestepcheckout_customercomment,orderfromplatform

  [2017-09-06 14:00:06][ERROR]: Source fields are not mapped. Document:
  sales_flat_order_item. Fields:
  frame_img1,frame_img2,frame_img3,frame_img4

  [2017-09-06 14:00:06][WARNING]: Mismatch of data types. Source
  document: catalogrule_product. Fields: action_operator

  [2017-09-06 14:00:06][WARNING]: Mismatch of data types. Destination
  document: catalogrule_product. Fields: action_operator [2017-09-06
  14:00:06][INFO][mode: data][stage: integrity check][step: Url Rewrite
  Step]: started

  [2017-09-06 14:00:06][INFO][mode: data][stage: integrity check][step:
  Log Step]: started

  [2017-09-06 14:00:06][INFO][mode: data][stage: integrity check][step:
  Ratings Step]: started

  [2017-09-06 14:00:06][INFO][mode: data][stage: integrity check][step:
  ConfigurablePrices step]: started

  [2017-09-06 14:00:06][INFO][mode: data][stage: integrity check][step:
  OrderGrids Step]: started

  [2017-09-06 14:00:06][INFO][mode: data][stage: integrity check][step:
  Tier Price Step]: started

  [2017-09-06 14:00:06][INFO][mode: data][stage: integrity check][step:
  SalesIncrement Step]: started

[Migration\Exception] Integrity check failed

We are getting this errors, while run the config.xml file. Anyone please review the issues and let me know your suggestions to fixes the issues.


texts: How to make PHPSESSID secure and set sameSite to Strict

texts:
We are unable to set PHPSESSID secure and set sameSite value to Strict, does anyone have any idea how we can set this in Magento 2 EE.

Thanks


texts: Magento Cron Job - Setup Emails from 1 minute; rest of cron every day?

texts:
I installed Magento 1.9, and now since the order emails are sent with cron, I want the cron to run every 1 minute, so the customer gets their emails right away.

But I do not want all the cron tasks every minute, cause it would be a huge resource drain.

How can i set up the order emails to get out every minute, but not the other cron tasks....

I also have installed AOE scheduler
?


texts:
I have configured amazon pay in my site and it is working fine with both login and payment.

The query I have is , Why amazon payment is  separated with other payment methods in checkout page?

it is not included with other payment methods . So it creates confusion for user .


texts: Magento 2 : How to Update Price After Changing Qty On Cart

texts:
How to update price after qty changed by dropdown in magento 2.
I changed qty input type to dropdown like below code in default.phtml:

 <td class="col qty" data-th="<?php echo $block->escapeHtml(__('Qty')); ?>">

                <select id="cart-<?php /* @escapeNotVerified */
                echo $_item->getId() ?>-qty" name="cart[<?php /* @escapeNotVerified */
                echo $_item->getId() ?>][qty]" title="<?php echo $block->escapeHtml(__('Qty')); ?>" data - cart - item -
                        id="<?php /* @escapeNotVerified */
                        echo $_item->getSku() ?>">
                    <?php for ($i = 1; $i <= $qty; $i++): ?>
                        <option value="<?php echo $i; ?>"<?php if ($i == $block->getQty()) {
                            echo 'selected';
                        } ?>><?php echo $i; ?></option>
                        <//?php $i = $i + 4; ?>
                    <?php endfor; ?>
                </select>

As above how to get changed value and update price in cart.

like

please help.


texts:
Trying to add new product according to this article
http://blog.belvg.com/creating-a-simple-product-in-magento-2-0.html

However i don't have an 'Add Product' button


texts: What is object manager in magento2? Is it good to avoid use of it in Magento and where shall we make use of object manager ?


texts:
I want to add a html page (which I made using code). How can I assign this   'test.phtml' file to a block named 'custom_block'. what is best way to do that ?
any help would be highly appreciated. thank you


texts: Magento 1.9 Customers can't update their info on frontend

texts:
anyone knows the reason why clients can't save any updates on the frontend?

When they add a new address or change password or any account info, after clicking save button it will redirect back to the previous page which is with nothing changed.

My Magento version is 1.9.2.0.

Updates:

I've tried the most common solution which is adding form_key in customer page but not working.

And occasionally I found when disabling "Use Web Server Rewrites" in setting → Web → Search Engines Optimization can solve this problem but I need web server rewrites this function for SEO purpose. What should I do if I want to fix this problem while enabling "Use Web Server Rewrites"?


texts: In Magento 1.9.3.3 how to make empty cart whenever customer logged in?

texts: If you have any idea then please share here.


texts: How to show featured products from a certain category only?

texts:
How can I show featured products from a certain category only?

I managed to create 'featured product' as one of the attributes for my products and I have 'tagged' a few products to this attribute. But my problem is I only want to show the featured product from one particular category only.

I have 'wine', 'food', 'gifts', etc as my categories. And each category has their own featured products, so when I am on wine category view page, I want to show the featured ones from wine category only, and then I want to show the ones from food category only when I am on food category view page.

I followed the guides here to create 'featured product' attribute,

1.
http://www.magentocommerce.com/wiki/5_-_modules_and_development/catalog/how_to_create_a_featured_product

2.
http://www.magentocommerce.com/boards/viewthread/84852/


texts: How to display out stock products in one category if disabled out of stock products

texts:
Below script shows out of stock products in only one category with Display Out Of Stock option yes in the admin by using helper file.

Here is the code:

<?php

namespace Vendor\Module\Helper\Catalog;

class Stock extends \Magento\CatalogInventory\Helper\Stock
{
    public function addIsInStockFilterToCollection($collection)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $category = $objectManager->get('Magento\Framework\Registry')
                                  ->registry('current_category');//get current category

        if(!is_null($category))
        {

            $categoryId = $category->getId(); //current category id
            $stockFlag = 'has_stock_status_filter';

            if (!$collection->hasFlag($stockFlag))
            {
                $isShowOutOfStock = $this->scopeConfig->getValue(
                    \Magento\CatalogInventory\Model\Configuration::XML_PATH_SHOW_OUT_OF_STOCK,
                    \Magento\Store\Model\ScopeInterface::SCOPE_STORE
                );
                $resource = $this->getStockStatusResource();

                //100 static category Id
                if($categoryId == 100)
                {
                   //show display out of stock products for particular category
                   $resource->addStockDataToCollection(
                        $collection,
                        false
                    );
                }
                else
                {
                    $resource->addStockDataToCollection(
                        $collection,
                        $isShowOutOfStock
                    );
                }
                $collection->setFlag($stockFlag, true);
            }
        }
       }
}

?>

My problem is:

It's working only for category page and the out of stock products coming into the search result page.

I want to show out of stock products for only one category page should hide in all other categories. But the Out of stock products that belong only to the Category Id '100' should show in the search result page.

Please can you help me to fix this issue?


texts: Magento 2 : How to get product info on shipping model?

texts:
I was working on shipping method to remove some method based on product attribute. I've used preference for shipping model class \Magento\Shipping\Model\Shipping

this is code of that class.

public function collectCarrierRates($carrierCode, $request)
    {

        $carrier = $this->_carrierFactory->createIfActive($carrierCode, $request->getStoreId());
        if (!$carrier) {
            return $this;
        }

        //unset other method if cart has speific product attribute
        if($carrierCode=="flatrate"):
            return $this;
         endif;

        $carrier->setActiveFlag($this->_availabilityConfigField);
        $result = $carrier->checkAvailableShipCountries($request);
        if (false !== $result && !$result instanceof \Magento\Quote\Model\Quote\Address\RateResult\Error) {
            $result = $carrier->proccessAdditionalValidation($request);
        }
        /*
         * Result will be false if the admin set not to show the shipping module
         * if the delivery country is not within specific countries
         */
        if (false !== $result) {
            if (!$result instanceof \Magento\Quote\Model\Quote\Address\RateResult\Error) {
                if ($carrier->getConfigData('shipment_requesttype')) {
                    $packages = $this->composePackagesForCarrier($carrier, $request);
                    if (!empty($packages)) {
                        $sumResults = [];
                        foreach ($packages as $weight => $packageCount) {
                            $request->setPackageWeight($weight);
                            $result = $carrier->collectRates($request);
                            if (!$result) {
                                return $this;
                            } else {
                                $result->updateRatePrice($packageCount);
                            }
                            $sumResults[] = $result;
                        }
                        if (!empty($sumResults) && count($sumResults) > 1) {
                            $result = [];
                            foreach ($sumResults as $res) {
                                if (empty($result)) {
                                    $result = $res;
                                    continue;
                                }
                                foreach ($res->getAllRates() as $method) {
                                    foreach ($result->getAllRates() as $resultMethod) {
                                        if ($method->getMethod() == $resultMethod->getMethod()) {
                                            $resultMethod->setPrice($method->getPrice() + $resultMethod->getPrice());
                                            continue;
                                        }
                                    }
                                }
                            }
                        }
                    } else {
                        $result = $carrier->collectRates($request);
                    }
                } else {
                    $result = $carrier->collectRates($request);
                }
                if (!$result) {
                    return $this;
                }
            }
            if ($carrier->getConfigData('showmethod') == 0 && $result->getError()) {
                return $this;
            }
            // sort rates by price
            if (method_exists($result, 'sortRatesByPrice') && is_callable([$result, 'sortRatesByPrice'])) {
                $result->sortRatesByPrice();
            }
            $this->getResult()->append($result);
        }
        return $this;
    }

I'm trying to get product info here, but I am not able to get it.
Anybody has idea how to get it?


texts: How to add dynamic content to head.additional in magento2?

texts:
It is required to show dynamic javascript userId var in head.additional block if the user is logged in, otherwise null.

So I am injecting my block into default layout handle

    <?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>
            <referenceContainer name="head.additional">
                <block class="Test\Test\Block\Head" name="testtest_head" />
            </referenceContainer>
        </body>
    </page>

in the block, I use this code and it works great

class Head extends Template
{
  ...
     protected function _afterToHtml($html)
     {
          return $html. $this->getMyUserIdCode();
     }

}

But when I enable the cache, userId won't refresh even if customer logged in. How can I properly avoid caching in this sutuation ?


texts: Is it possible to have a product attribute and to have the input type as radio buttons?


texts:
I am trying to change the Magento 2.1.0 theme folder name to my company name.I cannot found right solution.

Please help.


texts: Magento extension to calculate measurement and other options

texts:
Is there a Magento extension to calculate blinds size and total price?

Something like Choose:

SET YOUR MEASUREMENT:
cm, mm, inches

-width
-height

CHOOSE ADN SCALLOP

-Select your Shape/Scallop
-Do you want eyelets?

CHOOSE CONTROLS
-something
-something


texts:
How to use fotorama in product image as like in magento2.

I want to add all functionality like previous/next click , image hove zoom etc. in magento1.9 as like magento 2.

How to apply fotorama in product image?

Anyone know about this? Please help me.


texts:
In my shop I have more 6000 products, but my magento shop using Magento 1.4.1 version.

How can I move/migrate all products with images to my new magento shop 1.9?

When I tried mage export file, I have message:

  Internal server error HTTP 500

please help. Thanks


texts: Magento Google tag assistant showing errors

texts:
Suddenly our magento started showing error in google tag assistant(
chrome extension)

No HTTP response detected.
Missing analytics.js script.

Can anyone help me how to fix this issue?

Thanks


texts: Rest api with same route of different entity type and using put and post method

texts:
<routes>
    <route_collection>
        <route>/cart/addtocart/:device_id/:product_id/:qty</route>
        <action_type>collection</action_type>
     </route_collection>
     <route_entity>
       <route>/cart/addtocart/:device_id/:product_id/:qty</route>
        <action_type>entity</action_type>
     </route_entity>
</routes>

Can we not use same route for rest API call ? <route_collection> with action type collection for POST method and <route_entity> with action type entity for PUT method?

When I tried the above I am getting the below error.

  {"messages":{"error":[{"code":405,"message":"Resource method not
  implemented yet."}]}}

Thanks.!


texts: I have an existent attribute and i want to add it to an attribute set. I drag and drop the attribute to a group. What database tables should i change to complete the process ?


texts:
I'm creating a local.xml for a new site. I'm working on the customer account pages and I'm finding that I have to repeat a lot of the same rules per page.

For the Sales Order History page I have

    <sales_order_history>
        <reference name="head">
           <action method="addCss">
               <stylesheet>css/custom/account.css</stylesheet>
           </action>
        </reference>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <remove name="customer.account.link.back" />
    </sales_order_history>

If there was a way to just save the xml inside the sales_order_history tags in a variable, eg. {xmlRules} = sales_order_history and then call it I think it would make the file much more readable.

  <sales_order_view>
     {xmlRules}
  </sales_order_view>

Has anyone done something like this before?


texts: Something went wrong while saving this configuration: Area is already set magento 2.3

texts:
I am facing this error in version magento 2.3 while saving header logo.

  Actually this issue is resolved as per gihub but even it is coming.link


texts:
We recently had a developer update parts of our site. For some reason he has implemented a permanent redirect on our browser back button which goes to a specific landing page.

Does anyone know how to fix this. I've looked through lots of the files and can't see any code that relates to the browser back button.

Unfortunately we can't contact the previous developer so we are trying to figure this out ourselves. Any help appreciated.


texts: Magento 1.9 moving products between websites

texts:
How to move a product/item who was added to cart/quote on websiteA to cart/quote which is on websiteB.

I would like to solve this problem with controller, but I am not very successfull.

Do you suggest something different?

code in my controller:

$oldQuote = $session->getQuote();
$oldQuoteItems = $oldQuote->getAllItems();
$newQuote = Mage::getModel("sales/quote")->setStoreId(1);
foreach ($oldQuoteItems as $_item) {

    if ($helper->checkProduct($_item->getProduct())) {
        $newQuote->addItem($_item);
        //$oldQuote->removeItem($_item);
    }
}

try {
    $newQuote->collectTotals()->save();
    $oldQuote->collectTotals()->save();
}

Thanks for the help


texts: Exported catalog not importing to Magento Community

texts:
We are using HostGator and they have Magento Community among their Quick Installs.  I used their install method, had issues from the start.  Nothing they did fixed anything. I had created all of our new categories, products, Amazon s3 download link locations, everything necessary and then in the end, with another HostGator attempt at repairing some Apache files - they accidentally removed our cart.

I had exported the entire product/category structure before asking them to take another look at it, just to be safe.  I really didn't want to key that all in again.

I downloaded Magento Community directly from the Magento site, created a new SQL - got it all up and running without any issues whatsoever, till I tried to import the CSV file that Magento itself had created as an export.  Upon clicking, "Check Data," on the import screen after selecting the appropriate file, I am returned with the following:

Category does not exists in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50
Product Type is invalid or not supported in rows: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 38, 40, 42, 44, 46, 48, 49, 50
Orphan rows that will be skipped due default row errors in rows: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 37, 39, 41, 43, 45, 47

I am hugely confused as to why Magento is not recognizing its own created structure and cells in this CSV file.

The "Category," is clearly present in the table.  It most certainly DOES exist in all rows 2-50.

I have no clue why it states Product Type is invalid.  All of our current product types are digital download, selected from the Magento default pull down, we had nothing customized with additional attributes or coding.

As far as Orphan rows, all even numbered rows are empty with the exception of having a category cell, as when Magento created the CSV file, it created a secondary row to display the category column for every product which is shown in two categories.

Any ideas as to what I can do to alter the spreadsheet to make it compliant with the import?  Also - It states that "Row 1 has no category and it's product type in invalid."  Row 1, generated by the Magento export feature, is merely the labels for each column.  It shouldn't even be reading the data on line 1.

Trying to avoid having to re-enter all of our products.  Any suggestions?

Thanks


texts: How can I set an event observer for customer logout action in magento2?


texts:
I have to setup cron jobs for Sitemaps in Magento 2 on daily basis.

How will I achieve this?


texts: Magento 2: How to override event "checkout_type_onepage_save_order_after"

texts:
I want to override an event checkout_type_onepage_save_order_after.
For this I already tried below code :

etc/frontend/events.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
     <event name="checkout_type_onepage_save_order_after">
        <observer name="mycustomobserver" instance="Namespace\Module\Observer\CreateTestFormObserver"/>
     </event>
</config>

Namespace\Module\Observer\CreateTestFormObserver.php

<?php
namespace Namespace\Module\Observer;

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

class CreateTestFormObserver implements ObserverInterface
{
  private $logger;
  protected $messageManager;

   public function __construct(
     \Psr\Log\LoggerInterface $logger) {
        $this->logger = $logger;
   }
   public function execute(EventObserver $observer)
   {
       $this->logger->addDebug('CreateTestFormObserver');
   }
}

But my file is not called after placing an order. I identify this by my log, which is not generated on or after placing an order.


texts: Magento 2.2.5 can't find sitemap while it is generated

texts:
I'm struggling with an weird issue. I can't make any custom files / folders in my root of magento. I want to make a custom folder with some images, resulating in 404 errors when trying to reach the path of this images.

Also, the generated XML Sitemap throws an 404 error. The path for the sitemap is /sitemaps/sitemap.xml. Magento can't find this path. Is there a seting i'm overlooking? Because first it worked well.

Hope someone can help me with this!


texts: How to call Viewmodel via layout handler in Magneto 2?

texts:
This is my layout file where i need to call Viewmodel so that it can be used by block .

<referenceBlock name="product.info.review">
        <arguments>
            <argument name="view_model" xsi:type="object">Vendor\ModuleName\ViewModel\Test</argument>
        </arguments>
    </referenceBlock>


texts:
i'm trying to split the customer account edit page to 2 column I tried

/public_html/vendor/magento/module-customer/view/frontend/layout/customer_account_edit.xml

this is my code

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

Any help please


texts: Error when trying to put product into cart (tempnam())

texts:
On my live system (PHP7.1 fcgi, magento 2.2.4, prod mode) I get an error when trying to put a product into cart. The product does not end up in the cart.

Instead I get this error in the exception.log:

[2018-07-11 12:58:17] main.CRITICAL: Notice: tempnam(): file created in the system's temporary directory in /www/vendor/magento/zendframework1/library/Zend/Cache/Backend.php on line 203 {"exception":"[object] (Exception(code: 0): Notice: tempnam(): file created in the system's temporary directory in /www/vendor/magento/zendframework1/library/Zend/Cache/Backend.php on line 203 at /www/vendor/magento/framework/App/ErrorHandler.php:61)"} []

I have no idea what this means or how to solve it. The same system on my local dev does not produce this error.

Any idea?

Thank you


texts:
We have 3 product Tax classes
TPS
TVQ
HST

We have 3 Tax Rules

Name         Customer Tax Class P.Tax classe    Tax Rate                priority subtotal only sort order

CAN-QC-GST   Retail Customer     TPS            CAN-QC-GST(5)                 0                1       0
CAN-QC-PST   Retail Customer     TVQ            CAN-QC-PST(9.75)                 1                1       1
CAN-QC-HST   Retail Customer     HST            CAN-QC-GST(5), CAN-QC-PST(9.975)     2                1       0

When the product belongs to HST class, I am getting only PST(9.75) tax rate in  cart. But I should get both tax rates.
Please help me with  my configuration!.


texts: Tranport exception while trying to install magento

texts:
Trying to install Magento using the composer .  Running into some kind of transport exception while updating dependencies
Following is the log
Installing magento/project-community-edition (2.1.3)

Installing magento/project-community-edition (2.1.3) Downloading: 100%
Created project in /ahmed/dev/magento
Loading composer repositories with package information
Updating dependencies (including require-dev)

[Composer\Downloader\TransportException]
Content-Length mismatch
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

Any pointers for resolving this issue would be helpful
Thanks


texts:
I am having a problem when i try to install component through web setup wizard.
My php version is 7.1.29
I am using Magento 2.3.2
In Step 1: Readiness Check i get the following result

Check Updater Application Availability
Updater application is available.

Check Cron Scripts
Cron script readiness check failed. Hide detail

Error from Updater Application Cron Script:

Found non-writable path(s):
/home/*********/public_html/magento/.github

For additional assistance, see cron scripts help.

Check Component Dependency
We found conflicting component dependencies. Hide detail

For additional assistance, see component dependency help .

PHP Settings Check *
Your PHP settings are correct.

PHP Extensions Check
You meet 21 out of 21 PHP extensions requirements. Show detail

Can someone please assist me to resolve these 2 issues?


texts: Magento 2.1 - User Group Registration Form

texts:
I am in the process of standing up a production server for new shop migrated from Magento 1.9.

Wholesale users go to site.dev/customer/account/create/group/wholesale?___store=wholesale_v (same for the staging environment, which is on the internet) and when they register via this form, it assigns them to the wholesale group. When they go to the same endpoint on my the production server, it assigns them to the General group. I'm at a loss and it seems every time I make any headway with any of these types of issues, another one specific only to the production server pops up.

Is there a different way I should be signing up customers to a specific group?

Has anyone come across this? All environments are running the same code base. The production server is hosted by Nexcess if that provides any clues.

Thanks very much!


texts: Report for Product view count and total quantity ordered

texts:
I want to have custom report which will show Product view count and total quantity ordered and ratio of these two in a report.

Please give me some idea how I can create this report in admin.


texts: Magento 2 Dropdown dialog like as minicart

texts:
How to setup a Dropdown Dialog like as mini cart, I would like to use these type Dropdown dialog for my custom menu located in a .phtml file.

Anyone show me an example please!


texts: Redis FPC persistence across multiple sessions

texts:
Running into an issue with Magento REDIS FPC. It seems that pages are only cached for a session and those cached pages are not usable between sessions. I would like cached pages to be shared between sessions so after one page is cached then other user/sessions will receive the cached page. Not sure if this is by design or a configuration issue on my side.

What I think SHOULD (and want to) happen:

Magento cache cleared
user session 1 loads a page (long load, no cache 10 seconds)
user session 1 reloads same page (short load due to cache, 1 second)
user session 2 loads same page (short load due to cache, 1 second)

What is happening:

Magento cache cleared
user session 1 loads a page (long load, no cache 10 seconds)
user session 1 reloads same page (short load due to cache, 1 second)
user session 2 loads same page  (long load, no cache 10 seconds)

I have only two elements in the header that are set to not cache. Rest of the page is set to cache.


texts: magento setup:upgrade error "deployment configuration is absent"

texts:
When I try to upgrade Magento 2 php bin/magento setup:upgrade I get

I get

  [Magento\Setup\Exception]
  Can't run this operation: deployment configuration is absent. Run
  'magento      setup:config:set --help' for options. setup:upgrade

  [--keep-generated] [--magento-init-params="..."]

How to fix it? Updating using the web updater gives the following errors:

I asked my hosting provider to fix them and they did install the right php version 5.6 and all extensions recommended by magento and created a cron job but I still see the error.

UPDATE: (from comments)
env.php wasn't there, when I run magento setup:config:set I get this error:

  $ bin/magento setup:config:set
  SQLSTATE[HY000] [2002] No such file or directory

  [InvalidArgumentException]
    Parameter validation failed


texts: How to remove a specific href from a top-menu link in Magento 2

texts:
I am trying to make 3 items on menu to be not click-able and  I    want to ask how to remove a specific href from a top-menu link in magento?

(I don't want to remove from all menu items just for 3 as you can see here http://prntscr.com/kqtt77) also I don't want to use href="#" any suggest?


texts:
I am using a custom theme with Luma parent, and I am trying to change the text of the Sign In link (authorization-link-login) at the top. I am able to edit the text of the register link in my default.xml file successfully using
 <referenceBlock name="register-link">
        <arguments>
        <argument name="label" xsi:type="string" translate="true">Register</argument></arguments>
 </referenceBlock>

But if I try
 <referenceBlock name="authorization-link-login">
        <arguments>
        <argument name="label" xsi:type="string" translate="true">Custom Text</argument></arguments>
 </referenceBlock>

the link still reads "Sign In" and has no change.
Is there another way to change the Sign In text?


texts:
I have drop down call color below code represent that

Frame Color

<select id="color" onchange="Calculation();">
<option value="White">White</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Black">Black</option>
<option value="Wood limitation">Wood limitation</option>
</select>

If someone select value i will change the label using java scripts

//frame color calculation
   var color = document.getElementById('color').value;

        if(color=="White"){
            framecolor = (0);
            document.getElementById("framecolor").innerHTML = "FrameColor Price : " + framecolor;
        }
        else if(color=="Red"){
            framecolor = (4);
            document.getElementById("framecolor").innerHTML = "FrameColor Price : " + framecolor;
        }
        else if(color=="Green"){
            framecolor = (8);
            document.getElementById("framecolor").innerHTML = "FrameColor Price : " + framecolor;
        }
        else if(color=="Black"){
            framecolor = (12);
            document.getElementById("framecolor").innerHTML = "FrameColor Price : " + framecolor;

I have created a database table call 'color_price' like below

id      color     price_component
1       white     0
2       red       4
3       green     8
4       black     12

I have add database table using InstallSchema and the script code and dropdown in frontend/templates/test.php file

  If someone select color how can i retrieve data from database table
  instead of using hard coding.


texts: How to change the page that shows up AFTER customer places an order? (order success page)

texts:
I would like to make some changes to the Confirmation page that comes up after the customer places an order (actually add the code for Shopper Approved) and I can't seem to locate which file and path to do that in.

Magento 1.9.1.0
porto theme (but I can also change it in the core files I guess)


texts:
In my file app/design/frontend/vender/name/Magento_Newsletter/templates/subscribe.phtml
I have written...
<script>
require([
    'jquery',
    'underscore',
    'mage/translate',
    'domReady!'
], function($, _) {
    $(document).ready(function() {
        var CaptchaCallback = function() {
        grecaptcha.render('RecaptchaField', {
            'sitekey': '<?= $siteKey ?>'
        });
        };
        window.CaptchaCallback = CaptchaCallback;
    });

    $(document).on('submit', '#newsletter-validate-detail', function(){
        var isSubmit = jQuery(this).valid() && grecaptcha.getResponse() != '';
        if (!isSubmit) {
            document.getElementById('captcha').innerHTML= $.mage.__('Please click on the
reCAPTCHA!');
            return false;
        }
        return isSubmit;
    });
})
</script>

and translate i18n
"Please click on the reCAPTCHA!","Bitte klicken Sie auf das reCAPTCHA!"

But It's not working. It only show error "Please click on the reCAPTCHA!". Don't know if I'm missing anything? Please help me!


texts: how to disable url rewriting for dev mode?

texts: In dev mode , what's the easiest way to disable the url rewriting and find more easily the modules, class and files involved in the rendering of any page


texts: Show layered navigation on catalog search results page in magento

texts:
When I add a specific subcategory to my query string on my search results page I can see the chosen refinements list and filter options for other categories, price ranges, etc. However if I only do a keyword search I do not see any filter options. How can I set my results page to show all available filters with just a keyword search?

Edited to add - here is the layout xml:

               <catalogsearch_result_index translate="label">
    <label>Quick Search Form</label>
    <update handle="page_two_columns_left" />
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="left">
    </reference>
    <reference name="content">
        <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>

        <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
            <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
                <block type="catalog/layer_view" name="filter" template="catalog/layer/view.phtml"/>
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
                </block>
                <action method="setColumnCount"><count>3</count></action>

                <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
            </block>
            <action method="setListOrders"/>
            <action method="setListModes"/>
            <action method="setListCollection"/>
        </block>
    </reference>
</catalogsearch_result_index>

Here is a screen shot of the page prior to any filters on the search:

Here is one with a category filter added:


texts: I want to show a product details in popup instead of redirecting to the product view page. How is it possible. Please help.


texts: How to Create Multiple shipment programmatically in magento 2

texts: If user added 2 different product in order, want to create two shipment on ready for dispatch button , programmatically .


texts: Magento2: Search programatically like Magento2

texts:
I've tried looking for products programmatically that get the same results as magento 2 searches (In the search box). I have used:

    $result = array();

    $filter1 = $this->_filterBuilder->setField('name')
        ->setValue('%' . $searchTerm . '%')
        ->setConditionType("like")
        ->create();

    $filter2 = $this->_filterBuilder->setField('description')
        ->setValue('%' . $searchTerm . '%')
        ->setConditionType("like")
        ->create();

    $filter3 = $this->_filterBuilder->setField('visibility')
        ->setValue("1")
        ->setConditionType("neq")
        ->create();

    $filter4 = $this->_filterBuilder->setField('status')
        ->setValue("1")
        ->setConditionType("eq")
        ->create();

    if($searchOrder == "relevance") $searchOrder = "name";

    //filter1 OR filter2
    $filterGroup = $this->_filterGroupBuilder->setFilters(array($filter1, $filter2))->create();

    //filterGroup AND filterGroup2
    $filterGroup2 = $this->_filterGroupBuilder->setFilters(array($filter3))->create();

    //filterGroup AND filterGroup2 AND filterGroup3
    $filterGroup3 = $this->_filterGroupBuilder->setFilters(array($filter4))->create();

    $searchDirection = ($searchDir == "desc") ? SortOrder::SORT_DESC : SortOrder::SORT_ASC;

    $this->_searchCriteriaBuilder->addSortOrder($searchOrder, $searchDirection);
    $searchCriteria = $this->_searchCriteriaBuilder->setCurrentPage($page)->setPageSize($pageSize)->create();
    $searchCriteria->setFilterGroups([$filterGroup, $filterGroup2, $filterGroup3]);
    $products = $this->_productRepository->getList($searchCriteria);
    $totalSearchResults = $products->getTotalCount();
    $products = $products->getItems();

But I do not always get the same results. Besides that if I put two words, my method does not work.

I have come to the conclusion that the only way would be to use magento-catalog-search to get exactly the same results. but I can not find a way to do it.

Has anyone used catalog-search to programmatically search?

Thanks

Answer:

$search_criteria = $this->_searchCriteriaBuilder->create();

        $search_criteria->setRequestName("quick_search_container");

        $filter = $this->_filterBuilder->setField('search_term')
            ->setValue($searchTerm)
            ->setConditionType("like")
            ->create();

        $filterGroup = $this->_filterGroupBuilder->addFilter($filter)->create();

        $searchDirection = ($searchDir == "desc") ? SortOrder::SORT_DESC : SortOrder::SORT_ASC;

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $sortOrder = $objectManager->create('Magento\Framework\Api\SortOrder');
        $sortOrder->setField('name');
        $sortOrder->setDirection($searchDirection);

        $search_criteria->setFilterGroups([$filterGroup])
            ->setCurrentPage($page);

        $search_criteria->setSortOrders([$sortOrder]);

        $resultx = $this->_SearchInterface->search($search_criteria);

        $totalSearchResults = $resultx->getTotalCount();

        $products = $resultx->getItems();

        foreach ($products as $product) {

            $id = $product->getId();
            $result[] = $id;

        }

        return $result;

  the only thing that does not work is to sort the results


texts: Magento 2 how to get order id on admin order invoice save?

texts:
How to get order id in invoice using plugin ?
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Sales\Controller\Adminhtml\Order\Invoice\Save">
        <plugin name="admin_plugin_order_invoice_save_after" type="Companyname\Modulename\Controller\Adminhtml\Order\Invoice\Save"/>
    </type>
</config>

Save.php
<?php
namespace Companyname\Modulename\Controller\Adminhtml\Order\Invoice;
ini_set('display_errors',1);
error_reporting(E_ALL);

use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Model\ResourceModel\Order\Invoice\CollectionFactory;

class Save
{
    public function afterExecute(\Magento\Sales\Controller\Adminhtml\Order\Invoice\Save $subject,$result)
    {
        echo "order id ---".$result->getEntityId();
        echo "<pre>";
        print_r($result->getData());

        die;
    }
}

Unable to get anything.
Using this code unable to get order it or invoice id.
Anyone know how to get order id,update order or get invoice id ?


texts: how to convert select option to button in bundle product?

texts:
I want to customize Bundle product template, convert select option to button "Add Item". Convert select,multiselect,checkbox, radio to button to add instead selection. Anyone have a solution or idea on this? How to achieve this?
Like this:
with select, radio:

with select multi, checkbox:

thanks for read.


texts: Position of Error Message Block not changed

texts:
I have a problem with my theme:
The error message is not at the top of the page.

It should be like this:

Now the real problem:
For my test environment I already found a solution, by changing the order of following code in 2columns-left.phtml from

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

TO

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

But in my live environment, there is no change! I already flushed cache, reindexed and compared the both installations (no differences in files). Compiler is not active.

The block above the error message in first pic is the cms_block "index_block".

Any ideas?


texts: Magento2 - How to trigger onchange event on Country/region in Shipping Address

texts:
I want to customize checkout page where I can add my jQuery on change event on country, region field,

So Whenever Customer change field like country,region option few rest of fields like city, zip/Post Code, Address and province change.


texts: magento 2.2.1, why this check out step skip add ''Address' if we add ''configuration product' in to cart?

texts:
Using magento 2.2.1. I cannot add address if i add configuration product into cart.

Does it the role of magento ?
Can i enable the 'shipping step'?

1 'My configuration product'

'Checkout step'


texts: Sporadic, Frequent, Unreproducible 502 Errors during Admin Functions and Frontend Search and Checkout, M2.3.2 Commerce On-Prem w/ Nexcess Cloud Server

texts:
A recently launched a 2.3.2 Magento on-premise on Nexcess with Cloudflare over 2 months ago and have been experiencing sporadic, untraceable, non-reproducible 500 & 502 errors/timeouts that have no apparent trend. Need help figuring out what to try/where to look for debugging.
Tasks on Admin that have resulted in timeouts:

Update customer account information
Creating a customer account
Submitting a new order for an existing/new customer
Moving items to and from cart
Adding items to an order
Updating Sales Rep associated on customer account
Re-ording

Tasks on Frontend that have resulted in timeouts:

Viewing cart and subsequent cart summary pages
Adding product to cart from PDP
Querying product catalog using elastic-search bar

We see these errors, but don't know what they're specifically referring to:

upstream prematurely closed connection while reading response header from upstream
connect() to unix:/cf/socks/nginx-fl.sock failed (11: Resource temporarily unavailable) while connecting to upstream
upstream prematurely closed connection while reading response header
from upstream
no live upstreams while connecting to upstream
upstream timed out (110: Connection timed out) while connecting to upstream

Some tasks/requests that result in a 502 error still complete, however for others it erases the update/create requests; for example, submitting an order, receives timeout error, but the order still processes or on the other hand, the whole new order is deleted.
Earlier on we were able to reproduce the 502 consistently by clicking Reorder on certain orders. In New Relic we saw that  Magento\Sales\Model\AdminOrder\Create::initFromOrderItem was running extremely long (200,000+ ms)and got down to the part that validates the quantity of each item which is Magento\CatalogInventory\Model\Quote\Item\QuantityValidator::validate method which correlates with the reorder process where database table cataloginventory_stock_status.
We have since been able to prevent timeouts from happening during Reorders by bypassing the method to prevent it from validating the quantity of the item which took the shaved off 200,00ms from sales/order_create/reorder; but had no effect on all other occurring timeouts.
Now we have nothing to test with since none of the actions that result in timeouts are reproducible and aren't triggering any flags in New Relic or specific enough error codes in any logs.
We've:

confirmed there is plenty of server bandwidth/CPU
Confirmed normal traffic to site
Confirmed timeouts occur on all order quote types from orders with less than 10 line items to orders with greater than 100 line items
Confirmed timeouts occur on all order quote types from sub total less than $100 to totals greater than $3,000
Increased the max_input_vars to 75000 from 65000.
Changed the default /admin url to protect against DDOS/Brute Force attacks choking the server
Reviewing server logs
Reviewing New Relic
Asked Magento Support
Asked Nexcess Support
Asked Cloudflare Support

Any advice, tips, tricks, resource links, tools, people, or company are welcome.


texts: After upgrading from magento 1 to magento 2.3, existing customer can’t login

texts:
My site is working fine but existing customer can’t login.
Is ther any way to resolve this isssue??


texts: Configurable products being sorted after simple products on category pages

texts: Is there any reason why a category page will sort all simple products a-z then start again with configurable?


texts: I'm creating new Attribute for Category and facing an issue in Magento 2.X

texts:
My Upgrade Script :

<?php
namespace MyCompany\MyModule\Setup;

use Magento\Framework\Module\Setup\Migration;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Catalog\Setup\CategorySetupFactory;

class UpgradeSchema implements UpgradeSchemaInterface
{
    private $categorySetupFactory;

    public function __construct(CategorySetupFactory $categorySetupFactory, EavSetupFactory $eavSetupFactory)
    {
        $this->categorySetupFactory = $categorySetupFactory;
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        //handle all possible upgrade versions

        if(!$context->getVersion()) {
        //no previous version found, installation, InstallSchema was just executed
        //be careful, since everything below is true for installation !
        }

        if (version_compare($context->getVersion(), '1.0.2') < 0)
        {
            //code to upgrade to 1.0.2
            $installer = $setup;

            $installer->startSetup();

            $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);

            $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Category::ENTITY);

            $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);

            $categorySetup->removeAttribute(
                \Magento\Catalog\Model\Category::ENTITY, 'my_attribute`enter code here`' );

            $categorySetup->addAttribute(
                \Magento\Catalog\Model\Category::ENTITY, 'my_attribute', [
                     'type' => 'int',
                     'label' => 'MyAttribute',
                     'input' => 'select',
                     'source' => 'MyCompany\MyModule\Model\Api\Category\Attributeset',
                     'required' => false,
                     'sort_order' => 1,
                     'visible'       => 1,
                     'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                     'group' => 'General',
                ]
            );

            $installer->endSetup();
        }
        $setup->endSetup();
    }
 }
 ?>

After setup:upgrade I Got error in composer:

  Fatal Error: Declaration of
  MyCompany\Mymodule\Setup\UpgradeSchema::upgrade() must be compatible
  with Magento\Framework\Setup\UpgradeSchemaInterface::upgrade()


texts: Magento 2.2.7 - how to set 3 products i row instead of 4 in grid

texts: How to set 3 products per row instead of 4 ?


texts: Magento2 - Nginx : Not able to install getting 404 error

texts:
I'm running Apache and Nginx on Ubuntu 14.04 machine.
Nginx + PHP7.0-FPM configured on 8080 port and apache is on 80 ( default port ).

Stack :

PHP Version : 7.0.14-1
Nginx : nginx/1.4.6 (Ubuntu)
Magento version : 2.1.2
Installation method : Magento Composer

Configuration file created here /etc/nginx/sites-available/magento2.

Below code used in file.

upstream fastcgi_backend {
           server 127.0.0.1:9000;
    }

    server {

            listen 8080;
            server_name 127.0.0.1:8080;
            set $MAGE_ROOT /usr/share/nginx/html/magento2/project-community-edition/;
            set $MAGE_MODE developer;
            include /usr/share/nginx/html/magento2/project-community-edition/nginx.conf.sample;
    }

404 Error while loading angular.js resource

Similar to this problem :

Blank page on Magento 2.0 install on LEMP
https://stackoverflow.com/a/35445606/1942109


texts: Magento 1.9 Add an optional customer attribute on registration form only for my Brasilian shop?

texts: I want to show a customer attribute on registration form and provide to edit that one on user profile, but only for my Brasilian customers?


texts:
I follow this tutorial to use Ajax request in my button: http://www.atwix.com/magento/add-button-to-system-configuration/

But clicking on the button I get the error "Not Found 404" to url:

  http://127.0.0.1:8080/316store/index.php/admin/adminhtml_mateusvitali_sigepweb_options/check/key/ab6b3729a1d318e6d7bd970c5b8d333e/?isAjax=true&&...

My button.phtml

location: /app/design/adminhtml/default/default/template/mateusvitali/system/config/button.phtml

<script type="text/javascript">
    //<![CDATA[
    function check() {
        new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
            method:     'get',
            onSuccess: function(transport) {
               alert('Sent notification.');
            },
            onFailure: function(transport) {
               alert("Couldn't send a notification.");
            }
        });
    }
    //]]>
</script>

<?php echo $this->getButtonHtml() ?>

My Button.php

location: /app/code/local/MateusVitali/SigepWeb/Block/Adminhtml/System/Config/Form/Button.php

class MateusVitali_SigepWeb_Block_Adminhtml_System_Config_Form_Button extends Mage_Adminhtml_Block_System_Config_Form_Field
{
    /*
     * Set template
     */
    protected function _construct()
    {
        parent::_construct();
        $this->setTemplate('mateusvitali/system/config/button.phtml');
    }

    /**
     * Return element html
     *
     * @param  Varien_Data_Form_Element_Abstract $element
     * @return string
     */
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        return $this->_toHtml();
    }

    /**
     * Return ajax url for button
     *
     * @return string
     */
    public function getAjaxCheckUrl()
    {
        return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_mateusvitali/check');
    }

    /**
     * Generate button html
     *
     * @return string
     */
    public function getButtonHtml()
    {
        $button = $this
            ->getLayout()
            ->createBlock('adminhtml/widget_button')
            ->setData(
                array(
                    'type'      => 'button',
                    'id'        => 'mateusvitali_update',
                    'label'     => $this->helper('adminhtml')->__('Check'),
                    'onclick'   => 'javascript:check(); return false;'
            )
        );

        return $button->toHtml();
    }
}

My MateusVitaliController.php

location: /app/code/local/MateusVitali/SigepWeb/controllers/Adminhtml/MateusVitaliController.php

class MateusVitali_SigepWeb_Adminhtml_MateusVitaliController extends Mage_Adminhtml_Controller_Action
{
    /**
     * Return some checking result
     *
     * @return void
     */
    public function checkAction()
    {
        $successCode = 1;
        Mage::app()->getResponse()->setBody($successCode);
    }
}


texts: Magento quick search results displaying all on one page

texts:
I'm currently developing a website for a client, which seems to have created a problem for itself... Or I have, but I can't figure out where or how?!

Basically, using the quick search, it will display all the results on the same page.... Even if there are 3,000 results!

The pagination is set up correctly, for both grid & list. The toolbar displays the amount of pages there should be, yet still displays all results on the single page.

Layered navigation is set up and showing.

I'm not sure if I'm allowed to display URL's on here, but if I am an example search is here: http://dev.cblsupplies.co.uk/catalogsearch/result/index/?cat=63&q=light

As you can, it's having a negative impact on performance due to the vast amount of results!

I'm really stumped on this one, I've searched and searched for a resolution - but I'm unable to find one. If anyone could point me in the right direction I'd be eternally grateful.


texts: How to add code after opening  tag in Magento?

texts:
I have a recently found a couple of tags that recommend install the code directly beneath the opening  tag. This is the recommended install location for LiveEngage Tag and Google Tagmanager.

You can add code easily before the closing  tag under General > Design > Footer > Miscellaneous HTML

How can we achieve the same functionality immediately after the opening  tag?


texts: Magento2 - I want to show custom quote item field to checkout page

texts:
I want to show custom quote item field to Checkout Page.
I don't know how would I do that. I've added one custom drop down to Cart page and selected value I saved in quote_item table now I want that value show in checkout page.
here I attached screenshot
Would be great If someone can help.
Thanks


texts: How to set the order of the query as descending

texts:
I have created a query that would allow me to sort my products based on the quantity they have been ordered. But when I print the query, the quantity ordered is coming in Ascending order. I want to make it work in descending order. The query is as below

$toDate =  date("Y-m-d h:m:s", strtotime('tomorrow') - 1);
$fromDate = date("Y-m-d h:m:s", strtotime("-1 months"));
$this->getSelect()->joinLeft(array('sfoi' => $this
->getTable('sales/order_item')),
 "e.entity_id = sfoi.product_id AND sfoi.created_at BETWEEN
 '{$fromDate}' AND '{$toDate}'",
array('qty_ordered' => 'SUM(sfoi.qty_ordered)'))
            ->group('e.entity_id')
            ->order("qty_ordered {$dir}");
            return $this;

Can anyone kindly let me know how to do this? I just want to change the order of "qty_ordered" From ASC to DESC


texts:
Which observer could I use to get the coupon code inserted by the customer when this is not valid on checkout cart page?

I tried using the salesrule_validator_process but coupon code is null when it's not valid. I'm using the following code to get it:

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


texts: Modifying the redirect after editing a product in the cart

texts:
I have a problem modifying a redirect in magento CE 1.9.2.

Let's say a customer has a configurable product in the cart, and would like to edit that product (ie. changing color or size or something).

After changing the options and clicking the 'update cart' button I want the customer to stay on the same page (ie. the edit product page). However magento always redirect back to the cart page.

I think I've found source of the problem, in CartController.php from the Checkout module:

/**
 * Update product configuration for a cart item
 */
public function updateItemOptionsAction()
{
    $cart   = $this->_getCart();
    $id = (int) $this->getRequest()->getParam('id');
    $params = $this->getRequest()->getParams();

    if (!isset($params['options'])) {
        $params['options'] = array();
    }
    try {
        if (isset($params['qty'])) {
            $filter = new Zend_Filter_LocalizedToNormalized(
                array('locale' => Mage::app()->getLocale()->getLocaleCode())
            );
            $params['qty'] = $filter->filter($params['qty']);
        }

        $quoteItem = $cart->getQuote()->getItemById($id);
        if (!$quoteItem) {
            Mage::throwException($this->__('Quote item is not found.'));
        }

        $item = $cart->updateItem($id, new Varien_Object($params));
        if (is_string($item)) {
            Mage::throwException($item);
        }
        if ($item->getHasError()) {
            Mage::throwException($item->getMessage());
        }

        $related = $this->getRequest()->getParam('related_product');
        if (!empty($related)) {
            $cart->addProductsByIds(explode(',', $related));
        }

        $cart->save();

        $this->_getSession()->setCartWasUpdated(true);

        Mage::dispatchEvent('checkout_cart_update_item_complete',
            array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse())
        );
        if (!$this->_getSession()->getNoCartRedirect(true)) {
            if (!$cart->getQuote()->getHasError()) {
                $message = $this->__('%s was updated in your shopping cart.', Mage::helper('core')->escapeHtml($item->getProduct()->getName()));
                $this->_getSession()->addSuccess($message);
            }
            $this->_goBack();
        }
    } catch (Mage_Core_Exception $e) {
        if ($this->_getSession()->getUseNotice(true)) {
            $this->_getSession()->addNotice($e->getMessage());
        } else {
            $messages = array_unique(explode("\n", $e->getMessage()));
            foreach ($messages as $message) {
                $this->_getSession()->addError($message);
            }
        }

        $url = $this->_getSession()->getRedirectUrl(true);
        if ($url) {
            $this->getResponse()->setRedirect($url);
        } else {
            $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());
        }
    } catch (Exception $e) {
        $this->_getSession()->addException($e, $this->__('Cannot update the item.'));
        Mage::logException($e);
        $this->_goBack();
    }
    $this->_redirect('*/*');
}

The call to $this->_goBack() in the end of the try-block seems to set the redirect URL correctly by looking at settings and a 'return_url' parameter (and I've verified that the code gets this far). But, as you can see, the last line always sets a redirect to */* no matter what. Just adding a return statement after the _goBack() call fixes the problem but I rather do this without modifying the core files.

Any ideas how I can solve this problem?


texts: How to Set Anchor to YES in all Categories in Magento 2

texts:
I followed
https://steemit.com/magento/@meetanshi/how-to-set-anchor-to-yes-in-all-categories-in-magento-2

It work, but i have more store view. In my catalog_category_entity_int table there is no attribute = 43 for store_id = 2 or 3. How to set is anchor to yes for all category in all store. Please help me

UPDATE

I can't find category id = 316 in catalog_category_entity? Where is i can find it?


texts: Not able to get parent_item_id for cart items retrieved from Order - Magento 2.3.5

texts:
I'm trying to get parent_item_id but it is returning null for all simple child products.
    $order = $observer->getEvent()->getOrder();
    $items = $order->getAllVisibleItems();
    foreach ($items as $item) {
            $itemsData[] = [
                'name' => $item->getName(),
                'sku' => $item->getSku(),
                'quote_item_id' => $item->getQuoteItemId(),
                'parent_item_id' =>$item->getParentItemId(),
                'qty_ordered' => $item->getQtyOrdered(),
                'product_type' => $item->getProductType(),
                'weight' => $item->getWeight(),
                'price' => $item->getPrice()
            ];
    }

I'm getting all item attributes in my $itemsData array except parent_item_id, though I've 4 children of a Bundle product and 1 child of a configurable product in Cart.
I'm doing it in sales_order_place_before observer. I tried getAllItems() and getItems() as well but no luck. Also confirmed from database, parent_item_id exists there for quote_item_id, but just not able to retrieve via getter method.


texts: Order items is empty when customer logged-in

texts:
I'm use following code to catch order information in this Observer : "sales_order_save_after"

public function execute(\Magento\Framework\Event\Observer $observer){

 $orderData = $observer->getEvent()->getOrder()->getData();
 $orderId = $orderData['increment_id'];
 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
 $order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($orderId);
 $orderItems = $order->getItems();

 foreach ($orderItems as $item) {

     error_log(print_r($item->getData(), true));

 }

}

When I place order as guest customer it logs information of all items, But when I Login as a customer and placing order it doesn't log anything because "items" Array is empty.

How can I get item information from order of customer that is logged-in?


texts: How to filter customer Group by customer id

texts:
I need to get customer group for each customer in my site. I can get customer group list as below,

$customerGroupsCollection = $objectManager>get('\Magento\Customer\Model\ResourceModel\Group\Collection');
$customerGroups = $customerGroupsCollection->toOptionArray();
foreach ($customerGroups as $key => $value) {
//print_r($value);
echo $value['label'];
}

How can I filter this by customer Id? I cannot use CustomerSession to get customer information since I need to retrieve each and every customer's data whenever needed.

I got customer data as follows,

$customer = $objectManager->create('Magento\Customer\Model\Customer')->getCollection();
foreach ($customer as $cusitem) {
$customerId = $cusitem->getData('entity_id');
}

How can I combine these two and get customer group for each customer?

Ex:

Have 10 customers(1-10), and have 3 customer groups (A,B,C).
How to get each customer's group name?

if customer is 1, How to get 1's group?


texts: Bundle product not display in fronted magento2

texts:
When bundle product to add virtual products as associate options then bundle product display but I added simple products as associate options not display in frontend. can you please anyone help me.

Thanks in advance.


texts: Adding form field values into customer_address_entity_varchar Magento 1.7

texts:
I have added custom fields into the default registration page since it does not offer a user to create an account and add Company, Phone number, Website, etc. from the very first page. I have been following the guide here I have it adding the info into the database but I would like to add some of the info into the "customer_address_entity_varchar" table like the Phone, Company, Fax and the Address fields. I believe I would set this in AccountController.php since I am not creating a module.

This is the current code that the tutorial is telling me to put in I modified the parameter name to Company instead of Occupation.

 if($this->getRequest()->getParam('company')) {
     $customer->setCompany($this->getRequest()->getParam('company'));
 }

It will not add the field inside of the "customer_address_entity_varchar" it will add it to "customer_entity_varchar". I am sure it is just a simple change.

For clarification in Magento’s default installation when you register a new account it will ask you for “First and last name, Email, Password” After you login to your account it will let you add the default address for billing and shipping along with a phone number and other linformation. The Fax, Phone, City, State, Zip, Country are added to the “customer_address_entity_varchar” table after you add these under “My Account” I would like values of the custom fields I have added following the below tutorial to be added to the “customer_address_entity_varchar” table during registration. How do I do this?


texts: Order email does not translate when I choose check / money order as payment method

texts:
I have:

A Magento 2 shop (translated to dutch)
Using a Magento extension/module (Multisafepay) to use iDeal payment platform
Next to this, I'm using a Magento 2 native payment method Check / Money Order.

When I choose iDeal as payment method Magento sends out the order confirmation in dutch (this is correct).
But, when I choose Check / Money Order the shop sends out an English confirmation email. How can I fix this?


texts:
In my Magento Admin panel when I entering in a section, looks like is not detecting soap extension like this:

But in my phpinfo is enabled:

The specific section is licenses from a extension called venustheme

Thank you in advance!


texts: Magento2 Place Order Without billing address and payment Method

texts: i don't want billing address on my checkout page and i achieved this but when product price is 0 billing address not showing and payment method also not showing i want to place order without both billing address and payment method.


texts: Magento 2.2.4 Backend menu issue not working except catalog>Category page and shows 2 errors

texts:
Fatal error: Uncaught Error: Call to a member function setActive() on boolean in vendor\magento\module-backend\Model\View\Result\Page.php on line 27
Error: Call to a member function setActive() on boolean in vendor\magento\module-backend\Model\View\Result\Page.php on line 27

Here is what I tested

1) When I disable all the modules It works fine and If I enable any single custom module It throws an error as above mentioned.

2) I tried all the commands for setup upgrade, compilation, cache flush, cache clean, static content deploy and developer mode and production mode as well.

2) Some solution suggested that to remove generation/metadata/global.php, I tried but no luck.

I'm using wamp+win10, PHP 7.1.16, Apache 2.4.~ and mysql5.7.21


texts: How to develop a multi-column drop-down for admin/backend form

texts:
In the process of creating a basic extension. I have a field in my backend form that is dynamically linked to all the SKUs in the catalog. When an admin clicks on it, they can select the SKU they would like to use for our purposes. The code is as followed:

$products = array();
$productCollection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSort('sku', 'asc');
$i = 1;
$items = $productCollection->getData();
foreach($items as $item) {
$products[$i]['value'] = $item['sku'];
$products[$i]['label'] = $item['sku'];
$i++;
}

        $fieldset->addField('sku', 'select', array(
      'label'     => Mage::helper('bannerslider')->__('SKU'),
      'class'     => 'required-entry',
      'required'  => true,
      'values'    => $products,
      'name'      => 'sku',
  ));

I'm thinking I could just include more addAttribute entries to include as many columns from the catalog listings as necessary but I'm sure there is more to it than that.

The end result is a dropdown that is sorted by SKU but shows other row data in a helpful manner that makes the SKU easier to narrow down and allows the admin to select the SKU intelligently. How much I achieve this? Thanks.

A visual example of what I'm referring: https://stackoverflow.com/questions/11762395/ms-access-display-two-columns-in-combo-box


texts: Magento 2.2.4 Reset password of user using Rest API in (react-native)

texts:
How to Re-set customer account password through Rest Api?

Which fields should we send in Api body to reset the password?


texts:
I am trying to add new customer from admin panel that shows an error:

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

the error is No such entity with formCode = adminhtml_customer. Does anyone have solution for it?


texts: Magento 2 trying to add an category attribute: DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding?

texts:
I'm trying to add an attribute to the categories, but i'm unable to add the attribute to the admin view by adding the ui_component xml document (module/test/view/adminhtml/ui_component/category_form.xml). See the xml document below

<?xml version="1.0" encoding="UTF-8"?>
        <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
            <fieldset name="general">
                <field name="custom_attribute">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="sortOrder" xsi:type="number">50</item>
                            <item name="dataType" xsi:type="string">varchar</item>
                            <item name="formElement" xsi:type="string">input</item>
                            <item name="label" xsi:type="string" translate="true">Custom field</item>
                            <item name="default" xsi:type="number">0</item>
                        </item>
                    </argument>
                </field>
            </fieldset>
        </form>

I'm getting the folling code (in short)
1 exception(s):

  Exception #0 (Exception): Warning: DOMDocument::loadXML():

Input is not proper UTF-8, indicate encoding !

What am I doing wrong?


texts: how to include a javascript file in the layout

texts:
I want to add a custom js file. So I added

<action method="addItem"><type>skin_js</type><name>js/load.js</name></action>

in

app/design/frontend/package_name/theme_name/layout/page.xml

and added that js file into

skin/frontend/package_name/theme_name/js/load.js

But the javascript is not working. Kindly someone guide me.


texts: Magento 2 How to remove tax from checkout?

texts:
I'd like to remove tax from cart and checkout.
Now it shows 0 or "Not yet calculated" text.

I've already remove estimated shipping and tax by comment out code from
vendor/magento/module-checkout/view/frontend/templates/cart/shipping.phtml
but i just cant find this section.

In my admin panel all options under Tax is set to "No" or "Excluding Tax"


texts: Override layout by XML to use custom template

texts:
I am trying to use a custom addtocart.phtml.

Currently magento is using app/design/frontend/default/customtheme/template/catalog/product/view/addtocart.phtml

I want to change it to app/design/frontend/base/default/template/my_module/catalog/product/view/addtocart.phtml

I created a module and this is a part of my config.xml:

<layout>
        <updates>
            <My_Module>
                <file>my_module.xml</file>
            </My_Module>
        </updates>
      </layout>
    </frontend>

The file my_module.xml is located at app/design/frontend/base/default/layout/my_module.xml

Can anybody help?


texts: Time is not getting saved from magento admin form?

texts:
I have created a field in custom admin form with following code

$fieldset->addField('post_date', 'date', array(
        'label' => Mage::helper('sprung_blog')->__('Date'),
        'name'  => 'post_date',
        'required'  => true,
        'class' => 'required-entry',
        'image' => $this->getSkinUrl('images/grid-cal.gif'),
        'format'  => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
    ));

But its only saving the date i have selected.How can i get the time too.

In my saveAction i have following too

$data = $this->_filterDates($data, array('post_date'));

I have tried by changing it to

$fieldset->addField('post_date', 'date', array(
        'label' => Mage::helper('sprung_blog')->__('Date'),
        'name'  => 'post_date',
        'required'  => true,
        'class' => 'required-entry',
        'image' => $this->getSkinUrl('images/grid-cal.gif'),
        'time' => true,
        'format'  => Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
    ));

Now i can see time in field.But in controller it comes as [post_date] => 2014-07-24


texts: Is it possible to make agreements fields not required?

texts:
is it possible to make agreements fields on checkout billing screen not required?
They are added from Stores -> Terms and Conditions in admin panel.


texts: Charge destination based tax on virtual products

texts:
More and more U.S. states are requiring merchants to collect sales tax on digital goods, however I cannot figure out how to get Magento to include tax on virtual and downloadable products when tax is configured to be calculated on shipping address:

Even if we assign a "Taxable Goods" or some similar tax class to the product, sales tax is not charged because orders for virtual and downloadable products do not include a shipping address.
How can Magento be configured to collect sales tax on these types of products in states where the tax calculation is destination based?


texts: How can i extend magento 2 ListProduct Block class in any Php class and how can i used that?

texts:
class My_Catalog_Block_Product_List extends \Magento\Catalog\Block\Product\ListProduct
{

}

productTemplate = 'product.phtml';
$productList = new My_Catalog_Block_Product_List();
$productList->getItemHtml($productTemplate, $product);


texts: how to edit/delete external css link in head

texts:
I've just recently updated my SSL certificate but now my site shows a mixed content warning:

Mixed Content: The page at 'https://www.ecosaver.com/' was loaded over
HTTPS, but requested an insecure stylesheet
'http://fonts.googleapis.com/css?family=Exo:300,400,600'. This request
has been blocked; the content must be served over HTTPS.

So it seems I just need to edit (or last resort delete) that particular style sheet link in my <head>. I've tried  <action method="removeItem"> in local.xml to no avail. I may be using the wrong syntax or maybe I'm completely off and doing something else wrong. I've just started with Magento so still trying to get the hang of it. I'm using Magento V. 1.7.0.2 Thanks very much for any suggestions!


texts: Add custom javascript after js components load

texts:
I'm still a novice when it comes to Magento 2 frontend with jsLayout, requireJS, etc. I have a custom module where, in javascript, I am trying to attach an onchange listener to the email textbox. I tried going the simple route by including a .phtml file via layout.xml:
checkout_index_index.xml
<referenceContainer name="after.body.start">
      <block class="Magento\Framework\View\Element\Template" name="sf.checkout.trackuser" as="sf.checkout.trackuser"
          after="sf.ads.default" template="MyVendor_SF::checkout-track-user.phtml" />
</referenceContainer>

checkout-track-user.phtml
<script>
require(['jquery'], function($) {
    $(document).ready(function() {
        $("input#customer-email").on("change", function(e) {
            //console.log('yay');
        });
    });
});

However, when my js runs, the input#customer-email element is not yet loaded on the page, even when put inside $(document).ready(function() {});. How can run my js code after this textbox has loaded on the page?
My guess is that I need to add a component to the checkout jsLayout, but I am not sure how to go about doing this. I've looked at docs and examples, and currently, I have:
<body>
    <referenceContainer name="after.body.start">
        <block class="Magento\Framework\View\Element\Template" name="sf.checkout.trackuser" as="sf.checkout.trackuser"
               after="sf.ads.default" template="MyVendor_SF::checkout-track-user.phtml" />
    </referenceContainer>

    <referenceContainer name="content">
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="component" xsi:type="string">MyVendor_SF/js/track-checkout-guest</item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </referenceContainer>
</body>

I have no clue how I would code track-checkout-guest.js though.. in my case I don't think it's an actual component (no .html template or knockoutJS involved), so I'm not sure what to do.


texts: Add product on order through admin doesn't work. Magento 2 fresh install

texts:
When I create a new order and I want to add some products it looks like he is adding it. It shows a loader but when it's done nothing is added. I also have it on my normal webshop but I though let's try a fresh install of magento 2.2.4.

The same issue. How weird!


texts: SUPEE-9767 issue : Add to cart issue, Enterprise Full Page Cache

texts:
Shortly after applying the SUPEE-9767 patch we started to receive complaints from customers that products could not be added to cart from the product detail page.

We are sometimes able to reproduce the issue, but sometimes not.

We are on a fully patched version of EE 1.14.2.2.

Disabling full page cache resolves the issue.


texts: Magento 2.2.6 | Uncaught Error: Undefined class constant 'CACHE_TAG'

texts:
I am very new to Magento, i created a CRUD custom module, when I input some data in form, and hit save button, I got an error like this:

Fatal error: Uncaught Error: Undefined class constant 'CACHE_TAG' in
C:\xampp\htdocs\test-local\app\code\Testing\SimpleNews\Model\News.php:9
Stack trace: #0 C:\xampp\htdocs\test-local\vendor\magento\framework\App\Cache\Tag\Strategy\Identifier.php(25):Testing\SimpleNew\Mode\News->getIdentities()
#1 C:\xampp\htdocs\test-local\vendor\magento\framework\App\Cache\Tag\Resolver.php(43): Magento\Framework\App\Cache\Tag\Strategy\Identifier->getTags(Object(Testing\SimpleNews\Model\News))
#2 C:\xampp\htdocs\test-local\vendor\magento\module-page-cache\Observer\FlushCacheByTags.php(64): Magento\Framework\App\Cache\Tag\Resolver->getTags(Object(Testing\SimpleNews\Model\News))
#3 C:\xampp\htdocs\test-local\vendor\magento\framework\Event\Invoker\InvokerDefault.php(72): Magento\PageCache\Observer\FlushCacheByTags->execute(Object(Magento\Framework\Event\Observer))
#4 C:\xampp\htdocs\test-local\vendor\magento\framework\Event\Invoker\InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\ in C:\xampp\htdocs\test-local\app\code\Testing\SimpleNews\Model\News.php on line 9

This is my htdocs\test-local\app\code\Testing\SimpleNews\Model\News.php code:

<?php

namespace Testing\SimpleNews\Model;

class News extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\DataObject\IdentityInterface
{
    public function getIdentities()
    {
        return [self::CACHE_TAG . '_' . $this->getId()];
    }

    public function getDefaultValues()
    {
        $values = [];

        return $values;
    }

    /**
     * Define resource model
     */
    protected function _construct()
    {
        $this->_init('Testing\SimpleNews\Model\Resource\News');
    }
}


texts:
<update handle="page_one_column" />

These both set the template to 1page. Is there any reason to use one over the other?

<reference name="root">
  <action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>

I have noticed that both of these seem to have the same effect (making the page use the 1column.phtml template) but I'm sure there are subtle differences that only a Magento expert would know about. Is there any reason to use one over the other? I like the flexibility of using the update handle, but it seems like it could have unintended repercussions.

The first question that comes to mind is: does the page_one_column handle override the page_two_columns_left handle that is already there? Could this cause the page to have both handles?

Edit[Clarification]: I understand that  <page_one_column> is a layout handle, and it can be "applied" by calling <update handle="page_one_column" />. What I don't understand (and want to know) is if this can cause any negative side-effects. I myself can't think of any edge cases where this might break something, but it seems like they could exist. I can't really know for sure without digging deep into the code and trying to break stuff.


texts: Magento 2 - I get logged out from backend/admin if I change a setting

texts:
I am getting logged out from the backend if I am changing a setting in a amasty extension.
How can I debug it to find it out what is causing it?


texts: images not switch when click on color swatches in magento

texts:
When I click on colour swatches image is not changing. I do all the settings right. Colour swatches view with product but images is not changing. view this link.
view problem

Please any one help me.