texts:
I have a number of Magento sites running on Amazon and I have to turn off APC or I will get blank pages in the Magento Admin area. It only happens in admin.

Does anyone else have APC issues with Magento Admin?

Is there a work around for this?

EDIT:

 php -v
PHP 5.4.45 (cli) (built: Sep 11 2015 21:23:18)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

APC version 3.1.15-dev

Just an interesting update: We received an error this morning from a Nexcess server

  When these show up, it is very often an issue with apc opcode caching. Sometimes, for as yet unknown reasons, magento with not play
  nice with this php feature. some compiled php code will get saved in
  it, but the next time that part of the code is needed, what is cached
  is not compatible and the php process dies.

  To test this after getting random errors at various parts of the checkout process, I restarted php-fpm, which clears out the apc opcode
  cache, and I stopped getting the errors. But since it looks like this
  was also restarted last night, the issues will likely return if this
  was the cause. I can disable apc opcode caching for your setup, which
  will very likely clear this up. Would you like me to disable apc
  opcode caching in php?


texts: Tranfers data between two columns in eav_attribute table


texts: Show Grid under Custom Tab in CMS Page Information Section in Magento Admin

texts:
I have made a custom module in magento admin. In which I am showing a custom tab on CMS page area as shown in below image.

I have a custom form on click on "My Button". I fill that form and value is properly inserted in DB.

Now I want to show Grid for saved data under my custom tab for that form.

How can I do this on CMS Page area in Magento admin..?

Please help me to get rid of this problem.

Thanks


texts: How to get customer balance (ee version store credit) in getCustomerDataObject?

texts:
I have a observer have the following similar code like this, i want to get the changed balance

    /** @var \Magento\Customer\Model\Data\Customer $customer */
    $customer = $observer->getEvent()->getCustomerDataObject();
    $email = $customer->getEmail();

    /** @var \Magento\Customer\Model\Data\Customer $customerOrig */
    $customerOrig = $observer->getEvent()->getOrigCustomerDataObject();
    $emailOrig = $customerOrig->getEmail();

but how to get the customer balance in getCustomerDataObject?


texts:
I can successfully override other blocks but I couldn't extend Mage_Checkout_Block_Cart_Item_Renderer.

<?xml version="1.0"?>
<config>
    <modules>
        <Test_Checkout>
            <version>0.0.1</version>
        </Test_Checkout>
    </modules>
    <global>
        <blocks>
            <test_checkout>
                <class>Test_Checkout_Block</class>
            </test_checkout>
            <checkout>
                <rewrite>
                    <cart_item_renderer>Test_Checkout_Block_Cart_Item_Renderer</cart_item_renderer>
                </rewrite>
            </checkout>
        </blocks>
        <helpers>
            <test_checkout>
                <class>Test_Checkout_Helper</class>
            </test_checkout>
        </helpers>
    </global>
</config>

And here's my block file Renderer.php inside Test/Checkout/Block/Cart/Item inside local folder:

class Test_Checkout_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_Item_Renderer
{}

But it's not picking up the functions inside my custom block.

Any ideas?


texts:
After running a specific query in my DB, the entire DB is very very slow.

I can see a huge decrease in performance on my 1.9.3.3 store.

I did run the following query, which did not complete:

SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `index_event`;
SET FOREIGN_KEY_CHECKS=1;

I got the error; Cannot truncate a table referenced in a foreign key constraint

After that, the DB is very slow. Load on pages on backend and frontend +2 sec.

What causes this issue and how can I solve this?

UPDATE: When enabling Product Flat Data index, I get the error that there was a error with indexing. This worked perfectly before.


texts: Can't install Magento 2 due to permissions issue

texts:
I am stuck in the installation of new copy of Magento 2.1.3. I downloaded tar.bz2 archive from the site into the apache root folder of my CentOS 7 machine. I extracted it with the command

tar jxf Magento-CE-2_1_3_tar_bz2-2016-12-13-09-10-13.tar.bz2

when I was logged as the root user. Then I executed the permissions commands as Magento dev docs suggests:

find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
chmod u+x bin/magento

Then, I finally navigated to http://mycentosurl/magento2, but what I get is not the wizard installation but this error:

Uncaught exception 'Magento\Framework\Exception\FileSystemException' with message 'The file "/var/www/html/magento2/var/.regenerate" cannot be deleted

What am I doing wrong?


texts: Unable to run magento 2 commands after upgrade

texts:
I upgraded magento 2.1.4 to 2.3.5p1. I first upgraded it to 2.2.3 and then to 2.3.5 through command line.
After upgrade, I am getting Fatal error: Uncaught InvalidArgumentException: Unable to unserialize value. Error: Syntax error in /var/www/production/vendor/magento/framework/Serialize/Serializer/Json.php:39  on frontend and unable to run any magento command in terminal.
In terminal it gives error  - "Unable to unserialize value. Error: Syntax error"
Please provide a solution to this.
Checked all permissions and ownership also.


texts:
How to auto Generate Critical Path CSS using Penthouse or Critical for Magento 2.

Reff:

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css-critical-path.html

https://www.npmjs.com/package/penthouse

https://www.npmjs.com/package/critical


texts: Packing a extension for connect with an CI

texts:
Trying to build my extensions more automatically and without magentos GUI. I've wrote a little script, based on a blog post by Sven Varkel, it pulls a vanilla magento source base and my extension, puts everything together but the resulting .tgz file only contains the package.xml.

At first I got this error:

Notice: Trying to get property of non-object in /home/rof/build/downloader/lib/Mage/Connect/Validator.php on line 472

Call Stack:
0.0004     309704   1. {main}() /home/rof/build/downloader/mage.php:0
0.0006     319296   2. __cli_Mage_Connect->run() /home/rof/build/downloader/mage.php:155
0.0048     864624   3. __cli_Mage_Connect->runCommand() /home/rof/build/downloader/mage.php:147
0.0052     926576   4. Mage_Connect_Command->run() /home/rof/build/downloader/mage.php:119
0.0052     926912   5. Mage_Connect_Command_Package->doPackage() /home/rof/build/downloader/lib/Mage/Connect/Command.php:160
0.0090    1322104   6. Mage_Connect_Package->save() /home/rof/build/downloader/lib/Mage/Connect/Command/Package.php:71
0.0090    1322104   7. Mage_Connect_Package->validate() /home/rof/build/downloader/lib/Mage/Connect/Package.php:220
0.0092    1336000   8. call_user_func_array:{/home/rof/build/downloader/lib/Mage/Connect/Package.php:1234}() /home/rof/build/downloader/lib/Mage/Connect/Package.php:1234
0.0092    1336424   9. Mage_Connect_Validator->validateContents() /home/rof/build/downloader/lib/Mage/Connect/Package.php:1234

Done building package

I've look into that file and it reads like it's trying to access an object called config so I replaced that line with an hardcoded path. That's how i fixed the notice. But still nothing shows up in my .tgz file and when i execute ./mage package ... it says my files already exists. If i delete them it works but still nothing else than package.xml in my .tgz file.

Questions:.. Does nobody have an existing solution ? Can't imagine i'm the only one facing the problem of deploying updates to multiple extensions rapidly i guess.. Secondly why my script isn't working cause i can't tell.


texts: I want to join entity_id column from customer_entity table with customer_id from new_info table and want to get department column value of given customer.


texts:
I have a special requirement for my website. Please see the following point and provide me an appropriate suggestion on how to do this.

Requirements:

A user sees the product price only after logging in.
Product price is different according to their user group.


texts: How do you add custom styling to radio buttons in the shipping method section of Magento 2 checkout?

texts:
I am trying to add a custom style to radio buttons in the shipping method on the magento 2 checkout.

Now normally I would do something like this...

        [type="radio"]:checked,
        [type="radio"]:not(:checked) {
            position: absolute;
            left: -9999px;
        }

        [type="radio"]:checked + label,
        [type="radio"]:not(:checked) + label {
            position: relative;
            padding-left: 28px;
            cursor: pointer;
            line-height: 20px;
            display: inline-block;
            color: #666;
        }

        [type="radio"]:checked + label:before,
        [type="radio"]:not(:checked) + label:before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 18px;
            height: 18px;
            border: 1px solid #ddd;
            border-radius: 100%;
            background: #fff;
        }

        [type="radio"]:checked + label:after,
        [type="radio"]:not(:checked) + label:after {
            content: '';
            width: 12px;
            height: 12px;
            background: @color-coral;
            position: absolute;
            top: 4px;
            left: 4px;
            border-radius: 100%;
            -webkit-transition: all 0.2s ease;
            transition: all 0.2s ease;
        }

        [type="radio"]:not(:checked) + label:after {
            opacity: 0;
            -webkit-transform: scale(0);
            transform: scale(0);
        }

        [type="radio"]:checked + label:after {
            opacity: 1;
            -webkit-transform: scale(1);
            transform: scale(1);
        }

... but kindly Magento puts this input into a table with no label.

How would suggest I style the radio button?

I am happy to make changes to the template files is necessary but I don't really understand where to look or what to change.

Any suggestions would be met with much gratitude.


texts: How to show "out of stock" child products for configurable product in list and product view page magento 2?

texts:
I am trying to show out of stock child products for configurable product in details and product view.I changed the settings from catalog inventory to display out of stock products even it is not showing.
 I tried below code but not working.

  Data.php

<?php
namespace Vendor\Firstmodule\Helper;

use Magento\Catalog\Model\Product;

class Data extends \Magento\ConfigurableProduct\Helper\Data
{

    protected $imageHelper;
    protected $_productloader;
    protected $stockRegistry;
    protected $_storeManager;

    public function __construct(
        \Magento\Catalog\Helper\Image $imageHelper,
        \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry,
        \Magento\Catalog\Model\ProductFactory $_productloader,
        \Magento\Store\Model\StoreManagerInterface $storeManager
        )
    {
        $this->imageHelper = $imageHelper;
        $this->stockRegistry = $stockRegistry;
        $this->_productloader = $_productloader;
        $this->_storeManager = $storeManager;
        parent::__construct($imageHelper);
    }

     public function getOptions($currentProduct, $allowedProducts)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
       // $stockRegistry = $objectManager->get('Magento\CatalogInventory\Api\StockRegistryInterface');
        $options = [];
        foreach ($allowedProducts as $product) {
            $productId = $product->getId();
            $product = $objectManager->get('Magento\Catalog\Model\Product')->load($productId);
            $stockitem = $this->stockRegistry->getStockItem($product->getId(), $product->getStore()->getWebsiteId());
            if($stockitem->getQty() == 0) continue;
            $images = $this->getGalleryImages($product);
            if ($images) {
                foreach ($images as $image) {
                    $options['images'][$productId][] =
                        [
                            'thumb' => $image->getData('small_image_url'),
                            'img' => $image->getData('medium_image_url'),
                            'full' => $image->getData('large_image_url'),
                            'caption' => $image->getLabel(),
                            'position' => $image->getPosition(),
                            'isMain' => $image->getFile() == $product->getImage(),
                        ];
                }
            }
            foreach ($this->getAllowAttributes($currentProduct) as $attribute) {
                $productAttribute = $attribute->getProductAttribute();
                $productAttributeId = $productAttribute->getId();
                $attributeValue = $product->getData($productAttribute->getAttributeCode());
                $options[$productAttributeId][$attributeValue][] = $productId;
                $options['index'][$productId][$productAttributeId] = $attributeValue;
            }
        }
        return $options;
    }

}

  di.xml

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

    <preference for="Magento\ConfigurableProduct\Helper\Data" type="Vendor\Firstmodule\Helper\Data" />

</config>


texts: Refunding backordered items does not complete order

texts:
We are using Magento 2.2.8

When we refund back-ordered items, the order status is not set to complete even though all items have either been refunded or shipped.  This happens only when the partial shipment and partial refund occur on the same SKU.

Steps:

  Create an order with multiple quantities (at least 2) of a single SKU.
  Ship out only some of the items leaving the rest to be refunded.
  Refund the remaining items so that all items on the order are either shipped or refunded.
  Observe order status

Result:

  The Order status is set to "processing" as configured in Magento.

Expected Result:

  I expected the order to have a status of "complete" since all items
  have either shipped or been refunded.

Two keys to this.  One, that the refund occurs after a shipment and as the final action on the order. And two, that the partial shipment and refund occur on the same SKU.  For example your customer ordered 20 XL Super Cool T-Shirts SKU: SC123-XL.  Unfortunately you only have 15 of SC123-XL on hand so you ship the 15 you have.  The customer later calls and asks the remaining 5 be refunded.  When you issue the refund in Magento, the order will not complete.  This is the issue we are having.

Thanks!


texts: Magento 2.3.3. error in command catalog:images:resize

texts:
Some images are missing in products, and I have tried running bin/magento catalog:images:resize like this:

php -d memory_limit=-1 -d max_execution_time=86400  bin/magento catalog:images:resize

after some time command returned this error:

3241/5308 [=================>----------]  61% 16 mins 52.0 MiB  | /import/media/catalog/product/4/t/4tu60ear_.jpgimage pages are not coalesced `/usr/www/users/xxxxx/pub/media/catalog/product/import/media/catalog/product/4/t/4tu60ear_1.png' @ error/layer.c/OptimizeLayerFrames/1027

I have checked and files exist in their locations and can be opened in the browser.

Is the error above related to the fact that some product images are missing
What would be a solution for the error - or at least - what to do?

UPDATE

Digging more, I found out that I have images of the same filename, but different extensions.

pub/media/catalog/product/import/media/catalog/product/4/t/4tu60ear_.jpg
pub/media/catalog/product/import/media/catalog/product/4/t/4tu60ear_.png
pub/media/catalog/product/import/media/catalog/product/4/t/4tu60ear_1.jpg
pub/media/catalog/product/import/media/catalog/product/4/t/4tu60ear_1.png

So I deleted .png files and tried my command for resizing again. This time it went further until it reached the same batch of the same filename/different extension.


texts: Magento 2 Commerce Edition - Category Image upload error : Attention File validation failed

texts:
I am getting the following error when i try to add image for category,

How to solve this issue, i am using commerce edition ver 2.4.1


texts: Invalid template file: 'Company_module::menubtn.phtml' in module: '' block's name: 'custom_menu'

texts:
I want display a phtml file in the header, i created a phtml file and called in the default.xml but it is giving invalid template file block's name, what should be give as a block name
menubtn.phtml

MENU

default.xml
<referenceBlock name="header.container">
        <block class="Magento\Framework\View\Element\Template" name="custom_menu" after="-" template="Company_module::menubtn.phtml"/>
    </referenceBlock>


texts:
I created a button on my Adminhtml_Sales_Order_View file and i want it to point to my admin html controller but for an unknown reason when i click the button i got a page 404 error in the front end.

this is my /etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <PixelPlusOne_DragonPay>
      <version>1.0.0</version>
    </PixelPlusOne_DragonPay>>
  </modules>
  <global>
    <models>
      <dragonpay>
        <class>PixelPlusOne_DragonPay_Model</class>
      </dragonpay>
    </models>
    <helpers>
      <dragonpay>
        <class>PixelPlusOne_DragonPay_Helper</class>
      </dragonpay>
    </helpers>
    <blocks>
      <dragonpay>
        <class>PixelPlusOne_DragonPay_Block</class>
      </dragonpay>
    </blocks>

  </global>
  <default>
    <payment>
      <dragonpay>
        <model>dragonpay/standard</model>
        <active>1</active>
        <order_status>pending</order_status>
        <title>Dragon Pay</title>
        <payment_action>sale</payment_action>
        <allowspecific>0</allowspecific>
        <sort_order>1</sort_order>
      </dragonpay>
    </payment>
  </default>
  <admin>
      <routers>
          <adminhtml>
            <use>admin</use>
              <args>
                  <modules>
                      <PixelPlusOne_DragonPay before="Mage_Adminhtml">PixelPlusOne_DragonPay_Adminhtml</PixelPlusOne_DragonPay>
                  </modules>
              </args>
          </adminhtml>
      </routers>
  </admin>
  <frontend>
    <routers>
      <dragonpay>
        <use>standard</use>
        <args>
          <module>PixelPlusOne_DragonPay</module>
        </args>
      </dragonpay>
    </routers>
  </frontend>
</config>

This is the button i added to my Sales_Order_View

  /* UPDATE INCLUDED BY DRAGONPAY PAYMENT MODULE - START */
/**
 * This button is added for DragonPay for QUERY API button for manual checking of payment result
 */
if($order->getPayment()->getMethodInstance()->getCode() == 'dragonpay'){
        $message = 'Query the Payment Gateway To Check If Any Payments Made?';
        $url = Mage::helper('adminhtml')->getUrl('dragonpay/adminhtml_admindragonpay/query/',array('order_id'=>$order->getId()));
        $this->addButton('dragonpayapi_query', array(
                'label'     => '[--DRAGONPAY:Get payment status--]',
                'onclick'   => "confirmSetLocation('{$message}', '{$url}')",
        ));
}
/* UPDATE INCLUDED BY DRAGONPAY PAYMENT MODULE - END *

and finally my Adminhtml Controller

<?php
    class PixelPlusOne_DragonPay_Adminhtml_AdmindragonpayController extends Mage_Adminhtml_Controller_Action
    {
        public function queryAction(){
            echo "hi";
        }

    }
?>

Hoping that anybody could help me and i really appreciate the help. Thanks in advance.


texts: SQL Query to get actual name of custom attribute value

texts:
I am able to get the value of a custom attribute from the following query, however, the number doesn't help much.  I would like to get the actual name of the value.

  SELECT  entity.sku, entity.type_id as 'type',
  entity_cod_custom_attribute.value as 'cod_custom_attribute'

  FROM catalog_product_entity entity

  LEFT JOIN catalog_product_entity_int entity_cod_custom_attribute ON
  entity_cod_custom_attribute.entity_id = entity.entity_id AND
  entity_cod_custom_attribute.attribute_id = (SELECT attribute_id FROM
  eav_attribute ea LEFT JOIN eav_entity_type et ON ea.entity_type_id =
  et.entity_type_id  WHERE ea.attribute_code = 'cod_custom_attribute'
  AND et.entity_type_code = 'catalog_product')

This gives me:
SKU-ABC, simple, 355

where 355 is actually "Adult-Large"

I would like it to show:
SKU-ABC, simple, Adult-Large

It looks like I need to do a bit more connecting from the eav_attribute_option table and the eav_attribute_option_value tables.

Any suggestions?


texts: searchCriteriaBuilder using multiple sort

texts:
I've been experimenting with SearchCriteriaBuilder but I can't seem to get the syntax right to apply multiple sort.

I've tried this

$this->searchCriteriaBuilder->addFilter(EntryInterface::STATUS, 1, 'eq');
$sort = [];
$sort[] = $this->sortOrder->setField(EntryInterface::COUNTRY)
    ->setDirection(SortOrder::SORT_ASC);
$sort[] = $this->sortOrder->setField(EntryInterface::SORT)
    ->setDirection(SortOrder::SORT_ASC);

$this->searchCriteriaBuilder->setSortOrders($sort);
$searchCriteria = $this->searchCriteriaBuilder->create();
return $this->entryRepositoryInterface->getList($searchCriteria)->getItems();

And this...

$this->searchCriteriaBuilder->addFilter(EntryInterface::STATUS, 1, 'eq');
$sortOne = $this->sortOrder->setField(EntryInterface::COUNTRY)
    ->setDirection(SortOrder::SORT_ASC);
$sortTwo = $this->sortOrder->setField(EntryInterface::SORT)
    ->setDirection(SortOrder::SORT_ASC);

$this->searchCriteriaBuilder->setSortOrders([$sortOne, $sortTwo]);
$searchCriteria = $this->searchCriteriaBuilder->create();
return $this->entryRepositoryInterface->getList($searchCriteria)->getItems();

One more I tried

[...]
$this->searchCriteriaBuilder->setSortOrders([$sortOne]);
$this->searchCriteriaBuilder->setSortOrders([$sortTwo]);
[...]

But only one sort applies.

I've checked the docs and I'm still unsure.

Is it possible to apply multiple sorts?


texts: How to show swatches on category page in Magento 1.9

texts:
I was trying to show configurable color swatches on category listing page but unable to get it, I used below code but it just shows the name of color but I want to show swatches same as on product detail page,

Below code shows only color name which I have tried,

<?php if($_product->isConfigurable()): ?>
      <?php $attributes = $_product->getTypeInstance(true)->getConfigurableAttributes($_product) ?>
      <?php if(count($attributes)): ?>

        <?php foreach($attributes as $att): ?>
          <?php $pAtt=$att->getProductAttribute();
            //get the child products
            $allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product);
            $frontValues =array() ?>

           <?php foreach($allProducts as $p): ?>
             <?php if(!$p->isSaleable()) continue; ?>
             <?php $out=$p->getAttributeText($pAtt->getName()); ?>
             <?php $frontValues[$out]=$out; ?>
           <?php endforeach ?>

<?php echo implode('

', $frontValues) ?>

        <?php endforeach ?>

      <?php endif ?>
    <?php endif ?>


texts: In Magento2, I tried to follow this procedure. Just before the paragraph, "Theme Logo" I wanted to try to apply the theme already. It ended up in an error, then I decided to restart from 0. I deleted the folder <your Magento install dir>/app/design/frontend/<Vendor>/, cleared all caches, but in Stores > Configuration > General > Design > Design Theme dropdown, I still see the name of my theme... It is apparently written somewhere else, question is where and how to clean it?


texts: Magento2: Where to place the grand-total.html in my theme?

texts:
i have made some changes in:

vendor/magento/module-tax/view/frontend/web/template/checkout/cart/totals/grand-total.html

Where should i place it in my own theme? Nothing is working. What i acually have is:

app/design/frontend/VENDOR/VENDORTHEME/Magento_Tax/template/checkout/cart/totals/grand-total.html

But without any success....


texts: Magento search broken, don't give results

texts:
After a few days, the search works fine.

Now, it doesn't give any result.

I've checked the configuration on Admin(backend), and its the same as the other days(i tested other types of search but the same).

Then i checked that the products that i'm looking could be searched.

I don't know what to look more now.


texts: Widget popup shows only blank page. setCanLoadTinyMce(true) seems to cause the issue

texts:
In backend: If I click on "insert widget" on both, with WYSIWYG editor and without, I only get a blank "widget"-popup. If I enable display errors I see:

Fatal error: Call to a member function setCanLoadTinyMce() on a non-object in /www/sites/dev.example.com/files/html/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php on line 85
Fatal error: Undefined class constant 'STRAIGHT_JOIN' in /www/sites/dev.example.com/files/html/lib/Varien/Db/Select.php on line 69
Fatal error: Class 'Mage' not found in /www/sites/dev.example.com/files/html/app/code/core/Mage/Core/Model/Resource/Session.php on line 108

If I'm gonna comment out line #85 in Container.php the error seems to be gone and the widgets show up.

// Line #84-87 in Container.php
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
    $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);  // #85
}

Of course that is a very bad solution. Can anyone point me in the right direction what is probably causing the issue? I couldn't find anything or solve the issue without uncomment this line. Thank you so much.

Magento 1.7.0.2 Multistore setup


texts: Magento v1.9.0.1 - Most Viewed Products Report only showing top 5?

texts: I have been looking for a quick fix on the net to get the Most Viewed Products report to show top 100 products viewed, instead of only top 5 viewed. Can't seem to find anything on the net to solve this.


texts:
when I want to go onclick  to next page's specific div it shows this error .

jquery.js:3123 Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin from accessing a cross-origin frame.

and not going on specific div just on page.

EDIT


texts: How to use "button" in UI component form - Magento 2?

texts:
I've written a custom module which adds a new tab to admin category edit page, using UI component form ([Vendor] \
 [Module]\view\adminhtml\ui_component\category_form.xml).

Everything works fine from textbox, text area to date field and even "insertListing".

But I have to add button as a field. When I took a look at

  vendor/magento/module-ui/etc/ui_definition.xsd

I could see <xs:element type="button" name="button"/> as a formElement type.

But there are no reference in the core on how to use this button as a formElement in a UI component form.

Can someone throw some light on this?
Thanks.


texts: Magento 2.4.1: templatehints=magento doesn't seem to work on the payment method page

texts: templatehints=magento displays the templates for other pages on the storefront than the payment method page. When entered the parameter on this page, it redirects to 404 page. Any solution to this? Thanks


texts: Alternative method for executing update queries within Magento using PHP

texts:
I have a script that runs outside of Magento to do some "maintenance" work on the database. Here is an example of how it works:

<?php

require_once('../app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

// Now you can run ANY Magento code you want

/**
     * Get the resource model
     */
    $resource = Mage::getSingleton('core/resource');

    /**
     * Retrieve the read connection
     */
    $readConnection = $resource->getConnection('core_read');

    $query = 'select * from salesrule_coupon where times_used="20";';

/**
     * Execute the query and store the results in $results
     */
     $results = $readConnection->fetchAll($query);

Works perfectly until I swap that SELECT query with an UPDATE query. Apparently, this is the reason: https://stackoverflow.com/questions/12979510/pdo-error-sqlstatehy000-general-error-when-updating-database

I attempted to swap the fetchAll($query) method with something like this:

mysql_query('update salesrule_coupon SET times_used="0" where code like "X%";');

But it seems that mysql_query function requires you to use the standard MySQL connection method. Seems like the solution is would be to swap out fetchAll() as I am already connected and able to use SELECT queries. Does anyone know what I need to modify in order to allow UPDATE queries to be performed?


texts: Magento 2.1: How to use getParam('param') function for this case?

texts:
I have this page: [magento2.emthemes.com/everything/women/tops-women.html].

When i click on the fillter on the left i will get this link:[magento2.emthemes.com/everything/women/tops-women.html?cat=23] . It has param_value = tops-women.html, query_string_name=cat, query_string_value=23. In generality, what is the param_value for that?

Example: I have code into Controller, in this case param_value=data ($data = $this->getRequest()->getParam('data');):

class Index extends \Magento\Framework\App\Action\Action
{
    public function execute()
    {
        $this->_view->loadLayout();

    $data = $this->getRequest()->getParam('data');
    $data = base64_decode($data);
    $data = json_decode($data);
    $result = array();
    if($data){
        foreach($data as $key => $value)
        {
            $result[$key] = $value;
        }
        $block = $this->_view->getLayout()->createBlock($result['type']);
        $block->setData('current_url',$data->current_url);
        if(!$this->_view->getLayout()->getBlock('formkey')){
            $this->_view->getLayout()->createBlock('Magento\Framework\View\Element\FormKey','formkey');
        }
        //echo "<pre>";echo $block->toHtml();die;
        $block->setData($result);
        $block->setData('uniqueId',uniqid());
        $this->getResponse()->setBody($block->toHtml());
    }
}

}


texts: How to add custom form for cash on delivey in checkout page?

texts:
I'm trying to add a custom form for cash on delivery in checkout page for a theme called 'radius'.

I tried by adding cashondelivery.phtml with my custom fields to app\design\frontend\radius\default\template\payment\form path.

But the fields added are not showing in checkout page when i select "cash on delivery" method.

Please suggest me a way.

Thanks in advance.


texts: is there any way I can install a demo sample data with actual real products (not the Performance Toolkit) ?


texts: How can I create a custom shortcode in Magento2 for products within a category?

texts:
I am trying to find out how to get a list of products within a category that I can embed into a block - for example {{products category='safe-equipment'}}

I am new to Magento, so please give me the dumbed down version. Thanks!


texts: Add space between credit card numbers in magento2 checkout

texts: We have implemented custom credit card payment method in magento2, we need to add space for every 4 digits in credit card number filed. Is there a way to add spaces for every 4 digits in credit card number field in magento2 checkout?


texts: Autosave feature in magento? Is it possible in magento?

texts:
I want to implement the Autosave feature in Magento .

To be more specific: Autosave the values in the text area and save it to backend

Any suggestion or ideas on how it can be done?

ie) While the user is adding any content or editing any post, and when there is an inactivity from him for a long time or closes by mistake, his post should be autosaved. (something like a "save as draft" feature).

Can this be done in magento?

I hear this can be achieved in wordpress, is it possible in magento too?


texts: Does anyone know if there is a method to tell the system to not Full Page Cache a specific store or website? And just to be clear, using EE FPC out of the box.


texts: Uncaught TypeError: Unable to process binding "datetimepicker: function(){return true }" datetimepicker is not a function

texts:
I am getting the error

knockout.js:3381 Uncaught TypeError: Unable to process binding "datetimepicker: function(){return true }"
Message: $el.datetimepicker is not a function

Below is my code which tries to add additional fields to the card
define([
    'jquery',
    'ko',
    'Magento_Ui/js/form/element/abstract'
], function ($, ko, Component) {
    'use strict';

    return Component.extend({
        initialize: function () {
            this._super();
            var disabled = window.checkoutConfig.shipping.delivery_date.disabled;
            var noday = window.checkoutConfig.shipping.delivery_date.noday;
            var hourMin = parseInt(window.checkoutConfig.shipping.delivery_date.hourMin);
            var hourMax = parseInt(window.checkoutConfig.shipping.delivery_date.hourMax);
            var format = window.checkoutConfig.shipping.delivery_date.format;
            if(!format) {
                format = 'yy-mm-dd';
            }
            var disabledDay = disabled.split(",").map(function(item) {
                return parseInt(item, 10);
            });

            ko.bindingHandlers.datetimepicker = {
                init: function (element, valueAccessor, allBindingsAccessor) {
                    var $el = $(element);
                    //initialize datetimepicker
                    if(noday) {
                        var options = {
                            minDate: 0,
                            dateFormat:format,
                            hourMin: hourMin,
                            hourMax: hourMax
                        };
                    } else {
                        var options = {
                            minDate: 0,
                            dateFormat:format,
                            hourMin: hourMin,
                            hourMax: hourMax,
                            beforeShowDay: function(date) {
                                var day = date.getDay();
                                if(disabledDay.indexOf(day) > -1) {
                                    return [false];
                                } else {
                                    return [true];
                                }
                            }
                        };
                    }

                    $el.datetimepicker(options);

                    var writable = valueAccessor();
                    if (!ko.isObservable(writable)) {
                        var propWriters = allBindingsAccessor()._ko_property_writers;
                        if (propWriters && propWriters.datetimepicker) {
                            writable = propWriters.datetimepicker;
                        } else {
                            return;
                        }
                    }
                    writable($(element).datetimepicker("getDate"));
                },
                update: function (element, valueAccessor) {
                    var widget = $(element).data("DateTimePicker");
                    //when the view model is updated, update the widget
                    if (widget) {
                        var date = ko.utils.unwrapObservable(valueAccessor());
                        widget.date(date);
                    }
                }
            };

            return this;
        }
    });
});


texts: I want to copy magento session data from database to files

texts:
I want transfer magento session storage from database to files.

I want to know how to do this.

What i did is, download [BLOB - 3.6 KiB] file from database core_session table for session and rename it with sess_frontend_session_id like sess_n7g9t1872co23p0btnbos921c4

and then upload file to var/session but it's not working

Cart data is lost for not logged in customers.


texts: Custom attribute goes in additional_attributes column

texts:
When I create a custom attribute in Magento2, at export this goes in additional_attributes column, is there a way to have a new column for every custom attribute? This makes it very difficult to prepare the import files.

Thank You.


texts: I setup price based shipping fees calculation and they are reduced to zero when cart value is greater than 50 euros. Is it possible to show a code (maybe a banner) when shipping rates result is 0? I use lotusbreath one page checkout


texts: What is business flow for accepting Credit card payment ?

texts:
I have enabled the Credit Card Payment option on my Magento Site ?  I have also successfully to completed a Test Order using a MasterCard.

My qtn: What next ?  How do I process the Payment from the Card to our A/C ?  Do i need to setup a link from Admin or is manually done ?

Thanks.


texts: Change More product images on color swatch select

texts:
I have set color swatches for configurable products and the main product image has been changed successfully by clicking on color swatch, but not the more images associated with that product.

How is that possible to do that on product view page?

More Detail
Change More View Images of associative product by clicking on color - I am using magento enterprise edition not community.

 swatch


texts: Credit Card Charged Twice After Place Order in Magento 2.2.9

texts:
We are using the CardConnect Payment Gateway for our site. Before a few days ago we face a credit card charged two times for some orders and Magento Shows only 1 order and 1 Invoice and 1 transaction. So we have asked CardConnect Support team and they replied like below:

software sending the requests to our gateway multiple times. Please check below the snapshot for the same.

We have checked the logs and found that there is a double authcode for those orders.

In the CardConnect Configuration, we have set "Action": Authorize & Capture. We have also placed test orders but we can not reproduce the issue.
Can anybody suggest me how to solve this kind of issue? Below is the Model File snapshot for the Payment for the reference.

For Authorize Function :

$data = [
            'merchid' => $merchantId,
            'accttype' => $payment->getCcType(),
            'account' => $additionalInfo['cc_number_enc'],
            'expiry' => str_pad($expiryMonth, 2, "0", STR_PAD_LEFT) . substr($expiryYear, -2),
            'cvv2' => $payment->getCcCid(),
            //'amount' => $amount * 100,
            'amount' => $grandTotal * 100,
            'currency' => $order->getBaseCurrencyCode(),
            'orderid' => $order->getId(),
            'name' => $billing->getName(),
            'address' => $billing->getStreetLine(1),
            'city' => $billing->getCity(),
            'region' => $billing->getRegion(),
            'country' => $billing->getCountryId(),
            'postal' => $billing->getPostcode(),
            'email' => $billing->getEmail(),
            'phone' => $billing->getTelephone()
        ];

        if ($capture) {
            $data['capture'] = 'Y';
        }

For Capture Function:

// If we have previously captured an amount, we need a new auth token, otherwise use the one we had.
        $order_total_due = $order->getBaseTotalDue();
        if ($order_total_due != $order_total) {
            $billing = $order->getBillingAddress();
            $authorize_data = [
              'merchid' => $merchantId,
              'account' => $additionalInfo['token'],
              'expiry' => $additionalInfo['cc_expiry'],
              'amount' => $amounttax * 100,
              'currency' => $order->getBaseCurrencyCode(),
              'orderid' => $order->getId(),
              'name' => $billing->getName(),
              'address' => $billing->getStreetLine(1),
              'city' => $billing->getCity(),
              'region' => $billing->getRegion(),
              'country' => $billing->getCountryId(),
              'postal' => $billing->getPostcode(),
              'email' => $billing->getEmail(),
              'phone' => $billing->getTelephone(),
            ];

Order status for double-charged is under "Processing" state and Invoice state is paid.
Regular order status is under the "Payment Review" state and the Invoice state is " pending".

While checking Order under the Sales > Orders we can see a comment like below for the Regular orders:

An amount of $3.28 will be captured after being approved at the payment gateway.

For Double Charged like below:

Captured amount of $3.69 online. Transaction ID: "070459346166"

Can anybody take a look into this to solve this issue? Any kind of help will be appreciated.

Thanks in advance.


texts: Enable backorders for a customer group in Magento 1.9

texts:
I am trying to create functionality that allows backorders for a specific customer group only. I've searched the Magento code for something like if ($backorders_enabled){...} with no success/luck. I'm starting to think about checking each cart item quantity and and changing the value to it's inventory's value if the user is not logged and in the specific group.

Any idea what is the right way to enable backorders for a specific customer group ?


texts:
I use the rwd theme and have added the mini login form to the header as described here.
The part in my customer.xml looks like this:

    <customer_logged_out>
    <reference name="header">
            <block type="customer/form_login" name="header_customer_form_mini_login"  template="customer/form/mini.login.phtml"/>
    </reference>

    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer">Log In<url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
    </reference>
    <remove name="reorder"></remove>
</customer_logged_out>

And my header.phtml contains the following:

       <?php echo $this->getChildHtml('header_customer_form_mini_login') ?>

The mini form appears as it should, but if I try to login I 'm fowarded to mypage.com/customer/account/login/ and I 'm not logged in.
If I use the form at mypage.com/customer/account/login/ (not the one in the header) everything works.
My first thought was that something must be wrong with the form action, but both forms (the working and the not working) contain "http://mypage.com/customer/account/loginPost/" as action.

Any thoughts what could be wrong?
There are no error messages.

Thanks.


texts: Need to give a product free when using a specific coupon

texts: I would like the user get a product free in a particular category (eg 8) free when user enters a specific single used coupon. The user just needs to buy at least one product(any category) to get the free product. Can this be done using shopping cart rule or do I need customization?


texts:
I'm getting this error in the system.log, When ever I access the magento login page with my module installed:

[2016-11-10 12:40:15] main.CRITICAL: Class Inchoo\SocialConnect\Model\Google\Client does not exist [] []
[2016-11-10 12:40:15] main.CRITICAL: Invalid block type: Inchoo\SocialConnect\Block\Login [] []
[2016-11-10 12:40:15] main.CRITICAL: Class Inchoo\SocialConnect\Model\Google\Client does not exist [] []
[2016-11-10 12:40:15] main.CRITICAL: Invalid block type: Inchoo\SocialConnect\Block\Google\Button [] []
[2016-11-10 12:40:15] main.CRITICAL: Class Inchoo\SocialConnect\Model\Facebook\Client does not exist [] []
[2016-11-10 12:40:15] main.CRITICAL: Invalid block type: Inchoo\SocialConnect\Block\Facebook\Button [] []
[2016-11-10 12:40:15] main.CRITICAL: Class Inchoo\SocialConnect\Model\Twitter\Client does not exist [] []
[2016-11-10 12:40:15] main.CRITICAL: Invalid block type: Inchoo\SocialConnect\Block\Twitter\Button [] []
[2016-11-10 12:40:15] main.CRITICAL: Class Inchoo\SocialConnect\Model\Pixelpin\Client does not exist [] []
[2016-11-10 12:40:15] main.CRITICAL: Invalid block type: Inchoo\SocialConnect\Block\Pixelpin\Button [] []

I tried making changes to the block reference but unable to solve the problem:

<referenceContainer name="form.additional.info">
            <block class="Inchoo\SocialConnect\Block\Login" name="form_additional_login" template="Inchoo_SocialConnect::login.phtml">
                <block class="Inchoo\SocialConnect\Block\Google\Button" name="form_additional_google_button" template="inchoo/socialconnect/google/button.phtml"/>
                <block class="Inchoo\SocialConnect\Block\Facebook\Button" name="form_additional_facebook_button" template="inchoo/socialconnect/facebook/button.phtml"/>
                <block class="Inchoo\SocialConnect\Block\Twitter\Button" name="form_additional_twitter_button" template="inchoo/socialconnect/twitter/button.phtml"/>
                <block class="Inchoo\SocialConnect\Block\Pixelpin\Button" name="form_additional_pixelpin_button" template="inchoo/socialconnect/pixelpin/button.phtml"/>
            </block>
</referenceContainer>

Module Github project


texts: Magento 2 : Adding a foreign key of customer_entity in a custom table

texts:
I'm trying to add a foreign key of the customer in my table in InstallSchema file :

$installer->getConnection()
                ->addColumn($installer->getTable('fmj_crf/projet'), 'customer_fk_id', Table::TYPE_INTEGER, null, array(
                    'unsigned' => true,
                    'nullable' => false,
                        ), 'customer Id');

        $installer->getConnection()->addForeignKey(
                $installer->getFkName('fmj_crf/projet', 'customer_fk_id', 'customer_entity', 'entity_id'), $installer->getTable('fmj_crf/projet'), 'customer_fk_id', $installer->getTable('customer_entity'), 'entity_id'
        );

but when I upgrade it gives me this error :

[PDOException]
  SQLSTATE[HY000]: General error: 1825 Failed to add the foreign key constraint on table 'fmj_crf/projet'.
  Incorrect options in FOREIGN KEY constraint 'test2/FMJ_CRF/PROJET_CUSTOMER_FK_ID_CUSTOMER_ENTITY_ENTITY_I
  D'

Anyone can help ?


texts: Magento 2 - New product import error - Class name and class type already exists error during import

texts:
If try to import new product i am getting following error,

How to solve the issue


texts: I already success adding an input for delivery date in checkout page based on this link. But, the problem is, customer still can skip the input, and click next to finish the order. How can i made it required and customer should fill it before click next? I already tried to add required in the input but it's not work.


texts: How to track product list impressions/clicks and related sales?

texts:
We have products in several different categories in our Magento shop. And with enhanced ecommerce tracking we want track the product list performance. I used this Google dev docs.

Eg.: Product is in category 'sales', 'shirts' and 'collection awesome'.

Now we run into the problem, that at the product detail page we do not know from which category list we came from and Magento tells Google the first product category of the products categories the product is in.

That results in a wrong report: Product List Views, Product List Clicks and Product List CTR have correct numbers in our reports.

But Product Adds To Basket is zero and Product Checkouts, Unique Purchases and Product Revenue point to (not set) in a different entry (row).

I doubt that this is a session problem, because I clicked everything in under one minute on our test system.

This is how I track product list impressions (all relevant data is in data-xxx attributes in li-tag):

/**
 * * Set all product list impressions for Google Analytics
 * @param bool loadMoreClicked
 */
var setProductImpressions = function(loadMoreClicked) {
    jQuery('li[data-product-sku]').each(function(index){
        _ga('ec:addImpression', {
            'id': this.dataset.productSku,
            'name': this.dataset.productName,
            'category': this.dataset.productCategory,
            'brand': this.dataset.productBrand,
            'variant': this.dataset.productVariant,
            'list': this.dataset.productList,
            'position': index + 1
        });
    })

    if(loadMoreClicked) {
        _ga('send', 'event', {
            eventCategory: 'productlist',
            eventAction: 'click',
            eventLabel: 'Load More Button'
        });
    }
}

This is how I track product list clicks:

var bindProductListClickTracking = function() {
    jQuery('a.detail-link-track:not(.ga-click-bound)').on('click', function (e) {
        e.preventDefault();
        var product;
        var href = jQuery(this).attr('href');

        var product = jQuery('li[data-product-detail-link="' + href + '"]')[0];

        _ga('ec:addProduct', {
            'id': product.dataset.productSku,
            'name': product.dataset.productName,
            'category':product.dataset.productCategory,
            'brand': product.dataset.productBrand,
            'variant': product.dataset.productVariant,
            'position': jQuery(product).index() + 1
        });

        var list = product.dataset.productList;

        _ga('ec:setAction', 'click', {list: list});

        _ga('send', 'event', {
            eventCategory: 'productlist',
            eventAction: 'click',
            eventLabel: product.dataset.productList,
            hitCallback: function () {
                if (!(e.ctrlKey || e.which == 2)) {
                    document.location = href;
                }
            }
        });
    }).addClass('ga-click-bound');
}

And this is how I track add to cart events:

function manipulationOfCart(product, type) {
    _ga('ec:addProduct', {
        'id': product.id,
        'name': product.name,
        'category': product.category,
        'brand': product.brand,
        'variant': product.variant,
        'price': product.price,
        'quantity': product.qty
    });

    _ga('ec:setAction', type);

    if (type == 'add') {
        _ga('send', {
            hitType: 'event',
            eventCategory: 'Cart',
            eventAction: 'click',
            eventLabel: 'Add To Cart',
            nonInteraction: 1
        });
    } else if (type == 'remove') {
        _ga('send', {
            hitType: 'event',
            eventCategory: 'Cart',
            eventAction: 'click',
            eventLabel: 'Remove From Cart',
            nonInteraction: 1
        });
    }
}


texts: How to set a minimum qty 2 of specific category - Magento2

texts:
How to set minimum qty for specific category?
For example: I have 2 categories.
one -  test
second - test2
For test categories products : I want minimum qty should be 2.
and test2 categories customer can order 1.


texts: Magento 2 : Display Custom Attribute in Order Items

texts: How we can show product custom attribute i-e: upc in orders items under sku. pics attached for reference,


texts: Breadcrumbs not working on Product Page Magento 2.2.4

texts:
After to Magento 2.2.4 breadcrumbs are not working anymore on the product page.
It seems like it works on other pages, tho.

in cms_index_index.xml I have removed breadcrumbs beacuse we dont want them visible on the homepage. However, for other pages the breadcrumb should be there. It is, for example on the category page, Contact Page and so on.

Just not on the product page. What could be the reason to that and how to fix it?


texts:
9.3.6 website. It works fine but sometime it shows SQL error and sometimes it shows many times in a day.
here is its trace records

SQLSTATE[HY000] [2002] Connection refused

Trace:
#0  /public_html/ocb/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1  /public_html/ocb/lib/Varien/Db/Adapter/Pdo/Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2  /public_html/ocb/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3  /public_html/ocb/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4  /public_html/ocb/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5  /public_html/ocb/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6  /public_html/ocb/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7  /public_html/ocb/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8  /public_html/ocb/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9  /public_html/ocb/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10  /public_html/ocb/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11  /public_html/ocb/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12  /public_html/ocb/app/code/core/Mage/Core/Model/Config.php(1357): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13  /public_html/ocb/app/code/core/Mage/Core/Model/Config.php(1389): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14  /public_html/ocb/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15  /public_html/ocb/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16  /public_html/ocb/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17  /public_html/ocb/app/code/core/Mage/Core/Model/App.php(619): Mage_Core_Model_Abstract->getCollection()
#18  /public_html/ocb/app/code/core/Mage/Core/Model/App.php(477): Mage_Core_Model_App->_initStores()
#19  /public_html/ocb/app/code/core/Mage/Core/Model/App.php(360): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20  /public_html/ocb/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21  /public_html/ocb/index.php(83): Mage::run('', 'store')
#22 {main}

please give me proper solution so that i can fix this.

Thanks in advance.


texts: M2 attribute handling, import , custom attributes

texts:
currently i use import/export for creating configurable products automatically. this is also quite a buch of work , because attributes aren't imported like in 1x.

The optional attributes section in the csv file is quite unhandy. i wonder if m2 developers have ever seen a productlist which a merchant from the manufaturer is normally receiving, especially the color and sizes of an article or adding a manufacturer attribute or fabric and whatever you can think about must get stuffed into one single csv field ?

furthermore if, for example the size, has a value which is not predefined in the attribute, import does not work -  you can add everything manually, then.

we are selling clothes, having more than 50 brands and every manufacturer uses different sizing, different colornames each season. so we have to add about 20.000 simple products and have to create about 5000 configurable semi-automatically using the import every half year.

currently we have in our old m1-shop about 500 different colors (there are the colorcombinations not included), about 300 different size-descriptions and some other fields with different values. each season == twice a year, everything gets new, new colors, new fabrics, etc .. i wonder, how i should manage that for the future, maybe using a differnet shop-system ?


texts: Success/ Error message not showing Magento 2

texts:
After Magento upgrade to its latest version, no success and error messages are seen to be added on the page message section while submitting the newsletter.

But the email gets saved on to the backend

It shows message when reverted to luma but doesn't work on custom theme. It was working fine before the update.

Can anyone suggest what might have caused the issue after update.


texts: How to change domain of magento 2 checkout from one multiple website to another to be compliant with payment processor

texts:
I have two versions of Magento 2 site, storeone.com, storeone.country. However, our payment processer won't allow transactions from storeone.country - it needs to be from storeone.com.
What would be the best method to route the checkout from storeone.country to storeone.com?


texts:
I am confusing in different price in magento.
what is difference between base_price original_price base_original_price price_incl_tax base_price_incl_tax in sales_flat_order_item table ?


texts: How to hide the tab when no value is entered in the text field?

texts:
I have added a text-field attribute in product-collateral tab in details page with following code:

<?php $_helper = $this->helper('catalog/output'); ?>
<?php $_product = $this->getProduct(); ?>
<script type="text/javascript">
    var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
</script>
<?php $Application = $_product->getApplication(); ?>
<?php if(count($Application, 'strlen') > 0): ?>

        <div class="application">
            <?php echo $_product->getApplication(); ?>
        </div>

<?php endif; ?>

when I enter the value in the text field at backend it is perfectly getting displayed. But the error is that the tab is getting displayed even when I enter no value in that field.

Kindly help me to resolve this issue.


texts: Magento 1.9.2. - Save the attribute of the customer_account table in the form customer_address

texts:
On the customer address change page I am trying to add fields for some custom attributes that I have created and inserted into the customer_account table.

After several tests I saw that in the edit.phtml form of the Magento client address change only saves the attributes present in the customer_address table.

  How can I make sure that the form also contains attributes that are
  present in the customer_account table?

Thank you


texts: Is it is possible to check all the modules used for a particular page in magento2?


texts:
There's a javascript plugin called PictureFill.js:

https://github.com/scottjehl/picturefill

I wondered if anyone has ever used this on a Magento site and whether I could get some tips on how to implement this.

If not, can anyone tell me of an alternative so I'm able to use server side code to size and crop images?

Thanks in advance for any help.


texts:
I am trying to create a custom page that will show in the customers My Dashboard area. The page will be similar to the My Orders page however it will show different information. On the website we list and sell items on other peoples behalf so I want this page to show which of their items are for sale. This is not a marketplace website as such. My thoughts were that if I added an attribute to each product that had a customer id entered into it I could pull all of the product info into this page based on the customer id.

I have basic skills in modifying Magento to the way I need it however this is more technical than anything I have attempted before. I am not sure where to start and was hoping some of the experts on here could point me in the right direction or even if what I am trying to achieve is possible.


texts: Why custom shipping method called twice?

texts:
I am trying to create my custom shipping method everything is okay but I see that magento is calling  my collectRates function twice

I wasn't able to figure why magento doing this

I had tried to test it on fresh installation of magento and same case happen

any suggestions would be appreciated


texts: How to change "You can create an account after checkout" label on checkout page?


texts: Defining character length for custom attribute in magento 2

texts:
I have added custom attribute with type of VARCHAR and it is also added in attribute table.

But I want the length of field as 1000 char. I also checked the eav_attribute table but it does not have any field for character length.

$customerSetup->addAttribute(Customer::ENTITY, ‘magento_username’, [

‘type’ => ‘varchar’,

‘label’ => ‘Custom Username’,

‘input’ => ‘text’,

‘required’ => false,

‘visible’ => true,

‘user_defined’ => true,

‘sort_order’ => 1000,

‘position’ => 1000,

‘system’ => 0,

]);

Do I need to add type as "Text" so attribute will save in text table?

Or here can I add in code anything to increase the character length?


texts: Remove Radio Buttons from Magento Checkout Login

texts: I am trying to separate the "Create new Account" and "Checkout as Guest" options into two columns, so my checkout login will feature three separate columns: "Checkout as Guest", "Create new Account", "Login to existing Account". For this to work, I need to remove the radio buttons and add the setMethod function to the buttons. Will this require changing the function itself in opcheckout.js, or can this be achieved by editing the login template?


texts: How to remove products tab when it has no value in admin in Magento 2?

texts:
I am using Magento 2.3

I have set custom product tabs in product detail page

Now I want to display a particular product tab only if it contains a value in admin. for ex. if there is no description for a particular product in admin then I want to hide description tab from detail page and same should be for other tabs as well.

  app/design/frontend/My_vendor/customtheme/Magento_Catalog/templates/product/view/details.phtml

<?php

<?php if ($detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml')):?>

        <?php $layout = $block->getLayout(); ?>

            <?php foreach ($detailedInfoGroup as $name):?>
                <?php
                    $html = $layout->renderElement($name);
                    if (!trim($html)) {
                        continue;
                    }
                    $alias = $layout->getElementAlias($name);
                    $label = $block->getChildData($alias, 'title');
                ?>
                    <div class="product-attachment" id="<?= /* @escapeNotVerified */ $alias ?>" data-role="content">
                    <?= /* @escapeNotVerified */ $html ?>

            <?php endforeach;?>

<?php endif; ?>

I think I have to make changes in the above file. So how can I achieve this?


texts: Magento Ordered Products linked to Catalog ID?

texts:
Currently in the process of porting over a product database to a development database to make that the new production, I'm running into a few snags, and one is the question;

To bring over the customers along with their prior order sales history, I need to copy the exact SQL tables (sales_ and customer_) and bring them over as reuploading the customer database will have conflicting entity IDs with the prior sales history (from deleted entries and what not). My question then becomes, does the catalog need to be copied as well? Are the product IDs linked within the sales orders?

Preferably I would like to reupload the catalog, doing some cleaning and maintenance, but I fear this will mix up order history and possibly give wrong values/products in the orders. Any ideas?

Looking more into it:

I've now noticed the product IDs within the sales_flat_order_item table which looks like it assures my assumptions, is this used as the key for the order choices? or could the SKU or something else be used as more of an anchor?

All these constraints lead me to think the only way to continue a webstore is by using the exact same database, not leaving much opportunity for cleaning/updating and weeding out the old odds and ends?


texts: Magento 2.3.2 to Magento 2.3.5-p2 upgrad frontend display widget and mageTranslationDictionary error

texts:
After upgrade Magento 2.3.2 to Magento 2.3.5-p2 frontend side display widget and mageTranslationDictionary error.
I have run all command still not resolve.

Thank in advance,


texts: How to get a custom CMS block on Product page through attributes

texts:
I would like to do the following:
- Have a two custom product attributes
- Attribute One should be called as a static CMS block (e.g. if I type in "test123" in the product configuration, Magento should load the custom block with the ID "test123" and display it on the product page
- Attribute 2 should just be displayed. If I type in "test123" I just want it to appear as "test123" on the product page

What I tried to do is edit this code and apply it on product pages, but it created an error that didn't even go away when I uninstalled the module and I had to run a backup.. Call CMS Block with Category name as Identifier

Does anyone know how to do that or how to correctly edit the code I was using?

Thank you very much in advance!


texts:
I am facing a problem with showing the recently viewed products in my product page.

Here is my local.xml code: (I do not know why, but it is not showing all code, so i had to remove "<" from each tag- exmple- action, block etc...)

catalog_product_view translate="label">
    reference name="root">
      action method="setTemplate">page/1column.phtml

      block type="reports/product_viewed" name="product.recently.viewed" as="product_recently_viewed" template="reports/product_viewed.phtml"/>

Here is my footer.phtml code:

    getUrl('');
          $currentUrl = Mage::helper('core/url')->getCurrentUrl();
          $url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
          if ($maniPage == $currentUrl){
            echo $this->takeCategory(12,1) /*12 = brands category 1 = show images*/ ;
          }
    ?>

              getChildHtml('product_recently_viewed') ?>

Here is my product_viewed.phtml (standard file from core)

getRecentlyViewedProducts()): ?>

        __('Recently Viewed Products') ?>

                getProductUrl($_item) ?>">helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?>

        decorateList('recently-viewed-items');

When I inspect the elements, the <div> from the footer is empty.
All files posted are in my theme. I have my own css so may be it won't be shown as expected, but at least the div should have any data inside, right?
Could you please help me with this one.
Thank you in advance.


texts: Wrong count in admin Grid when using GROUP BY clause in collection in Magento 2

texts:
I am trying to add a custom column in my custom grid in the admin panel. To add the custom column, I have used LEFT JOIN and GROUP BY in the collection which I get from the parent grid class.

After using JOIN and GROUP BY clauses, I am able to add the custom column in my grid, but the issue is that the GRID is now showing the wrong count of records always.

It is always showing 1 as count.

I have added the same column in another grid and it is working fine.

Note: I am not using UI component. Since the grid is coming from an extension's block files, I am using block PHP file to add my custom column.

Please help.


texts: how to show static block in all pages under left column

texts:
<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="left">
            <block name="customer_test_left" type="core/template" template="customer/form/test.phtml" />
        </reference>
    </default>
</layout>

under app\design\frontend\default\awesome\layout\local.xml

and

<?php echo "Hello World" ?>

under app\design\frontend\default\awesome\template\customer\form\test.phtml

Now the block is not showing in any page under left column

Could any one please help me...


texts: Magento 2 Item with the same ID "24" already exists error

texts:
I don't know what is going on, but everytime I go to Sales > Orders, I see this error message:
Item (Magento\Framework\View\Element\UiComponent\DataProvider\Document) with the same ID "24" already exists.
I accesed to db in order to check if there was an item_id = "24" but there is nothing.
I don't know what could it cause.
This error message came when I created a custom order status on admin panel. Then I tried to delete this order status, but the error is still there, and I cannot do anything on Sales > Order.
The weird thing is that I can see the Invoices and Shipments, but not the Orders.
I have tried this commands:
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
php bin/magento cache:flush

none of this worked.
Please help


texts: Magento 2 - Add 'per page' text inside option tag

texts:
I want to change the toolbar limiter and to insert "per page" text inside <option> tag.

        <?= /* @escapeNotVerified */ __('Show') ?>

        <select id="limiter" data-role="limiter" class="limiter-options">
            <?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
                <option value="<?= /* @escapeNotVerified */ $_key ?>"<?php if ($block->isLimitCurrent($_key)): ?>
                    selected="selected"<?php endif ?>>
                    <?= /* @escapeNotVerified */ $_limit ?>
                </option>
            <?php endforeach; ?>
        </select>

    <?= /* @escapeNotVerified */ __('per page') ?>

I add this pages on my custom theme but even if I change something the changes are not displayed.

app/design/frontend/MyTheme/default/Magento_Theme/templates/html/pager.phtml
app/design/frontend/MyTheme/default/Magento_Catalog/template/product/list/toolbar/limiter.phtml

I need to add changes in other file?


texts: Getting product name + categories + other attributes from database directly?

texts:
Magento 1.7.0.2

I got the attribute ids I want to get from the database, they are 426, 74, 439, 92, 81, 425. In addition to those I want the product name, sku and the categories the product is in. The products visibility should be catalog,search only.

This is what I got so far:

SELECT DISTINCT
cpev.`value` as Name,
cpe.sku as SKU,
#cpe.*,
#cpev.*,
ea.attribute_code
FROM
catalog_product_entity_varchar cpev
INNER JOIN catalog_product_entity cpe ON cpev.entity_id = cpe.entity_id
INNER JOIN eav_attribute ea on cpev.attribute_id = ea.attribute_id where ea.attribute_id in (426, 74, 439, 92, 81, 425);

Not exactly what I need, but maybe a start. How could I get the data I need from the DB?

Thanks!


texts: Is there a working docker environment for Magento 2?

texts: I already tried to get Magento 2 running now for more then 6 months, but still failing. Is there a working docker-container for Magento 2.2.1 that doesn't only give you a working webpage but also can run the intregration tests ?


texts: Why so many classes declared as abstract even it contain all defined methods?

texts:
For example these classes are abstract Mage_Catalog_Model_Abstract,Mage_Core_Model_Abstract etc.But it contain only defined methods.and what is the necessity to given class as abstract.
I know abstract class how to declare and rules.But i need more real time example(like magento).
Even i deleted abstract keyword before class name.but its not giving any error.
thanks in advance


texts: Display free shipping if specific sku magento on product page

texts: I need to display a "Free Shipping" line of text below the price on the product page if the SKU starts with certain characters -- how do I got about doing this?


texts: Magento fronted "shop not available" when trying to render pagination in list.phtml

texts:
I wanted to display all products from my store on homepage, to do that I used this piece of code in my CMS Home Page item.

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml" column_count="4"}}

After that I wanted to modify how pagination looks under my categories. I didn't want pagination to be shown both on top and bottom of my category list, so I have removed $this->getPagerHtml() from list/toolbar.phtml, and I have also removed $this->getToolbarHtml() from the bottom of list.phtml and replaced it with $this->getChild('product_list_toolbar')->getPagerHtml();.

That gave desired result of having pagination only at the bottom of category list but when I open homepage, I get message that webshop is not available.

If I roll back the changes, items from all categories are displayed again on the homepage.

What I have noticed is that even though pagination is shown (without my modifications) on categories, homepage which should display all store items doesn't have pagination.

I'm guessing it's some kind of error because my homepage doesn't have access to pagination object?

Thanks in advance!


texts: Exception when try to save() product from cron job

texts:
I have a cron job to set product price dynamically.

If I set price by below code then product view page display updated price but updated price not showing on listing page for product :

$_product = Mage::getModel('catalog/product')->setStoreId()->load($product_id);
$Price = $dynamic;
$_product->setPrice($Price)->getResource()->saveAttribute($_product, 'price');

When I used below code then getting exception :

$_product = Mage::getModel('catalog/product')->setStoreId()->load($product_id);
$Price = $dynamic;
$_product->setPrice($Price);
$_product->save();

Exception is :

Fatal error: Uncaught exception 'Mage_Eav_Model_Entity_Attribute_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2207-0-3-0' for key 'CC12C83765B562314470A24F2BDD0F36', query was: INSERT INTO `catalog_product_entity_group_price` (`entity_id`, `all_groups`, `customer_group_id`, `value`, `website_id`) VALUES (?, ?, ?, ?, ?)' in /home/cityretails/public_html/app/code/core/Mage/Core/Model/Config.php:1348 Stack trace: #0 /home/cityretails/public_html/app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('eav/entity_attr...', 'SQLSTATE[23000]...') #1 /home/cityretails/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(661): Mage::getModel('eav/entity_attr...', 'SQLSTATE[23000]...') #2 /home/cityretails/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1660): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/afterSa...', Array) #3 /home/cityretails/public_html/app/code/core/Mage/Catalog/Model/Resource/Product.php(195): Mage_Eav_Model_Entity_Abstract in /home/cityretails/public_html/app/code/core/Mage/Core/Model/Config.php on line 1348

While when I save product from admin it saved successfully.
And after save product updated price showing on listing page.

Can anyone tell me what is the problem here?


texts:
Hi i have this form on backend with select input.

 $fieldset->addField('product_id', 'select', array(
                        'label'     => Mage::helper('banermanager')->__('Product ID'),
                        'values'   => Iv_BanerManager_Block_Adminhtml_Banermanager_Grid::getValueArray3(),
                        'name' => 'product_id',
                        ));

What do i have to change on 'values' to get list of all products on shop with their id's ?


texts: Magento 2.2: Why some images can be displayed from phtml and some cannot?

texts:
Below are four examples of images randomly taken from the Net, two are displaying properly with in custom theme template using <img src="<?php echo $block->getViewFileUrl('publicite1.jpg'); ?>" /> but two others won't be displayed by Magento:

Images not being displayed:

http://www.webdo.tn/wp-content/uploads/2015/09/publicite1.jpg
http://fr.learnlayout.com/images/logo.png

The value in the browser developer tool inspector for these images is

Images being displayed:

https://www.w3schools.com/html/pulpitrock.jpg
https://www.w3schools.com/images/w3schools_green.jpg

What is the problem with these images not being displayed ?

ADDENDUM:

I noticed that it worked after changing the name of one of the images in web/images and in its path in the phtml file, but didn't work again when renaming it to the original name.

It seems the problem is coming from Chrome and Firefox, these images are displaying fine with Safari and Vivaldi. But cleaning the cache of Chrome and Firefox doesn't help. Maybe there's a deep cleaning function somewhere in these browsers ?


texts: Unable to save additional option and Custom Price on Customer Login!

texts:
I'm adding an additional option and custom price of a product via custom api Call in quote using this code
 $quote->addProduct($_product, 1)
            ->addOption(array(
                'product_id' => $_product->getId(),
                'code' => 'additional_options',
                'value' => $this->serializer->serialize($additionalOptions)
            ))
            ->setCustomPrice($result['sample_price'])
            ->setWeight($result['sample_weight'])
            ->setOriginalCustomPrice($result['sample_price'])
            ->getProduct()->setIsSuperMode(true);
        $quote->collectTotals()->save();

it saves and shows the price and additional option But when the customer as a guest adds the product and try to log in, Magento converts the product price to the normal price and removes the additional option.
Any Idea about
-how the guest cart and customer cart merge?
-How can I keep the additional option saved and transfer it to the customer cart as it is?


texts: Show cart page in a popup on add to cart action

texts:
I'm trying to display the cart in a popup on the product detail page once the user clicks on the 'Add to cart' button.

I use a Ajax cart popup extension which displays a pop with option to continue shopping or go to the cart page after the user clicks on the add to cart button. Is it possible to show the cart contents in a popup similar to this?

I found that we can check the add to cart action with the event 'checkout_cart_add_product_complete'. Any ideas?


texts:
I have an InstallData script below which works absolutely fine on Magento 2.2 but failed to install data on Magento 2.1

class InstallData implements \Magento\Framework\Setup\InstallDataInterface
{
public function install(
    \Magento\Framework\Setup\ModuleDataSetupInterface $setup,
    \Magento\Framework\Setup\ModuleContextInterface $context
) {
    $contextInstall = $context;
    $contextInstall->getVersion();
    $data = [];
    $statuses = [
        'data_one' => __('Data One'),
        'data_two' => __('Data Two'),
        'data_three' => __('Data Three'),
    ];
    foreach ($statuses as $code => $info) {
        $data[] = ['status' => $code, 'label' => $info];
    }
     if (!$setup->tableExists('table_name')) {
    $setup->getConnection()->insertArray($setup->getTable('table_name'), ['db_colum_one', 'db_column_two'], $data);
     }

}
}

Can anyone help , if I am missing anything?


texts:
Let's say I have a helper class (let's call it \Vendor\Module\Helper\Cart) which I'd like to use in a block. I understand I should add the helper class in block constructor, so I should extend core block class

For instance vendor/magento/module-multishipping/Block/Checkout/Addresses.php

This is the constructor of that block class

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Filter\DataObject\GridFactory $filterGridFactory,
    \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping,
    \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
    AddressConfig $addressConfig,
    \Magento\Customer\Model\Address\Mapper $addressMapper,
    array $data = []
) {
    $this->_filterGridFactory = $filterGridFactory;
    $this->_multishipping = $multishipping;
    $this->customerRepository = $customerRepository;
    $this->_addressConfig = $addressConfig;
    parent::__construct($context, $data);
    $this->addressMapper = $addressMapper;
    $this->_isScopePrivate = true;
}

I have tried this...

protected $cartHelper;

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Filter\DataObject\GridFactory $filterGridFactory,
    \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping,
    \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
    AddressConfig $addressConfig,
    \Magento\Customer\Model\Address\Mapper $addressMapper,
    \Vendor\Module\Helper\Cart $cartHelper,
    array $data = []
) {
    $this->_filterGridFactory = $filterGridFactory;
    $this->_multishipping = $multishipping;
    $this->customerRepository = $customerRepository;
    $this->_addressConfig = $addressConfig;
    parent::__construct($context, $data);
    $this->addressMapper = $addressMapper;
    $this->_isScopePrivate = true;
    $this->cartHelper = $cartHelper;
}

But this throws error when compiling

  Incompatible argument type: Required type: \Magento\Framework\Filter\DataObject\GridFactory. Actual type: array;

So, I have tried changing constructor in extended class for this

protected $cartHelper;

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Vendor\Module\Helper\Cart $cartHelper,
    array $data = []
) {
    parent::__construct($context, $data);
    $this->cartHelper = $cartHelper;
}

With no success... so I ended with the last try, which made setup:di:compile pass fine

protected $cartHelper;

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Filter\DataObject\GridFactory $filterGridFactory,
    \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping,
    \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
    AddressConfig $addressConfig,
    \Magento\Customer\Model\Address\Mapper $addressMapper,
    \Vendor\Module\Helper\Cart $cartHelper,
    array $data = []
) {
    $this->_filterGridFactory = $filterGridFactory;
    $this->_multishipping = $multishipping;
    $this->customerRepository = $customerRepository;
    $this->_addressConfig = $addressConfig;
    \Magento\Sales\Block\Items\AbstractItems::__construct($context, $data);
    $this->addressMapper = $addressMapper;
    $this->_isScopePrivate = true;
    $this->cartHelper = $cartHelper;
}

So, question would be, is this the right approach to do this?


texts: When is an address saved to the customer?

texts:
When is an address saved in the customer? I mean, is it in the checkout process when saveBilling is called? Or is in the conversion from quote to order when saveOrder is called?

In this question, save means the address can be reused by the customer in another purchase without having to type the address again.


texts:
I know about method

public function addStoreFilter($store = null)
{
        if ($store === null) {
            $store = $this->getStoreId();
        }
        $store = Mage::app()->getStore($store);

        if (!$store->isAdmin()) {
            $this->setStoreId($store);
            $this->_productLimitationFilters['store_id'] = $store->getId();
            $this->_applyProductLimitations();
        }

        return $this;
}

But as you can see it doesn't work for $store->isAdmin().
I'm always getting "admin store" data.

So my question is: how to get product collection for specific store by SKU list under "admin" store?


texts: Magento 2.3.3 - using CSS Critical Path throws strange syntax in source code - how can we solve this?

texts:
Google Page Speed told us, that we have rendering blocking CSS.

Now we try to solve this with CSS Critical Path activated.

We have created a Critical.css file

We have integated the same in our Theme.

All works fine, we try which styles are important and which CSS can load later.

BUT now the source code coming from CSS Critical Path in general adds a weird dot, (like a ".") to the code between media="all" and onload...:

  link rel="preload" as="style" media="all" .
                           onload="this.onload=null;this.rel='stylesheet'"href="http:

See here as well.

When running validator.w3.org it says

  Error: Attribute . not allowed on element link at this point.

and also

    Warning: Attribute . is not serializable as XML 1.0.

So this funny dot (.) is there.

Does anyone of you experts have a clue why this is there and how we could get rid of it?

Any help is so appreciated.

Warm regards


texts: How to get json data on frontend controller in magento2?

texts:
<?php

namespace Vendor\Module\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{

    protected $resultPageFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory)
    {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute()
    {

    }
}


texts:
My actions: I install only: nginx 1.10.1, php7 and mysql 5.6 on ubuntu 14.04.
php install: sudo apt-get install -y php7.0-fpm php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv php7.0-opcache php7.0-soap php7.0-json php7.0-xml
I copy sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/agestor.com.
In agestor.com paste:

upstream fastcgi_backend {
    server unix:/var/run/php/php7.0-fpm.sock;
}

server {
    listen 443 ssl;
    server_name agestor.com;
    set $MAGE_ROOT /var/www/agestor.com/html;
    set $MAGE_MODE default;
    include /var/www/agestor.com/html/nginx.conf.sample;
}

server {
    listen 80;
    server_name agestor.com;
    set $MAGE_ROOT /var/www/agestor.com/html;
    set $MAGE_MODE default;
    include /var/www/agestor.com/html/nginx.conf.sample;
}

And include him: sudo ln -s /etc/nginx/sites-available/agestor.com /etc/nginx/sites-enabled/
But not install magento 2.

sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

error.log: 2016/06/21 14:21:35 [error] 13909#13909: *46 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 37.146.123.141, server: agestor.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "www.agestor.com"
I set up my VPS on this article: magento 2 for ubuntu 14.04


texts:
In exception log i got this error but i don't have this module even my project

exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Frontpagefeature_Block_Frontpagefeature' in /public_html/app/Mage.php:595
Stack trace:
#0 /public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('frontpagefeatur...', Array)
#2 /public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('frontpagefeatur...', 'home-featured')
#3 /public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('frontpagefeatur...', 'home-featured')
#4 /public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /public_html/app/code/core/Mage/Cms/Helper/Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /public_html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#9 /public_html/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#10 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#11 /public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#14 /public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /public_html/index.php(83): Mage::run('', 'store')
#16 {main}


texts: Magento 1.9.2.3 : cannot show associated product of grouped product

texts:
How to fix this error when i will display the associated product of a grouped product from the admin.
The error log indicates : Unknown column 'position' in 'order clause' in the table catalog_product_entity

Here is the log :

SELECT e., at_status.value AS status, links.link_id FROM catalog_product_entity AS e
 INNER JOIN catalog_product_entity_int AS at_status ON (at_status.entity_id = e.entity_id) AND (at_status.attribute_id = '96') AND (at_status.store_id = 0)
 INNER JOIN catalog_product_link AS links ON links.linked_product_id = e.entity_id AND links.link_type_id = 3 WHERE (((e.required_options != '1') OR (e.required_options IS NULL))) AND (at_status.value IN(1, 2)) AND (links.product_id = 1015) AND (e.entity_id != '1015') ORDER BY position ASC
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'position' in 'order clause', query was: SELECT e., at_status.value AS status, links.link_id FROM catalog_product_entity AS e
 INNER JOIN catalog_product_entity_int AS at_status ON (at_status.entity_id = e.entity_id) AND (at_status.attribute_id = '96') AND (at_status.store_id = 0)
 INNER JOIN catalog_product_link AS links ON links.linked_product_id = e.entity_id AND links.link_type_id = 3 WHERE (((e.required_options != '1') OR (e.required_options IS NULL))) AND (at_status.value IN(1, 2)) AND (links.product_id = 1015) AND (e.entity_id != '1015') ORDER BY position ASC


texts: What is the event fires when change the grand total in cart?

texts:
I want to write an observer function which will fire whenever the cart total is changing.

Eg: When add/remove products in the cart,
Add rewards/coupon codes to the cart

My observer function will check whether the cart grand total is greater than zero. If not it will do some calculation with the grand total and save that calculated value to the quote.

I have tried the following events. But non of them fulfilled the requirement.

    controller_action_postdispatch_checkout_cart_index
sales_quote_address_collect_totals_before

Any suggestions will be appreciated. Thanks in advance.


texts: How to attach packingslip to shipment email

texts:
I'm trying to add the packingslip pdf as attachment to the shipping email.

I saw this post Attach invoice to shipment email
This adds the invoice, but not the packingslip.

The only thing I don't know is how to get the right shipment for creating the PDF. I keep getting the error render on non object.

I tried

$shipmenttt = $order->getShipmentsCollection()->getFirstItem();
$shipmentIncrementId = $shipmenttt->getIncrementId();
$shipment = $this->load($shipmentIncrementId);
$pdf = Mage::getModel('sales/order_pdf_shipment')->getPdf(array($shipment));

and

$shipment = $this;
$pdf = Mage::getModel('sales/order_pdf_shipment')->getPdf(array($shipment));


texts: We can't initialize Express Checkout. in Magento2.1.9

texts:
There are already many thread for the problem, But As I check the code why I am receiving this error is -  when user returning from paypal-express to site then in Magento\Paypal\Controller\Express\AbstractExpress.php its not found quote object in function _initCheckout().

In this file its trying to fetch quote object from checkout session "$this->_quote = $this->_getCheckoutSession()->getQuote();" but its not, thats why giving "We can't initialize Express Checkout" error.

All process working fine on my local system but not on the server. In current condition - Css/Js not merged, all cache flushed multiple times, also tried by changing session storage location to 'db' but didn't found solution till yet.

Please reply.


texts:
I have magento 1.9.2.x set up with 2 websites, each with their own store view.

Website 2's local.xml file:

<cms_page>
    <reference name="root">
        <block type="page/html" name="abc" template="page/html/abc.phtml" />
    </reference>
</cms_page>

Website 2's 1column.phtml page:

<?php echo $this->getChildHtml('abc') ?>

Website 2's /page/html/abc.phtml file:

$store_id = 'unfound';
$website_id = 'unfound';

if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) { // store level
    $store_id = Mage::getModel('core/store')->load($code)->getId();
} elseif (strlen($code = Mage::getSingleton('adminhtml/config_data')->getWebsite())) { // website level
    $website_id = Mage::getModel('core/website')->load($code)->getId();
    $store_id = Mage::app()->getWebsite($website_id)->getDefaultStore()->getId();
} else { // default level
    $store_id = 0;
}

echo '<pre>store id: ' . $store_id . ' | website id: ' . $website_id . ' </pre>';

When I navigate to Website 2, I see everything I expect, the website is displaying correctly, using the correct Store View.

However the code in /page/html/abc.phtml produces the following output:

store id: 0 | website id: unfound

Can anyone tell me why this isnt picking up the correct website id, and how to fix it? Please? Thanks.


texts:
How to show the total quantity number(Like 10) instead of "In Stock" status in Magento 2.x?

I need help for Magento 2.x. Recently I have developed an eCommerce site. On products details page has "Stock Availability" using "In Stock" status.

So, I want to show the total number of quantity "like Stock: 20" instead of "In Stock" Status and also quantity number will be increased/decrease after update/place order.

Could anyone please help to do that in my Magento 2.x eCommerce website.

Please check my attached images below then you can get the clear idea about my words what I have mentioned in above?

Please tell me where I have to write the code to get total quantity number Like "Stock: 20"


texts:
Is it possible to have a configurable attribute which is type text instead of drop down or multiple select ?

I want to have a configurable product but the values are pretty much endless so rather than entering them all as dropdown options and then selecting 1 value out of that list I want to see if its possible to have an attribute which can be used to create a configurable product which is type text


texts: Magento admin password reset using md5, why?

texts:
I was surprised that we can access to admin backend resetting admin user password with md5.

UPDATE `admin_user` SET `password` = MD5('anyword') WHERE `admin_user`.`user_id`= 1;

This is some kind of Magento feature or vulnerability? Why password is not depend on encryption key in local.xml?


texts:
Since 3-4 days in admin when i am generating new shipments then
  getting below errors

  Anyone know about above errors ?


texts:
I want to show a template just before all tabs but it's not showing.

my code on file catalog_product_view.xml :

       <referenceContainer name="product.info.detailed">
            <block before="product.info.detailed" name="srapsware_product_related" cacheable="true" template="Srapsware_RelatedProductsUpSellsCrossSells::product/list/items.phtml">
            <arguments>
            <argument name="title" xsi:type="string">Related</argument>
            <argument name="perline" xsi:type="number">6</argument>
            <argument name="maxnum" xsi:type="number">12</argument>
            </arguments>
            </block>
        </referenceContainer>


texts: Guide for API to third party application from inside Magento 2

texts:
The important questions i would like to know are:

Can I call a CURL from inside a Model or ResourceModel?
Is there any standardized way to handle API's to third party apps?

Please keep in mind that, i already know about third party to Magento REST/SOAP API, what i want to know about is Magento 2 to third party APIs