texts: Magento 2: Info Request Data is removed when Update shipping method in Paypal Express Review page

texts:
I'm using the Paypal credit option in Magento 2. On the cart page and Paypal Payflow Express, I have displayed some data of configurable using the info_buyRequest.
when I come to page http://127.0.0.1/mysite/paypal/payflowexpress/review/ and change the shipping method then I'm not getting the product's custom data in the info_buyRequest.
$infoRequestOption = $_item->getOptionByCode('info_buyRequest')

I think issue with this code
$this->quoteRepository->save($this->_quote);

Magento/Paypal/Model/Express/Checkout.php
public function updateShippingMethod($methodCode)
{
    $shippingAddress = $this->_quote->getShippingAddress();
    if (!$this->_quote->getIsVirtual() && $shippingAddress) {
        if ($methodCode != $shippingAddress->getShippingMethod()) {
            $this->ignoreAddressValidation();
            $shippingAddress->setShippingMethod($methodCode)->setCollectShippingRates(true);
            $cartExtension = $this->_quote->getExtensionAttributes();
            if ($cartExtension && $cartExtension->getShippingAssignments()) {
                $cartExtension->getShippingAssignments()[0]
                    ->getShipping()
                    ->setMethod($methodCode);
            }
            $this->_quote->collectTotals();
            $this->quoteRepository->save($this->_quote);
        }
    }
}

Does anyone have an idea regarding this?


texts: Failed to open stream: No such file or directory

texts:
I ran the setup:upgrade command and I'm getting the following error when I open my website

Warning: include(/var/www/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory

I thought this was a permissions issue but I ran chown on the entire magento folder recursively and this seems to do nothing. There are no files in the view_preprocessed folder even after running setup:upgrade and setup:di:compile so I believe that is the issue but I don't know how to solve it


texts: 400 bad request from rest/default/V1/carts/mine/estimate-shipping-methods

texts:
Whenever I go to cart page or checkout page after adding products, console always throws 400 Bad Request. I tried reinstalling Magento and did many things but there is no luck. Estimate shipping address section keep on loading and it doesn't return anything.

Request URL: http://******.com/rest/default/V1/carts/mine/estimate-shipping-methods

The following is the Request Payload:

{address: {country_id: "US"}}
address
:
{country_id: "US"}
country_id
:
"US"

I really don't understand whats happening with this request. What is missing here? What should be the response?

It would be much appreciated if someone provides me an answer.

-Thanks


texts: Retrieving grainular discount information for multiple qty of one item ordered

texts:
I have an problem retrieving specific discount information for an item of ordered with multiple qty.

Here's the scenario.

An item with a price of $100.
A shopping cart price rule of $10 off that item, limited to a quantity of 2.
An order with a qty of 3 for the item (with the above rule applied).

For the order data, the item appears on one row like this:

Original Price: $100
Qty: 3 Subtotal: $300
Discount Amount: $20
Row Total: $280

Is there any way to retrieve the total quantity of items that the rule was applied to.  In this case, it would be 2 (since the rule was limited to qty of 2).  I know that Magento stores the applied_rule_ids, however using this cannot be a reliable way of retrieving the discount data applied to individual items because the Shopping Cart Price rules can be modified after the order has been placed.

It seems like Magento doesn't tell you where exactly discounts are being applied on the quantity level.  It just groups multiple quantities into a single row and tells you overall how much was discounted.

Is it possible to retrieve that one item like this:

Name: Item Name | Discount Amount: $10  (discount applied)
Name: Item Name | Discount Amount: $10  (discount applied)
Name: Item Name | Discount Amount: 0    (discount NOT applied)

Instead of how it is now:

Name: Item Name | Discount Amount: $20  (discount applied to 2 out of 3)


texts: How to use extension_attributes in Magento2

texts: Is there anyone that can give me an example on how to use extension_attributes in Magento2?


texts: No ack for postMessage cookie_check (Onepage Checkout error)

texts:
In onepage checkout page, in browser's console, I can see the following error

Error: No ack for postMessage cookie_check .......... post-robot.js:268:32

This is a file located here https://www.paypal.com/webapps/hermes/static/js/post-robot.js. The error is occuring even if I disable Paypal as Payment Method.

Here's the part of that file that's consoling the error:

setTimeout(function () {
                if (!options.ack) {
                    return reject(new Error('No ack for postMessage ' + options.name));
                }
            }, _conf.CONFIG.ACK_TIMEOUT);

I have no idea what it means or how to fix it. Can you help me?


texts: Magento 2 : Remove "Menu" Tab in Mobile Menu

texts:
I need to remove the "Menu" tab in the mobile menu but keep the "Account" tab in place.

In my theme's default.xml file, I tried adding the following, but it breaks the mobile menu hamburger button.  Clicking the button will no longer show the menu.

<referenceContainer name="page.top">
    <referenceBlock name="store.menu" remove="true" />
</referenceContainer>


texts:
I've installed Magento into a subfolder /var/www/html/magento2
When I access it I need to type http://xxx.xxx.xxx.xxx/magento2

How is it possible to navigate to site without using the subfolder ?
Is this related to .htaccess  file, I have not edited nor moved files around yet.

Thanks


texts: Magento 2: force 404 based on category attribute

texts:
I have created a custom eav attribute for categeories (bool). If set to "no" a category page should present a 404 page.

I have created an observer for the event layout_load_before in which I would like to check the category and redirect to a 404 page if the conditions are met.

While "redirect" (as in a http 301 redirect) is not the proper term as I would like a direct 404 response instead.

I have tried throw new NotFoundException(__('Not found'));. It actually sends a 404 response header but the underlying category page gets rendered nonetheless.

This is my observer's execute function:

public function execute(\Magento\Framework\Event\Observer $observer)
{
    if ($observer->getFullActionName() == 'catalog_category_view'){
        $cat = $this->_registry->registry('current_category');

        if (!$cat->getData('cat404')) {
            throw new NotFoundException(__('Not found'));
        }
    }
}

Any idea?

Thank you


texts: Image resize issue after upgrade from 2.1 to 2.3

texts:
I recently upgrade my system from Magento 2.1 to 2.3 and after an upgrade, I can see that related product images are no longer generating small_images inside the cache folder.
The path before - /media/catalog/product/cache/small_image/240x300/i/r/ir_1.jpg
The path after - /media/catalog/product/cache/i/r/ir_1.jpg
Anyone know about this issue.


texts: Error "Payment model name is not provided in config" when having config in payment section

texts:
I have an extension that has some config fields in the payment section. The extension does not supply a payment method, I just want to have the settings in the Payment Methods section.

module.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Example_MyExtension" setup_version="0.1">
    </module>
</config>

The system.xmllooks like this:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
  <system>

      <group id="myextension" translate="label" type="text" sortOrder="99" showInDefault="1" showInWebsite="1" showInStore="1">
        MyExtension
        <field id="activate_export" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
          Export Orders
          <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
        </field>
      </group>

  </system>
</config>

And thats what it looks like:

So everything's fine until now. Now I want to have a default value, so I create config.xml.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
  <default>
    <payment>
      <myextension>
        <activate_export>1</activate_export>
      </myextension>
    </payment>
  </default>
</config>

When I try to open the configuration, I see nothing and get the following error in system.log:

  Payment model name is not provided in config!

The error is thrown in /vendor/magento/module-payment/Helper/Data.php in getMethodInstance(). As far as I can tell, the code tries to load a payment method named myextension and fails.

When I place the configuration under section sales, everything works as expected.

Questions:

Is this a bug?
If not, is it not only allowed to put configuration for payment modules in payment?


texts: A technical problem with the server created an error throws when customer is saving in backend magento 2.2.6

texts:
In the admin section of Magento, Customer edit & update the content and save the customer. It throws an error like:

  A technical problem with the server created an error

. Try again to continue what you were doing. If the problem persists, try again later.  using Magento 2.2.6, there is no error displayed in log files


texts: "mcrypt_module_open is deprecated" exception in cron in Magento 2.2.6 on PHP7.1 ?

texts:
The method is silenced in core still cron throws exception if debbug mode is enabled.

mcrypt_module_open is deprecated

  // @codingStandardsIgnoreStart
  $this->_handle = @mcrypt_module_open($cipher, '', $mode, '');
  // @codingStandardsIgnoreEnd

What could be the reason?


texts: How to Display the Product Thumbnail Image in Admin Form

texts:
I'm trying to display product thumbnails in my custom module admin form. But for some reason no thumbnail is showing up.

When I use the code below, it only shows the browse button with no thumbnail, like in the image below.

protected function _prepareForm()
{
$model = Mage::registry('cpstest_productcomment');
$form = new Varien_Data_Form(array(
'id'        => 'edit_form',
'action'    => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
'method'    => 'post',
'enctype' => 'multipart/form-data'
));

$fieldset->addField('image', 'image', array(
'label'     => Mage::helper('catalog')->__('Image'),
'required'  => false,
'name'     => 'image',
));
}

And when I use this code, I get an error:
Fatal error: Call to a member function getData() on null in ...\app\code\core\Mage\Catalog\Helper\Image.php on line

$fieldset->addField('image', 'image', array(
'label'     => Mage::helper('catalog')->__('Image'),
'required'  => false, // Make true if required field
'name'     => 'image',
'value' => Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(100)
));


texts: How to implement the following event in Magento : As soon as the customer logs in the details are printed in the log file

texts: I have to print the login details of the customer and when he logged in, into the log file. How to implement the following problem in Magento 2.


texts: getmodel error for custom admin module. grid is blank

texts:
I am using magento 1.8.
And creating custom admin module called manoreport, In single admin module I have 3 functionality fees, donation, commissionconfig, Seperate controller and block for each functionality. And I am creating custom table for only commissionconfig [table name is commission_config], I am getting this install script in core_resource table, and table commission_table also created when I refresh the page.

Here is the config.xml file code for the new table and resources

 <global>
        <models>
            <manoreport>
                <class>Npm_Manoreport_Model_Commissionconfig</class>
                <resourceModel>manoreport_mysql4</resourceModel>
            </manoreport>
            <manoreport_mysql4>
                <class>Npm_Manoreport_Model_Mysql4_Commissionconfig</class>
                <entities>
                    <commission_config>

commission_config

                    </commission_config>
                </entities>
            </manoreport_mysql4>
        </models>
        <resources>
            <commission_config_setup>
                <setup>
                    <module>Npm_Manoreport</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </commission_config_setup>
            <commission_config_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </commission_config_write>
            <commission_config_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </commission_config_read>
        </resources>

But in commissionconfig grid, when I call the function

$collection = Mage::getModel('manoreport/commission_config')->getCollection();

Its blank and I am not getting grid.

In my model folder. I have these files.
Npm/Manoreport/Model/Commissionconfig

<?php
class Npm_Manoreport_Model_Commissionconfig extends Mage_Core_Model_Abstract
{
    public function _construct()
    {
        parent::_construct();
        $this->_init('manoreport/commissionconfig');
    }
}

Npm/Manoreport/Model/Mysql4/Commissionconfig

<?php
class Npm_Manoreport_Model_Mysql4_Commissionconfig extends Mage_Core_Model_Mysql4_Abstract
{
    public function _construct()
    {
        $this->_init('manoreport/commissionconfig', 'commissionconfig_id');
    }
}

Npm/Manoreport/Model/Mysql4/Commissionconfig/Collection

<?php
class Npm_Manoreport_Model_Mysql4_Commissionconfig_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
{
    public function _construct()
    {
        parent::_construct();
        $this->_init('manoreport/commissionconfig');
    }
}

What is my fault? Why I am getting blank page in grid and blank collection.?


texts: Magento 2.2 Update order custom attribute value

texts:
I have tried to update order attribute value which is created custom. attribute are updated but after $order->save(); I got an error.

Fatal error: Uncaught Error: Call to a member function getMethodInstance() on null in /opt/lampp/htdocs/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php:24

Any idea about this?

Please Check My code for your refrence:

$order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($orderData[0]);
$order->setData('ordernum',$orderData[1]);
$order->setData('salesforceid',$orderData[2]);
$order->setData('trackingsummary',$orderData[3]);
$order->setData('shippingstatus',$orderData[4]);
$order->save();


texts: Mag 2.2.3 After Add/Update importing do not change nothing

texts:
i have the products in my site Magento 2.2.3, after a importation add/Update, that products don't change value (Product name ecc....).
i edit and modify any value of this product but what i change i can not see it.
Cache and index i update after this change, but nothing happens in admin view and on-lin view.
thanks


texts: Where can I find a feature list for venia storefront for magento PWA studio?

texts: Can Anybody help me to find out all good features of venia storefront and bugs ?


texts: Email campaign / newsletter with store products

texts:
I'm trying to find the best method to send out a weekly newsletter / email campaign that includes about a dozen selected products.

I've read several different methods that integrate with 3rd party websites, however I'm a little hesitant to go this route and would prefer to achieve this using the default newsletter feature.

What is the recommended method to include products on the newsletter for an email marketing campaign?


texts: How to delete a product in Magento-2 programmatically?

texts:
I am trying to use below code but it is not working,

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create('\Magento\Catalog\Model\Product');
$product->load($productID)->delete();


texts: Magento2: How to get product quantity and minimum quantity value?

texts: In magento 2 how to get product quantity and minimum quantity value customly created modules?


texts: mageplaza and catalog search conflict in magento2

texts: I am using mageplaza plugin in magento 2.3.2. But in catalog search while searching with 2 character length it gives me error like you have processing error. I checked setting in admin panel there is setting like catalog search minimum query length is set to 3. If set this to 1 then it working fine. But on staging with all condition it is working fine. Please let me know the reason, this is happen?


texts: Magento2 how to pass checkbox box customizable option value

texts: I am programmatically adding product to cart from product details page. How can I pass selected checkbox customizable option value along with it?


texts: Get category of configurable from getUsedProductCollection

texts:
I'm getting the simple products of a configurable with the following code:-

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
    $simple_collection = $conf->getUsedProductCollection()
        ->addAttributeToSelect('*')
        ->addFilterByRequiredOptions();

endif;

And then with this collection, I'm conditionally displaying a size chart which works perfectly (foreach($simple_collection as $simple_product)) however I need to determine what table headers to use in the chart by another condition (and currently, I can only think of doing this by category unfortunately).

Rather than just loading the above collection by category ID though, is there any way I can build into the existing collection a way to determine what the category ID is of the configurable product and then use an if statement as necessary in the chart to display various data based on the category ID?

I know how to load the collection from a category ID but unsure if it is possible to determine the current category from getUsedProductCollection...


texts:
My cart.phtml already have <?php echo $this->getBlockHtml('formkey'); ?> but still clear shopping cart & update shopping cart is not working.

Please, give me better solution over this.
Thank You in advance!


texts:
This is my site URL http://www.leenewman.com/ and facing a problem with not found page this is not coming up at all even when I type a bogus URL like http://www.leenewman.com/blahblah it shows just home page rather than not found   page I have to check my admin for any given setting but no luck with that and google has no such result.

Anyone had solved this before please help this would really appreciable.
Note: Magento ver. 1.6.2.0


texts:
We have extended basic Magento Luma theme. Currently, we are working on the compatibility of the site in various browsers.

I have read many posts regarding media query using on Magento. Below is for your view.

//
//  Common (Both desktop and mobile)
//  _____________________________________________
& when (@media-common = true) {

}

//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {

}

//
//  Tablet
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {

}

//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) {

}

Now my question is the below one works for all the mobiles like iPhones and Android:

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m)

or do I need to target specific devices like below:

@media only screen and (min-device-width: 375px) and (max-device-width: 667px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2)

Because in my case the CSS only works when I target specific devices.

Could anyone please help me to understand?


texts: Magento 2: Import/Export Product Attribute Set & it's Attributes

texts:
I refer Magento 2 - Export/Import Product Attributes but no one answered :(

I have already created new Attribute Set & it's Attributes. I have checked Magento Default Import/Export for Products. It will do with all products.

I just want to export My newly created Attribute Set & it's Attributes. I have added in my Local. Now want to upload on a server. Can't override DB/Table.

Can manage through CSV or Custom Code?


texts: How to install Magento CE 2 to specific MySQL version

texts:
this is my first post, maybe it's so basic question.

I have a problem when installing magento CE 2, I got notice "only support MySQL version 5.6.0 or later". But I have 2 versions MySQL installed in my computer, 5.0 and 5.7.11. How do I choose a specific MySQL version so I can install magento correctly?


texts:
I am trying to create a product progrmatically in magento

require_once('./app/Mage.php');

Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$product = Mage::getModel('catalog/product');

$product->setSku("ABC123") // OK
    ->setName("Type 7 Widget") // NOK
    ->setDescription("This widget will give you years of trouble-free widgeting.") // NOK
    ->setShortDescription("High-end widget.") // NOK
    ->setPrice(70.50) // OK
    ->setTypeId('simple') // OK
    ->setAttributeSetId('14') // need to look this up // OK
    ->setCategoryIds("3,7") // need to look these up // OK
    ->setWeight(1.0) // OK
    ->setTaxClassId(1) //taxable goods // ?
    ->setVisibility(4) // catalog, search // NOK
    ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED); // enabled // NOK

$product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));

$product->save();

?>

here is my code . it is giving me error
Fatal error: Class 'Mage_Core_Modelâ€Œâ€‹_App'

Can anybody tell me wh


texts: Magento2:-Add product Grid in the product admin side

texts: I searched for that, but I could not find any resource. How to add product grid in to "Add product" in admin side like related product?


texts:
I need to create a simple adminhtml grid to a table. I went through several tutorials on the internet and none worked.

It's a simple table with an ID, text1, text2, created_at and updated_at columns.

Anyone can help me with a simple tutorial that works ?

Thank you !


texts:
My goal is to sort products on the frontend from newest to oldest.
The products CSV file contains the created_at column (e.g. 2020-10-31 14:05:44). Format seems to be correct.
After the standard import, I'm looking in the catalog_product_entity table, and created_at is actually the import's timestamp (e.g. 2020-11-28 17:38:48).
Am I looking at the wrong DB field? Is there some locale-specific formatting under the hood? (I'm importing for the ro store)
References

The Complete Guide to Magento 2 Product Import / Export
Importing system attribute "created_at" with a timestamp
date issues in magento 2.3.3

Versions: Magento 2.3.5-p1, PHP 7.3.24


texts:
When I click "Place Order" the order ID is always 0 and therefore fails after the first order as the order id already exists.
TABLE SEQUENCE_ORDER_1 gets 0 appended to it
I have no idea why and I've spent ages tracking through all the files that deal with the sales sequence and got nowhere.

Does anyone have an idea?
Where does ORDER ID first get assigned?

  main.CRITICAL: Saving order 000000000 failed: Unique constraint
  violation found [] []


texts: “An error has happened during application run.” error while installing Magento 2.1.2 with sample data

texts:
I've uploaded Magento 2.1.2 CE on my server and want to install it. But after one minute, I get this error:

  An error has happened during application run. See exception log for
  details.

This is everything I have. Not log is inserted in the log files. I also tried to use the solution mentioned here but it could not sovle my problem.
Please help me ...


texts:
i know that question have been asked here before but i have no solution.
im trying to implement pagination rel="next" and rel="prev" and after a lot of research i found this code:

<?php
$actionName = $this->getAction()->getFullActionName();
if ($actionName == 'catalog_category_view') // Category Page
{
$category = Mage::registry('current_category');
$prodCol = $category->getProductCollection()->addAttributeToFilter('status', 1)->addAttributeToFilter('visibility', array('in' => array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG, Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)));
$tool = $this->getLayout()->createBlock('page/html_pager')->setLimit($this->getLayout()->createBlock('catalog/product_list_toolbar')->getLimit())->setCollection($prodCol);
$linkPrev = false;
$linkNext = false;
  if ($tool->getCollection()->getSelectCountSql()) {
     if ($tool->getLastPageNum() > 1) {
        if (!$tool->isFirstPage()) {
            $linkPrev = true;
            if ($tool->getCurrentPage() == 2) {
                $url = explode('?', $tool->getPreviousPageUrl());
                $prevUrl = @$url[0];
            }
            else {
                $prevUrl = $tool->getPreviousPageUrl();
            }
        }
        if (!$tool->isLastPage()) {
            $linkNext = true;
            $nextUrl = $tool->getNextPageUrl();
        }
    }
}
if ($linkPrev) echo '<link rel="prev" href="' . $prevUrl . '" />';
if ($linkNext) echo '<link rel="next" href="' . $nextUrl . '" />';
}
?>

i added this code to my head.phtml and it dosent show in the page source as rel="next" and rel="prev".

please help me with this.


texts:
Magento order grid: is it a new or an existing customer?

Question: Is there a way to mark or colour the order in the order grid based on the question: is it a new or an existing customer? - or how would I go about doing this

Preferably I would not only like to validate by account used - but rather by: has an order been placed before using the email address


texts: How to show the message box in Magento 2 (on the home page). message box working the whole site except for the home page.


texts:
i was intalling magento 2.3.5 which the lattest magento edition on my local system and encountered this strange error. when i dig a bit in to it, i found this solution which works well but i wana know why this happens. am sharing full lines code that has been changes in order to make it working as they have not explained it.

vendor\magento\framework\Image\Adapter\Gd2.php file. at line 96

private function validateURLScheme(string $filename) : bool
  {
      $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
      $url = parse_url($filename);
      if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
          return false;
      }

      return true;
  }


texts: what is the difference between cms page link and cms static block. Catalog product link and catalog category link

texts: I know about catalog new product list, and how to make them show on the home page using the widget. But am having a hard time understanding the difference between cms page link and cms static block. Catalog product link and catalog category link.  And how to use them.


texts: Sorting Product List by more than one attribute

texts:
On my category page's normal listing of products, I have it set to sort the products by a custom yes/no attribute in the admin. This works fine, but I also want to sort it by SKU after it's sorted by the attribute. Here's my current code in catalog list.phtml:

$_productCollection=$this->getLoadedProductCollection();
foreach ($_productCollection as $_product):
    // do product stuff here
endforeach;

I've tried adding things like $_productCollection->setOrder('sku', 'ASC');, addOrder, addAttributeToSort, but none of them seem to actually affect the sort order of the products on the page. What am I missing?

Progress from comments following pzirkind's suggestion of https://stackoverflow.com/questions/5673093/sort-magento-collection-after-load :

$_productCollection=$this->getLoadedProductCollection();

$collectionReflection = new ReflectionObject($_productCollection);
$itemsPropertyReflection = $collectionReflection->getProperty('_items');
$itemsPropertyReflection->setAccessible(true); // Make it accessible

$collectionItems = $itemsPropertyReflection->getValue($_productCollection);

usort($collectionItems, $yourSortingCallback);

$itemsPropertyReflection->setValue($collectionItems, $collectionItems);

$itemsPropertyReflection->setAccessible(false);

There's a couple of issues with this, #1 being that I'm not sure how to get $collectionItems back into the collection... this doesn't do it by itself. If I print_r($collectionItems) it is now sorted by SKU, however the other problem is that the order is only for the products on that page, this sorting is NOT done before pagination is performed some how.

In order to get past the first problem, I tried a different approach and this DOES work. However, it's still only sorting by SKU AFTER pagination

$_productCollection=$this->getLoadedProductCollection()->clear()->addAttributeToSort('sku', 'ASC');


texts: adding css class to layout render block code in product detail page

texts:
I am trying to add CSS class to hide this block in product detail page. I tried css_class=>'my_css_class' but it is not working. Tried to add in product_view XML as well but there also it didn't work. Can anyone help how to get this working?

echo $this->getLayout()
                    ->createBlock('Magento\Catalog\Pricing\Render',
                        "product.price.final",
                        [
                            'data' => [
                                'price_render' => 'product.price.render.default',
                                'price_type_code' => 'final_price',
                                'zone' => 'item_view'
                            ]
                        ]
                    )
                    ->toHtml();


texts: Magento 2 : How to Remove Encryption key from URL

texts: I want to get rid of URL encryption key.


texts: I want custom sorting order for attribute for each category magento 2

texts:
I want custom sorting order for attributes for each category.
Please see attached image.
If in the category 1, the colour option displaying at the top, then for a category two size options would be the first. means I want custom sorting order.
Can you, guys, please let me know the exact file from where this sorting option working.


texts: Magento 2: Difficulty in add simple product, product get added as virtual product

texts:
HI I am trying to add product in magento 2 from the admin panel. But product is added as the virtual product even if I select the simple product when adding new product.

Please help me to solve this issue.


texts: Magento 2 Edit Product page Error: Every derived table must have its own alias

texts:
I'm using magento 2.2.5 and when i opened the edit product page the product name, price,etc doesnt load at all, and when i checked the var/log/exception.log i got the following error:

  Zend_Db_Statement_Exception(code: 42000): SQLSTATE[42000]: Syntax
  error or access violation: 1248 Every derived table must have its own
  alias, query was: SELECT u.* FROM (SELECT t.value,
  t.attribute_id, t.store_id FROM
  catalog_product_entity_decimal AS t WHERE (entity_id = '6144') AND
  (attribute_id IN ('75', '76', '79', '91', '80', '120', '99')) AND
  (store_id IN (0)))UNION ALL(SELECT t.value, t.attribute_id,
  t.store_id FROM catalog_product_entity_varchar AS t WHERE
  (entity_id = '6144') AND (attribute_id IN ('82', '85', '122', '103',
  '71', '86', '192', '84', '87', '88', '107', '95', '109', '119', '222',
  '236', '237', '238', '239', '240', '241', '242', '244', '245', '98',
  '112', '113', '97', '114', '117', '215', '129', '216', '130', '217',
  '218', '219', '220')) AND (store_id IN (0)))UNION ALL(SELECT
  t.value, t.attribute_id, t.store_id FROM
  catalog_product_entity_int AS t WHERE (entity_id = '6144') AND
  (attribute_id IN ('100', '127', '163', '89', '191', '167', '92',
  '121', '171', '126', '173', '81', '96', '185', '234', '176', '177',
  '102', '161', '123', '124', '125', '213', '128', '131', '153')) AND
  (store_id IN (0)))UNION ALL(SELECT t.value, t.attribute_id,
  t.store_id FROM catalog_product_entity_datetime AS t WHERE
  (entity_id = '6144') AND (attribute_id IN ('104', '77', '105', '78',
  '93', '94')) AND (store_id IN (0)))UNION ALL(SELECT t.value,
  t.attribute_id, t.store_id FROM catalog_product_entity_text
  AS t WHERE (entity_id = '6144') AND (attribute_id IN ('83', '101',
  '72', '106', '73', '162', '164', '169')) AND (store_id IN (0))) AS
  u ORDER BY store_id ASC


texts: Is there anything we need to do for APPSEC-1079 SUPEE 6788?

texts:
There is 4th SUPEE 6788 security notice :

APPSEC-1079, addressing potential exploit with custom option file type

  "This change will affect any customization that uses product custom
  options to save information as a PHP object. Such an approach will no
  longer be possible."

After installing the patch, do we need to do anything with this?


texts: How to get a product full link REST API?

texts:
I am trying to get Full product link, so can use it in share in mobile application.

I already used API:

GET https://domain.com/index.php/rest/V1/products/:sku

and have a response, but can't get a full link.
How this?


texts: Can SUPEE-1533 be applied after SUPEE-5344 and SUPEE-5994

texts: I have installed the SUPEE-5344 and SUPEE-5994 before, but forgot to install APPSEC-212 and SUPEE-1533. Can these two be installed now? Magento version is 1.4.1.1.


texts: Module removed but Tables remaining in database in Magento2

texts:
I have created one module/extension using installer script in magento2.

After that I removed it, but tables in database still remain as it is.

can anyone tell me how to uninstall module/extension completely and remove extension's/module's  tables from database?


texts: Catalog search always returns "There is not any product available"

texts:
When I enter a product name in search box and search it then result is always display that : There is not any product available. I have done all configuration of product from admin.

catalog, search
in stock
qty > 0

etc.. all configurations are ok.

Kindly help me how can I solve this?


texts: Code Compilation Error - Cannot Redeclare Class

texts:
So, after some painful debugging (and enabling scream in xdebug), I was able to discover that some pages are returning a fatal error (such as catalog/product/gallery/id/155/image/202/)
where Magento seems to be including the same class twice.  I haven't yet figured out whats going on as I am not yet too familiar with the compilation internals

but I did discover that deleting the particular class in includes/src/__catalog.php  just causes different classes to have the error, and deleting that entire file fixes the issue (but i lose all that compiled code).

I have tried to recompile the code with no luck on improving this issue.

I do prefer to leave code compilation enabled, because from an IO perspective, it does increase performance quite a bit.

I guess I am unsure as why the class is being included twice?  I assume there is some logic messed up in the Autoloader that isnt detecting that the class is already loaded when it tries to load it again?  Although it doesnt seem to have problems on other pages.

greping for existing classes shows:

$ grep -irn mage_catalog_block_breadcrumbs .
./app/code/core/Mage/Catalog/Block/Breadcrumbs.php:34:class Mage_Catalog_Block_Breadcrumbs extends Mage_Core_Block_Template
./app/code/core/Mage/Catalog/Block/Breadcrumbs.php:51:     * @return Mage_Catalog_Block_Breadcrumbs
./app/code/core/Mage/Compiler/etc/compilation.xml:231:            <Mage_Catalog_Block_Breadcrumbs/>
./includes/src/Mage_Catalog_Block_Breadcrumbs.php:34:class Mage_Catalog_Block_Breadcrumbs extends Mage_Core_Block_Template
./includes/src/Mage_Catalog_Block_Breadcrumbs.php:51:     * @return Mage_Catalog_Block_Breadcrumbs
./includes/src/__catalog.php:35:class Mage_Catalog_Block_Breadcrumbs extends Mage_Core_Block_Template
./includes/src/__catalog.php:52:     * @return Mage_Catalog_Block_Breadcrumbs

error:

PHP Fatal error:  Cannot redeclare class Mage_Catalog_Block_Breadcrumb in /var/www/vhosts/site/gitrepo/pti/magento/includes/src/__catalog.php on line 238
Jul 12 07:03:29  httpd: PHP Stack trace:
Jul 12 07:03:29  httpd: PHP   1. {main}() /var/www/vhosts/site/gitrepo/pti/magento/index.php:0
Jul 12 07:03:29  httpd: PHP   2. Mage::run() /var/www/vhosts/site/gitrepo/pti/magento/index.php:90
Jul 12 07:03:29  httpd: PHP   3. Mage_Core_Model_App->run() /var/www/vhosts/site/gitrepo/pti/magento/app/Mage.php:683
Jul 12 07:03:29  httpd: PHP   4. Mage_Core_Controller_Varien_Front->dispatch() /var/www/vhosts/site/gitrepo/pti/magento/includes/src/__default.php:20061
Jul 12 07:03:29  httpd: PHP   5. Mage_Core_Controller_Varien_Router_Standard->match() /var/www/vhosts/site/gitrepo/pti/magento/includes/src/__default.php:17484
Jul 12 07:03:29  httpd: PHP   6. Mage_Core_Controller_Varien_Action->dispatch() /var/www/vhosts/site/gitrepo/pti/magento/includes/src/__default.php:17927
Jul 12 07:03:29  httpd: PHP   7. Mage_Core_Controller_Front_Action->preDispatch() /var/www/vhosts/site/gitrepo/pti/magento/includes/src/__default.php:13571
Jul 12 07:03:29  httpd: PHP   8. Mage_Core_Controller_Varien_Action->preDispatch() /var/www/vhosts/site/gitrepo/pti/magento/includes/src/__default.php:14324
Jul 12 07:03:29  httpd: PHP   9. Varien_Autoload::registerScope() /var/www/vhosts/site/gitrepo/pti/magento/includes/src/__default.php:13689


texts: How to create custom API for custom shipping methods

texts:
we have marketplace multi vendor/seller site. we are doing Android App for the site....

we are using custom Shipping method in our site.

But in Android app, we are calling this API to get shipping methods : shoppingCartShippingList()

we are getting shipping method , but we are getting shipping charges as zero.

So we are planning to create a Custom API for this.

please help me how to create custom API for shipping method.

or please give me some good links so i can write custom API in easy way.


texts: Product image Upload (Flash) not working in Firefox

texts:
Image Upload using Flash is not working in Firefox. It works in IE and Chrome on the same system.

The usual error "ssl error invalid or self-signed certificate" appears. I tried to debug it with Fiddler, but there is either no request made at all, or a HTTP CONNECT is shown but no data sent.

I tried on different sites, all Magento 1.9+ (one 1.9.2.1), with different Certificates (from StartSSL and Comodo). The problem is on all of them with Firefox 40 and 41.0b8 an OS X and Windows.
Flash Player version is "18.0.0.232" on all devices.

On all of this devices, the Upload works with Chrome and IE/Safari.

The Qualys SSL Test gives A or A+ for all sites.


texts: Why getData() and toArray() on collection have a different behaviour for EAVs tables such as Product?

texts:
$collection = $this->productCollectionFactory->create();
 $collection->addAttributeToSelect('*');

collection->getData() -> returns only a few data (most of the main table until explicitly provided in addAttributeToSelect('my_attr_code').
collection->toArray() -> returns complete data.

This behaviour is same on the Flat tables, but why different on EAV table such as product?


texts: Customers on Admin not showing and producing an error after migration

texts:
After completing the migration from Magento 1.14.4.2 to 2.3.2 we get an error
"There has been an error processing your request
Exception printing is disabled by default for security reasons.

  Error log record number: 1069290760737" and when we view the error in
  the  report this is what it says

{ 0 : Missing required argument $options of Magento\Eav\Model\Entity\Attribute\Source\Config. , 1 :#1 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]....


texts:
this may seem a duplicate but I couldn't find one and been struggling with for quite some time now.

I'm extending Order Grid with a Column on Admin panel.

I have core_layout_block_create_after observer which, when called, addColumnAfter on $block = $observer->getBlock(); in my Observer's method:

 $block = $observer->getBlock();
    // how do I bind order id on this link
    $link = Mage::helper('adminhtml')->getUrl('adminhtml/mymodule/index');
    if ($block instanceof Mage_Adminhtml_Block_Sales_Order_Grid) {
        $block->addColumnAfter('action_cool_api',
            array(
                'header' => Mage::helper('adminhtml')->__('Cool Test'),
                'index' => 'action_cool_api',
                'type' => 'action',
                'actions'  => array(
                    array(
                        'url'     => $link,
                        'caption' => Mage::helper('adminhtml')->__('Cool'),
                    ),
                )
            ),
            'status'
        );
    }

How do I bind order id on every link?


texts: Remove the first step (i.e.login step) from the checkout process in a particular theme

texts:
I have two themes (mobile and desktop) for the single store view.
 In mobile theme I want to remove the Login step which is the first step of the checkout process.
So now I have created a block with the following code (Thanks to @Abdul)

<?php
class Remove_Step_Block_Checkout_Onepage extends Mage_Checkout_Block_Onepage
{
  public function getSteps()
  {
    $steps = parent::getSteps();
    if (array_key_exists('login', $steps) && $this->checkMobileAgents()) {
      unset($steps['login']);
    }
    return $steps;
  }

  public function getActiveStep()
  {
    return 'billing';
  }

  public function checkMobileAgents()
  {
    $mobileAgents = "/(nokia|iphone|android|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|"
.     "htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|"
. "blackberry|blackberry10|bb10|playbook|alcatel|amoi|ktouch|nexian|samsung|^sam\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|"
. "symbian|smartphone|mmp|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\-|longcos|pantech|gionee|^sie\-|portalmmm|"
. "jig\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\s*mobi|opera\*mini|320x320|240x320|176x220"
. ")/i";
  if (preg_match($mobileAgents, strtolower($_SERVER['HTTP_USER_AGENT']))) {
    return true;
  }
  return false;
  }
}
?>

Now the problem is that in the checkout page the 2nd step is coming but in inactive state.
Please suggest how to make it active ?
Thank you.


texts: Magento 2 - How I can get category for related products

texts:
How I can get categories for related products like in the following image:

I use this code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category
echo $category->getName();

in the Magento_Catalog/templates/product/list/items.phtml file but it display the category of the current product not the related products category.
Or maybe I can find a module with this functionality?
Thank you


texts: Customer group redirect to specific home age

texts:
Magento version - 2.1.9

Issue - We have a clothing store where we have 6 to 7 customer groups so what we are looking for is instaed of having same home page for every custom group we want to show a different home page.

I wanted to write a logic when session login, get customer group id and redirect path cmd page url but I don't in which file I override.

Does anyone have any ideas how to implement this?

Thanks in advance.


texts:
SalesQuoteCollectTotalsBefore

This observer will dispatch when the shipment is selected. After that, I need to apply a coupon code.

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

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

    $couponCode = "FIRSTORDER";
    $quote = $cart->getQuote()->setCouponCode($couponCode)
                              ->collectTotals()
                              ->save();
}

I created a coupon code FIRSTORDER. But I try to execute the function I am getting the following error.

  "SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data"

How to solve this issue?. How can I apply the coupon code? please share your valuable feedback


texts: Getting exception: Boolean value is expected, supported values

texts:
I am trying to develop magento2.1.5 module but getting exception for my admin controller:

Boolean value is expected, supported values: array (
  0 => true,
  1 => 1,
  2 => 'true',
  3 => '1',
  4 => false,
  5 => 0,
  6 => 'false',
  7 => '0',
)

Error log record number: 763179888

here is my controller to access from admin:

namespace MyVendor\MyModule\Controller\Adminhtml\Layout;

use MyVendor\MyModule\Controller\Adminhtml\Layout;

class Index extends Layout
{
  public function __construct(
    \Magento\Backend\App\Action\Context $context
  )
  {
    parent::__construct($context);
  }

    /**
    * @var \Magento\Backend\Model\View\Result\Page
    */
    public function execute()
    {
      if ($this->getRequest()->getQuery('ajax')) {
            $this->_forward('grid');
            return;
        }

        /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
        $resultPage = $this->_resultPageFactory->create();
        $resultPage->setActiveMenu('MyVendor_MyModule::main_menu');
        $resultPage->getConfig()->getTitle()->prepend(__('My Module'));

        return $resultPage;
    }
}

namespace MyVendor\MyModule\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Registry;
use Magento\Framework\View\Result\PageFactory;

abstract class Layout extends Action
{
    /**
     * Authorization level
     *
     * @see _isAllowed()
     */
     const ADMIN_RESOURCE = 'MyVendor_MyModule::manage_layout';

     /**
     * Core registry
     *
     * @var \Magento\Framework\Registry
     */
    protected $_coreRegistry;

    /**
     * Result page factory
     *
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $_resultPageFactory;

    /**
     * @param Context $context
     * @param Registry $coreRegistry
     * @param PageFactory $resultPageFactory
     */
    public function __construct(
        Context $context,
        Registry $coreRegistry,
        PageFactory $resultPageFactory
    ) {
       parent::__construct($context);
        $this->_coreRegistry = $coreRegistry;
        $this->_resultPageFactory = $resultPageFactory;
    }
}

can anybody help me what should be the reason for this error?


texts: how product images sizes effect bandwith and speed of site

texts:
we uploaded product images with 400 kb,

when uploading the images, will it use bandwidth of 400 kb or will it take the bandwidth of

what product image size we gave in base and thumbinal width and how it works for zooming .

when the image is zooming, will it take 400 kb bandwidth or only the size of zooming the we set.

please guide me about this.

thanks in advance.


texts:
I've run the following commands as I've added a new module:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-contet:deploy

after running those commands I've some issues with admin panel, So I run static-deploy command but with ar_SA language.

since then I notice a part of website (widget) appear and disappear without changing the design.

what are causes of that


texts: Hi there I'm trying to install Magento 2, and i'm getting "The requested PHP extension ext-xsl * is missing from your system" please help


texts: Injected objects into blocks via layout XMLs MUST implement CollectionDataSourceInterface

texts:
\Magento\Framework\Data\CollectionDataSourceInterface, to be more precise.

So imagine having this in - say - cms_index_index.xml:

<block class="Some\Block" name="block" template="tpl.phtml">
    <arguments>
        <argument name="someObj" xsi:type="object">Some\Object</argument>
    </arguments>
</block>

Block arguments of type object are resolved via \Magento\Framework\View\Layout\Argument\Interpreter\DataObject, class which does a seemingly useless thing: it's checking if your passed object is of type \Magento\Framework\Data\CollectionDataSourceInterface, throwing an exception if it's not.

Does anyone have the slightest clue as to why this validation is needed? The interface is - for now, at least - empty (marker interface).

Related post: http://magento-quickies.alanstorm.com/post/148712996610/a-typical-magento-2-programming-experience/embed


texts: How to Disable previous checkout step when goes to next step in magento2

texts:
We have successfully added a new step in checkout page for magento2.

Please find a code for custom JS for that step:

  Location of File:
  app/code/Vendor/CheckoutStep/view/frontend/web/js/view/customer-step.js

define(
    [
        'ko',
        'uiComponent',
        'underscore',
        'Magento_Customer/js/model/customer',
        'Magento_Checkout/js/model/step-navigator'
    ],
    function (
        ko,
        Component,
        _,
        customer,
        stepNavigator
    ) {
        'use strict';
        /**
        *
        * mystep - is the name of the component's .html template,
        * <Vendor>_<Module>  - is the name of the your module directory.
        *
        */
        return Component.extend({
            defaults: {
                template: 'Vendor_CheckoutStep/customerstep'
            },

            //add here your logic to display step,
            isVisible: ko.observable(true),

            /**
            *
            * @returns {*}
            */
            initialize: function () {
                this._super();
                                // register your step
                stepNavigator.registerStep(
                    //step code will be used as step content id in the component template
                    'customer-step',
                    //step alias
                    null,
                    //step title value
                    'Customer',
                    //observable property with logic when display step or hide step
                    this.isVisible,

                    _.bind(this.navigate, this),

                    /**
                    * sort order value
                    * 'sort order value' < 10: step displays before shipping step;
                    * 10 < 'sort order value' < 20 : step displays between shipping and payment step
                    * 'sort order value' > 20 : step displays after payment step
                    */
                    8
                );

                if(customer.isLoggedIn())
                {
                    ko.observable(false);
                    stepNavigator.next();
                }

                return this;
            },

            /**
            * The navigate() method is responsible for navigation between checkout step
            * during checkout. You can add custom logic, for example some conditions
            * for switching to your custom step
            */
            navigate: function () {

            },

            /**
            * @returns void
            */
            navigateToNextStep: function () {
                stepNavigator.next();
            }
        });
    }
);

  HTML file :
  app/code/Vendor/CheckoutStep/view/frontend/web/template/customerstep.html

    <form data-bind="submit: navigateToNextStep" novalidate="novalidate" class="form form-shipping-address">
        <fieldset class="fieldset">

        </fieldset>

                <button data-role="opc-continue" type="submit" class="button action continue primary">

                </button>

    </form>

Now, if customer is logged in it will go to next step directly, which is working fine,

 if(customer.isLoggedIn())
 {
     ko.observable(false);
     stepNavigator.next();
 }

When I click on the previous step, It will go to the previous step. I need to disable the previous step when the customer is logged in.


texts: Decimal or integer attribute (without currency symbol)

texts:
I have a question regarding an attribute I have to set up in Magento.

Here I have the following values:

0-1000
1000-2000
2000-3000
3000-4000
4000-5000
5000-6000
6000-8000
8000-10000
>10.000

If I have a product with value 900 the layered navigation should add this to the top value-range.

0-1000 (1)
1000-2000
2000-3000
3000-4000
4000-5000
5000-6000
6000-8000
8000-10000
>10.000

If I have another product with value 2350 it should be added with (1) to the third line.

0-1000 (1)
1000-2000
2000-3000 (1)
3000-4000
4000-5000
5000-6000
6000-8000
8000-10000
>10.000

And so on.

After much reading and digging I found out I need an integer/decimal attribute (without the currency sign).

As a test I've setup a price attribute and this works, however I see the currency sign.

I followed this link and the answer from Floordesign. I'm using the euro currency and not the Romanian currency so "RON" doesn't work for me.

Is there someone who can help me out with this one?


texts: Buy 2 different SKU together get 10% discount on both items?

texts:
If been trying this for over 2 hours now in every possible way and I cannot get it to work.

I would like to have a discount of 20% when you buy two specific SKU. So for example when I order SKU 111 and SKU 222 together I get 20% only on these two items.

So if have further items in the cart it should only discount the SKU 111 and 222 nothing else. It works fine with one SKU but not with both. As soon as I have both SKU it just ignores the discount.

Here is what I have set up:
    CONDITIONS
    If ALL  of these conditions are TRUE :
      If an item is FOUND  in the cart with ALL  of these conditions true:
        SKU  is  111
        SKU  is  222

and here:
    ACTIONS
    If ALL  of these conditions are TRUE :
      SKU  is  111
      SKU  is  222

as I said it works with one SKU but how do I combine that you have to have both SKU in the cart not just one of them.
Thanks for the help.

UPDATE:
I managed to get it to work like this but as soon as you have more than one pair it does not work.


texts: Stop swatches from loading images on product detail

texts:
I have two swatches.. color and size. Is there a way to stop the size swatches from reloading the picture of the product and keep the color swatch working as usual?

Ty!


texts: Magento 1.8 Flat Product and Category Data

texts:
In Magento 1.8.0, the flat product and flat category indexes have been removed.

Does Magento 1.8 no longer support the flat product and category tables?  If Magento 1.8 does support the flat product and category tables, how are these table created and populated?


texts: Magento 2: Why are my luma icons not showing?

texts:
I made a custom theme with luma as my parent theme.
Somehow it's only showing the icons of the blank theme and not the one of luma.

Do I need to copy any fonts or declare them in my custom theme?

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
  <title>My Theme</title>
  <parent>Magento/luma</parent>
</theme>

Any ideas?


texts: Magento 2.1 How to change member birthday date format

texts:
By default the date format is mm/dd/yyyy when new member register.

How can I change the date format of birthday field to dd/mm/yyyy?

I have tried to change locale to EN_UK, EN Canada, and also tried to change date format in Store > Configuration > Catalogue but after all changes seems they won't affect the date format for member registration.


texts:
I currently have a magento 1.9 store running on domain1.ac.uk without any issues.

I'm not getting everything ready for shop.domain2.ac.uk to display different themes and products but work via the same magento admin.

I've created a CMS page unique for shop.domain2.ac.uk.
Setup via Manage Stores a new Webiste Name/Store Name and Store View Name for both domain1.ac.uk and shop.domain2.ac.uk

Updated the configuration for shop.domain2.ac.uk to have the correct base url

Added the following code to my index.php

switch($_SERVER['HTTP_HOST']) {
    case 'shop.domain2.ac.uk ':
        $mageRunCode = 'bpslw';
        $mageRunType = 'bpsl';
    break;
}

After this setup, if I go to shop.domain2.ac.uk it gives me a 404 page.

I've found questions like the following: Magento Multi-Store with Domain Alias - 404 Error on 2nd Store

However looking over the answers here hasn't helped as the CMS page for shop.domain2.ac.uk is set to display on all store views.


texts: Add Product Quantity in Magento Order Item in Admin Panel

texts:
I want to show product quantity in Magento 1.9.x order items in admin panel. I'm not talking about quantity ordered, but product quantity itself.
Is there a way to check product qty in sales order item in Magento admin panel?
Thanks.


texts: Image upload from one source in magento2?

texts: I'm searching for a possibility to replace the image upload of local files with another source like 3S of AWS or an FTP. It should be just one other source - our product manager shouldn't be able to select between several sources.


texts: Printing Custom Attribute of a product on My Downloadable Products page

texts:
I have a custom product attribute of code format for all Downloadable Products.

If a customer purchases a Downloadable Product, I want them to be able to see that attribute when they Download the product in the  "My Downloadable Products" section, in app/.../template/downloadable/customer/products/list.phtml

Is there a way I can print that attribute in that template file, within the foreach $_items as $_item loop?

I have tried $_item->getData('format'); and $_item->getPurchased->getData('format'); and neither are working. I assume the problem is because only certain attributes are being loaded in this view at present but I am not sure how to load them.

Many thanks for any help in advance.


texts: Rerference error: $j is not defined in optcheckout_rwd.js - Checkout as guest button not working - Magento 1.9

texts:
I'm getting a strange error on my Magento 1.9.0.1 website.

We have recent modified the RWD theme quite heavily, aesthetically.

When we progress to step 1 of the checkout process, the continue button beneath the:

"Checkout as a Guest or Register"

Throws this JS error up and doesn't work, however, if you input a username and password (registered customer) the login button works fine...

" ReferenceError: $j is not defined opcheckout_rwd.js:29 "

Its in relation to this line of code in the JS file (line 29):

" $j('body').addClass('opc-has-progressed-from-login'); "

I have tried to comment out the line, this works but then the checkout behaves quite strange and doesn't display the accordion titles or the summary of your progression on the right hand side.

Any advice would be greatly appreciated.


texts: Error: Mismatched anonymous define() module error when integrating intl-tel-input with mageto2

texts:
I am trying to use https://github.com/jackocnr/intl-tel-input with magento2 on customer registration form for mobile number field to show country flag for choosing phone number but i am getting error "Error: Mismatched anonymous define() module..."

I have followed some tutorials and my js is being added and its working fine but in browser console i get above mentioned error
Content of module_name/view/frontned/requirejs-config.js are:

var config = {
map: {
    '*': {
        intlTelInput: "Vendor_Module/js/plugin/intlTelInput.min",
    }
},
"shim": {
    intlTelInput: "Vendor_Module/js/plugin/intlTelInput.min"
   }
};

Sometimes this works and sometimes it does not works. By not working i mean to say that sometimes flags appears on input field sometime it does not but console is showing error everytime i refresh or open this page.
For more info i am attaching the screenshot.

Thank you for the help.


texts: How to put Shopping cart on the right sidebar in checkout?

texts:
I want to put the shopping cart at the right side of of my horizontal checkout.
Something like this


texts: Magento 1.9 Send data from observer to phtml without block

texts: We create observer and want observer data in .phtml file of my custom module. how we can get data without using block.


texts: How to Display Product Images by Image Role

texts:
I am trying to figure out how to display product images by their image role inside Magento_Catalog/templates/product/image_with_borders.phtml
Each product on my shop page will have three images each with their own image role (base, preview, hover).
This is how my product currently looks:

Here is my image_with_borders.phtml file:
<?php /** @var $block \Magento\Catalog\Block\Product\Image */ ?>

<img
    src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
    alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"
    class="main"
    max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>"
    max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>"
/>

How can I request the images with the roles, base, preview and hover in this file?


texts: How to give customers an option to change their currency?

texts: I want the customers to have an option where they can switch between different currencies by selecting from a drop-down menu, and have that change take effect store-wide. The default currency will be USD when a customer signs up but they should have an option of changing it themselves.


texts:
I have three websites under single magento installation and would like to generate hreflang tags for each websites manually.

I used the code mentioned in this question

<?php foreach (Mage::app()->getWebsites() as $website) {
    foreach ($website->getGroups() as $group) {
        $stores = $group->getStores();
        foreach ($stores as $store) {
            $storeCode = substr(Mage::getStoreConfig('general/locale/code', $store->getId()),0,2);
            echo '<link rel="alternate" hreflang="' . $storeCode . '" href="' . $store->getCurrentUrl(false) . '"/>' . "\n";
        }
    }
}
?>

However, this only outputs hreflang available as storeview language. Also no coutntry is specified.
I would like to use more hreflang tags as fi,de, en-ca etc.

How can I manually write hreflang tag?

--- UPDATE ---

For now, I could manually write hreflang by creating head.phtml for each websites.
Then to add, for example,

<link rel="alternate" href="http://www.mywebsite.com<?php $urlString = Mage::helper('core/url')->getCurrentUrl(); $url = Mage::getSingleton('core/url')->parseUrl($urlString); $path = $url->getPath();echo $path ?>" hreflang="en-gb" />

This works. And so far Google Webmastertool is not giving any errors.
However, this method obviously doesn't list all the available languages in my shop.
But if I don't create each head.phtml and just have one head.phtml with the code above, it will add extra store code when you are on different website.
Any good solution for this?


texts: How make examplary, full module step by step?

texts: I searched how make examplary, full  module for Magento 2 step by step. Can You send me honest links?


texts: time to first byte 8-9 seconds on category page

texts:
I just started adding products to a new magento setup. The theme pages are all loading quickly. However the first category that I started to add products to is quite slow to load the first byte.

You can see that here: http://gostwear.nextmp.net/english/coveralls-overalls.html

there are only 4 configurable SKUs on there right now. though the total amount of SKUs for each is quote large (about 300 SKUs for one of those configurable products).

I am not sure if it is because of how many SKUs there are or something else. The rest of the pages seem to load quickly. And it mostly seems to be waiting for that first byte to load.

Any help is appreciated!


texts: Magento 1.9 Authorize.net payment gateway

texts:
We want to use two Authorize.net payment method on site, Actually we have two merchant account so once a limit for transaction one is achieved on same time we want to use second one, so we can disable first one and enable second vice versa..
Please suggest what is better way to achieve this ,
Can we copy the  autorize.net payment and use with some another name , if yes then how please


texts: Populate sub category drop down based on category selected magento2

texts:
I have used below code to populate sub categories in other dropdown once the parent category is selected.

Used this code in my template file.

app/code/Vendor/Module/view/frontend/template/category.phtml

        <select id="parent-cat" name="parent-cat" onchange="getChildrenList(this.value)">
            <option value ="">- Please Select -</option>
             <option value ="3">Cat1</option>
             <option value ="4">Cat1</option>
        </select>

        <select id="child-cat" name="child-cat" >
            <option value ="">- sub category -</option>
        </select>

app/code/Vendor/Module/Controller/Category/Childcategory.php

  use Magento\Catalog\Api\CategoryRepositoryInterface;
  use Magento\Catalog\Model\Category;
  use Magento\Framework\App\Action\Action;
  use Magento\Framework\App\Action\Context;
  use Magento\Framework\Controller\Result\JsonFactory;

  class Childcategory extends Action
  {
    protected $categoryRepository;
    protected $resultJsonFactory;

  public function __construct(Context $context, CategoryRepositoryInterface
   $categoryRepository, JsonFactory $jsonFactory)
  {
    $this->categoryRepository = $categoryRepository;
    $this->resultJsonFactory = $jsonFactory;
    parent::__construct($context);
  }

public function execute()
{
    // get parent category
    $parentId = $this->getRequest()->getParam('category_id');
    /** @var Category $category */
    $category = $this->categoryRepository->get($parentId);
    $childrenData = [];
    foreach ($category->getChildrenCategories() as $childrenCategory) {
        $childrenData[] = [
            'name' => $childrenCategory->getName(),
            'id' => $childrenCategory->getId()
        ];
    }
    return $this->resultJsonFactory->create()->setData($childrenData);
  }
 }

When the main category drop down changes my ajax call is hitting and i am getting the result. I need to append the result to the sub category drop down.

How this can be done using magento 2 standards? can anyone help me on this please? Thanks in advance


texts: Patch - What is the difference between Composer & GitHub

texts:
I want to update the patch : PayPal Express Checkout issue with region patch for Magento 2.3.4
My Magento installation by using Github Installation
Which format choose update patch (composer) or (Github) from https://magento.com/tech-resources/download#tab-36


texts: Unable To Override " getJsonSwatchConfig() " Method in Magento 2

texts:
I am working on magento 2 and want to override getJsonSwatchConfig method of Magento\Swatches\Block\Product\Renderer\Configurable class to meet the requirement but facing an issue. I have overrided this method and this is working fine on product detail page but it does not work for  list page. I have debug with core file in both cases it loads same method. ie.  getJsonSwatchConfig but it does not override for list page. Codes are given below

Namespace/modulename/etc/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\Swatches\Block\Product\Renderer\Configurable" type="Namespace\modulename\Block\Magento\Swatches\Product\Renderer\Configurable" />
</config>

Namespace\modulename\Block\Magento\Swatches\Product\Renderer\Configurable.php

<?php

namespace Namespace\modulename\Block\Magento\Swatches\Product\Renderer;

class Configurable extends \Magento\Swatches\Block\Product\Renderer\Configurable
{
    /**
     * Get Swatch config data
     *
     * @return string
     */
    public function getJsonSwatchConfig()
    {
        echo $this->getProduct()->getTypeId() ." overrided = ".$this->getProduct()->getId(); exit;
        $attributesData = $this->getSwatchAttributesData();
        $allOptionIds = $this->getConfigurableOptionsIds($attributesData);
        $swatchesData = $this->swatchHelper->getSwatchesByOptionsId($allOptionIds);

        $config = [];
        foreach ($attributesData as $attributeId => $attributeDataArray) {
            if (isset($attributeDataArray['options'])) {
                $config[$attributeId] = $this->addSwatchDataForAttribute(
                    $attributeDataArray['options'],
                    $swatchesData,
                    $attributeDataArray
                );
            }
        }

        return $this->jsonEncoder->encode($config);
    }
}

Any help will be appreciated


texts: How to move magento shop to another server

texts:
I was having my site in shared hosting, I took the entire backup, its structure is like

addons          homedir        mysql             resellerpackages  suspendinfo
bandwidth       homedir_paths  mysql.sql         sds               userconfig
counters        httpfiles      mysql-timestamps  sds2              userdata
cp              locale         nobodyfiles       shadow            va
cron            logaholic      pds               shell             vad
digestshadow    logs           proftpdpasswd     ssl               version
dnszones        meta           psql              sslcerts          vf
domainkeys      mm             quota             ssldomain
fp              mma            resellerconfig    sslkeys
has_sslstorage  mms            resellerfeatures  suspended

Now I have subscribed to vps, I have copied the files inside homedir/public_html to var/www/html of my new hosting, but am seeing the following error when I view it browser,

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 259343920016

I have just created database with name magenhto inside mysql. Previously I had cpanel and used one click installer. Hence am not aware of  how to use that data inside mysql to this new system and are there any more changes.


texts:
I am learning how to navigate through Magento; there is definitely a learning curve and I've not be exposed to this much abstraction before.  Overall, it's been tough but a good experience.

My question is how to get the tax RATE on an invoice or order.  I do not want to get the tax amount, but rather the rate.

I'm thinking this is associated with the shipping address.  My company's orders have only one shipping address and all items are associated to the one shipping address.  How would I get this?


texts: Magento 2 Grid value not changing on update for an attribute

texts: After changing value of a custom attribute in products , the change is not reflecting in the Grid but the change is getting reflected on the product edit page.


texts:
My permissions in Magento2.1 seem to be really messed up and I cant find an easy way to set them correct..

Currently the "www-data" user is owner of the "magento2 root folder".
I have a second user "n1njawtf" which I need to connect to the ftp and change css files and such. Currently I always need to change owner of "magento2 root folder" to "n1njawtf", before I can edit the css files and such.
After that I need to change owner back to "www-data" so its possible to view the store in browser...

Can anyone help me fix these permissions?


texts: Why doesn't the category appear in the filter options in the sidebar ? Magento2

texts: Why doesn't the category appear in the filter options in the sidebar, do I need to filter with categories too, or should it be added manually ?


texts: Undefined class constant ‘PRE_COMMAND_RUN' while upgrade to Magento 2.3.5 from Magento 2.3.4

texts:
I'm trying to upgrade my Magento installation to the version 2.3.5 using composer but I get the following error:

  Uncaught Error: Undefined class constant 'PRE_COMMAND_RUN'

My composer.json is as follows

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "config": {
        "preferred-install": "dist",
        "sort-packages": true
    },
    "require": {
        "bitexpert/magento2-force-customer-login": "^3.2",
        "magento/product-community-edition": "2.3.5",
        "mageplaza/magento-2-portuguese-language-pack": "dev-master",
        "mageplaza/module-smtp": "^1.2",
        "olegkoval/magento2-regenerate-url-rewrites": "^1.4"
    },
    "require-dev": {
        "friendsofphp/php-cs-fixer": "~2.13.0",
        "lusitanian/oauth": "~0.8.10",
        "magento/magento2-functional-testing-framework": "~2.3.13",
        "pdepend/pdepend": "2.5.2",
        "phpmd/phpmd": "@stable",
        "phpunit/phpunit": "~6.5.0",
        "sebastian/phpcpd": "~3.0.0",
        "squizlabs/php_codesniffer": "3.3.1",
        "allure-framework/allure-phpunit": "~1.2.0"
    },
    "conflict": {
        "gene/bluefoot": "*"
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": [
                "app/code/",
                "generated/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "version": "2.3.1",
    "minimum-stability": "stable",
    "repositories": [
        {
            "type": "composer",
            "url": "https://repo.magento.com/"
        }
    ],
    "extra": {
        "magento-force": "override"
    }
}

Can anyone save me please ?

thanks for your time !


texts: Magento 2.3.2 - How to export products all gallery Images

texts: I need products all gallery images . How to export products all gallery images?


texts: Is it possible to hide custom attribute from product editor and assign a default value?

texts:
Goal

Create a custom boolean attribute called "is_type" & default the value to "1"
Assign custom attribute to a single attribute set
Products assigned to this attribute set automatically have "is_type" set to 1 when the product is saved

Code

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'is_type',
        [
            'group' => 'General',
            'type' => 'int',
            'backend' => '',
            'frontend' => '',
            'label' => 'Is Type',
            'input' => 'boolean',
            'class' => '',
            'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => 0,
            'required' => 1,
            'user_defined' => 0,
            'default' => '1',
            'searchable' => 1,
            'filterable' => 0,
            'comparable' => 0,
            'visible_on_front' => 0,
            'used_in_product_listing' => 1,
            'is_used_in_grid' => 1,
            'unique' => false,
            'apply_to' => 'simple',
            'attribute_set' => 'CustomAttributeSet'
        ]
    );

I can see that the attribute is created, however, creating a new product and assigning the new product to "CustomAttributeSet" does not appear to assign the attribute to the product.

Edit:

Testing the product using the steps below, I see that the value is actually correct and assigned.

magerun dev:console

$di->get('Magento\Framework\App\State')->setAreaCode('frontend')
$di->create('Magento\Catalog\Model\Product')->load(2051)->getData('is_type')

I was expecting magento index:reindex && magento cache:clean to update the Visual Merchandiser products for the category that I associated with this attributed. However, for whatever reason, I had to save the category in order to refresh Visual Merchandiser Products.


texts:
The setting System > Configuration > Web > Session Cookie Management> Cookie Restriction Mode

comes with the following warning on Enterprise:

  Note that to fully restrict cookies, full page caching must be
  disabled as well.

Questions:

Turning FPC off is quite a penalty for this feature - were they just too lazy to implement placeholders or are there any other valid reasons for this?
I have found notices.phtml and ga.phtml that rely on the cookie acceptance - any others?


texts: Magento 2 How to resize product image for email purpose

texts:
I wrote following code that gets product image displayed on all transactional emails

$productId = $_item->getProductId();

$objectManagerHere = \Magento\Framework\App\ObjectManager::getInstance();

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

$store = $objectManagerHere- >get('Magento\Store\Model\StoreManagerInterface')->getStore();

$imageUrl = $store- >getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();

//  displays image
<img height="100" width="100" src="<?= $imageUrl; ?>" alt="<?= __('Product Image');?>">

Problem is that these images are too large (kb) for email. Is there any way to resize them using the snippets above?


texts: Error stream_wrapper_unregister() when installing magento

texts:
I wanted to try magento CE edition so I downloaded it uploaded all the files to my host but then I get this error when i visit the url.

  Warning: stream_wrapper_unregister(): Unable to unregister protocol
  phar:// in
  /customers/d/f/0/(my_website_url)l/httpd.www/magento/app/bootstrap.php
  on line 11

What am I doing wrong?


texts: How to remove products linked to another store view?

texts:
In Magento\CatalogImportExport\Model\Export\Product::collectRawData() :

There is the following lines starting at line 904:

$collection = $this->_getEntityCollection();
        foreach ($this->_storeIdToCode as $storeId => $storeCode) {
            $collection->setStoreId($storeId);

I would like to remove the products that are part of a specific store Code as it is causing duplicates during the export.

Is there perhaps a way to get the SQL query that puts the collection for a specific store view together?

Update:

I tried to find catalog_product_entity_* with store_id != 0 but there were none.

I have found that from Magento\CatalogImportExport\Model\Export\Product::collectRawData() the data returned is an associative array.

Consisting of a product for each storeview.
Funny thing is that where there are just 4 attributes per storeview, it is emptied out by this method $this->appendMultirowData($dataRow, $multirawData); but there is a case where more than 4 attributes come back for the storeview and that creates the duplicate on the excel spreadsheet.

Example of array with 4 elements

array(4)
sku:"DLN-22083"
store_id:1
product_id:3485
product_link_id:"3485"

Example of an array with 10 elements

array(10)
description:"
My Desc
"
technical_specifications:"

Red

"
_store:"shs_en"
_attribute_set:"Dies"
_type:"simple"
sku:"DLN-14426"
store_id:1
product_id:3484
product_link_id:"3484"

So if I can stop there extra attributes from being added then the product won't be added to the spreadsheet


texts: How to holepunch a block inside a $productCollection loop?

texts:
I'm trying to create a block inside the category/list page, that is not cached by FPC. Specifically, I have an addtocart block that requires some logic depending on user configuration, this configuration can be changed from the topnav and it will cause a page refresh when changed. So it a customer is looking at the category/list page, and they have option A selected, something should render. If they have option B, another thing should render.

Here is what I have so far:

cache.xml

    <config>
        <placeholders>
            <custommodule_catalog_product_list_addtocart>
                <block>custommodule/catalog_product_list_addtocart</block>
                <name>custommodule.addtocart</name>
                <template>custommodule/catalog/product/list/addtocart.phtml</template>
                <placeholder>CUSTOMMODULE_CATALOG_PRODUCT_LIST_ADDTOCART</placeholder>
                <container>CustomModule_Model_Caching_Container_List_Addtocart</container>
                <cache_lifetime>1</cache_lifetime>
            </custommodule_catalog_product_list_addtocart>
        </placeholders>
    </config>

container

class CustomModule_Model_Caching_Container_List_Addtocart extends Enterprise_PageCache_Model_Container_Abstract
{

    protected function _getCacheId()
    {
        return 'CUSTOMMODULE_CATALOG_PRODUCT_List_ADDTOCART' . $this->_getIdentifier();
    }

    protected function _getIdentifier()
    {
        return microtime();
    }

    protected function _renderBlock()
    {
        $blockClass = $this->_placeholder->getAttribute('block');
        $template = $this->_placeholder->getAttribute('template');
        $block = new $blockClass;
        $block->setTemplate($template);
        $layout = Mage::app()->getLayout();
        $block->setLayout($layout);

        return $block->toHtml();

    }

    protected function _saveCache($data, $id, $tags = array(), $lifetime = null)
    {
        return false;
    }
}

block

class CustomModule_Block_Catalog_Product_List_Addtocart extends Mage_Core_Block_Template
{
}

layout.xml

    <catalog_category_default>
        <reference name="product_list">
            <block type="custommodule/catalog_product_list_addtocart"
                   name="custommodule.addtocart"
                   template="custommodule/catalog/product/list/addtocart.phtml">
            </block>
        </reference>
    </catalog_category_default>

catalog/product/list.phtml

<?php $i=0; foreach ($_productCollection as $_product): ?>
...
    <?php echo $this->getChildHtml('custommodule.addtocart'); ?>
...
<?php endforeach ?>

This "formula" works for me just fine in other places, like the PDP. However, I can't figure out a way to give my block the $_product we are iterating.
It works fine on first load (after clearing cache).

Any help on how to pass data to that block inside the loop?

Thanks!


texts: How to add search filter drop down in admin block form in magento 2?

texts:
Here is my admin field code
$fieldset->addField(
            'topic_id',
            'select',
            array(
                'name' => 'topic_id',
                'label' => __('Select Topic '),
                'title' => __('topic '),
                'values'=> $topic_data,
                /*'required' => true,*/
            )
        );

How can i make this field as search values from $topic_data array
like see below screen shoot the drop down have so meany values so i
will search specific value and select it


texts: What does Magento 1's end of life mean for security?

texts: With Magento 1 nearing it's end of life in June 2020, what are the biggest threats when it comes to security?


texts: Magento create order programmatically with paypal payment method

texts:
Currently we have two magento independent websites. One is behaving as storefront and other as back end. User can place the order at front end.

So same order I am trying to create programmatically at back end. When user pay through checkmo payment method it works. But when user pays through PayPal it is not working. So anybody knows how we can create order programmatically using PayPal payment methods? Is it possible or not?

$quote->getPayment()->importData(array(3) {
    [method] => paypal_express
    [last_trans_id] => 65Y31421KL2753028
    [additional_information] => Array
    (
        [paypal_express_checkout_shipping_method] =>
        [paypal_payer_id] => 5LX84SUFY39L4
        [paypal_payer_email] => abbas-buyer-2@bluewisesoft.com
        [paypal_payer_status] => verified
        [paypal_address_status] => Confirmed
        [paypal_correlation_id] => b78b4e5e6e527
        [paypal_express_checkout_payer_id] => 5LX84SUFY39L4
        [paypal_express_checkout_token] => EC-7P402752023166448
        [paypal_express_checkout_redirect_required] =>
        [paypal_protection_eligibility] => Eligible
        [paypal_payment_status] => pending
        [paypal_pending_reason] => authorization
    )
});

  Error: PayPal gateway has rejected request. A successful transaction
  has already been completed for this token (#10415: Transaction refused
  because of an invalid argument. See additional error messages for
  details).


texts: get qty ordered when there is promotion rules

texts:
I've got promotion rule which says when you buy3 time a product you get one of them free.

This is perfectly working in Magento but to communicate with a software I have to generate a XML file with orders details and the beginning of my headache...

Indeed my code is like this :

$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$produits = $order->getAllItems();
foreach ($produits as $produit)
{
    $prix = $produit->getPrice();
    $imei = $produit->getSku();
    $quantite = $produit->getQtyOrdered();
    $product_attribut = Mage::getModel('catalog/product')->load($produit->getId());
    $xml_product = $xml_products->appendChild($xml->createElement("item"));
    $xml_product->appendChild($xml->createElement("num_commande", $id_commande));
    $xml_product->appendChild($xml->createElement("products_model", $imei));
    $xml_product->appendChild($xml->createElement("price_final_unitaire", $prix));
    $xml_product->appendChild($xml->createElement("products_quantity", $quantite));
}

When I buy the product with the promotion rule (3 bought 1 free) Here is what I get :

    <item><num_commande>WR100000024</num_commande>
<products_model>XPERIAZW</products_model>
<price_final_unitaire>395.0000</price_final_unitaire>
<products_quantity>3.0000</products_quantity></item><item>
<num_commande>WR100000024</num_commande>
<products_model>XPERIAZW</products_model>
<price_final_unitaire>0.0000</price_final_unitaire>
<products_quantity>3.0000</products_quantity></item>

As you can see I've 2 lines for the same product One is at 0 and the other on the right price (395). However the quantity is the same for the 2 lines. That's mean 6 products : 3 at 395 and 3 at 0 instead of 2 at 395 and 1 at 0.

Hope it's clear! Thanks for your help!


texts: Limiting "Add to cart" to just 1 click / item

texts:
I've noticed that some visitors will click the "Add to cart" button multiple times. This results in the product being added multiple times.
I thought it was my theme, but I've reproduced this on the default Magento theme. Every click until the cart page is recorded, not very good when you have a small window to convince a visitor to buy from you.

How can I limit the "Add to Cart" button to just 1 item on multiple clicks?
EDIT: NEED A TECHNICAL ANSWER / SOLUTION


texts: How do I find out where a specific route goes?

texts:
In once place, I have a /Vendor/Module/etc/routes.xml, showing:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="categories" frontName="categories">
            <module name="Vendor_Module" />
        </route>
    </router>
</config>

which points to a valid (as far as I can see) controller. (Index/Index, to be precisely. )

In the database, table mg_url_rewrite, "categories" is pointed towards catalog/product/view/id/.

How can I figure out where a request for www.mysite.com/categories actually goes?

My instinct says the routes.xml file, but an exact duplicate of that controller in another module shows an empty page, where .../categories actually shows the categories of the webshop. All the controller does is:

public function __construct(Context $context, PageFactory $resultPageFactory)
    {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->prepend(__('Categories'));
        return $resultPage;
    }

But the page doesn't even have a title, which the other (controller exact duplicate except from namespaces, and same for the routes.xml except ofcourse for the Vendor_Module, route id and frontname) module does.

However, if I manually enter the url provided by the mg_url_rewrite table, I get a 404.


texts: How can I require a specific number of checked selectable options?

texts:
I have a sample pack product that needs to require 5 different flavors chosen by the customer.

var maxCheckedCount = <?php echo $maxCheckedCount = $this->getProduct()->getMaxCheckedCount(); ?>+1;
var maxCheckedAlertMessage = "<?php echo $this->__('You have reached maximum allowed selections.'); ?>";

jQuery('input[type=checkbox]').click(function(){
    var n = jQuery('input:checked').length;
    if(n>=maxCheckedCount){
        jQuery(this).prop('checked',false);
        alert(maxCheckedAlertMessage);
    }
});

I added the above code to product/view.html to check get the maximum selectable options, and prevent any more. I am wondering how I  can check that the minimum selectable options are selected before allowing the item to be added to cart.

I have created a min_checked_count attribute along with the max_checked_count attribute from above, now I just need to know where to check against it.


texts:
I already installed Redis on a Centos server. I have updated the file etc/redis.conf with the following config:

unixsocket /var/run/redis/redis.sock

unixsocketperm 777

$ redis-cli ping returns "PONG" so basically Redis is working. But I still can't connect from my Magento application. Here is my config on app/etc/local.xml

<config>
<global>
    <install><date>...</date></install>
    <crypt><key>...</key></crypt>
    <cache>
        <backend>Cm_Cache_Backend_Redis</backend>
        <backend_options>
            <server>/var/run/redis/redis.sock</server>
            <port>0</port>
            <database>0</database>
            <password></password>
            <force_standalone>0</force_standalone>
            <connect_retries>1</connect_retries>
            <read_timeout>10</read_timeout>
            <automatic_cleaning_factor>0</automatic_cleaning_factor>
            <compress_data>1</compress_data>
            <compress_tags>1</compress_tags>
            <compress_threshold>20480</compress_threshold>
            <compression_lib>gzip</compression_lib>
            <persistent></persistent>
            <use_lua>0</use_lua>
        </backend_options>
    </cache>
    <disable_local_modules>false</disable_local_modules>
    <resources>...</resources>
    <session_save>db</session_save>
    <redis_session>
        <host>/var/run/redis/redis.sock</host>
        <port>0</port>
        <password></password>
        <timeout>2.5</timeout>
        <persistent></persistent>
        <db>0</db>
        <compression_threshold>2048</compression_threshold>
        <compression_lib>gzip</compression_lib>
        <log_level>1</log_level>
        <break_after_frontend>5</break_after_frontend>
        <fail_after>10</fail_after>
        <break_after_adminhtml>30</break_after_adminhtml>
        <first_lifetime>600</first_lifetime>
        <bot_first_lifetime>60</bot_first_lifetime>
        <bot_lifetime>7200</bot_lifetime>
        <disable_locking>0</disable_locking>
        <min_lifetime>60</min_lifetime>
        <max_lifetime>2592000</max_lifetime>
    </redis_session>
</global>
<admin>...</admin>

Any thoughts? Thank you.


texts: Getting category's custom attribute value

texts:
I have created a new tab in the category edit page that gives access to a custom category attribute that has a key of mymodule_myattribute. I did this using an install script:

$installer->addAttribute(
    'catalog_category',
    'mymodule_myattribute',
    array(
        'label' => 'My Attribute',
        'group' => 'My Attribute Tab',   //will be created if necessary
        'type'  => 'int',
        'class' => 'validate-number',
        'required' => false,
        'input_renderer' => 'mymodule/adminhtml_catalog_category_widget_mycoolwidget',
    )
);

The attribute appears in the new tab and the setting gets saved when Save Category is clicked. This is all good... however...I am trying to access that custom attribute value for each category in a stand alone script:

require_once('app/Mage.php');
Mage::app('default');

$categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*');

foreach ($categories as $category) {

    $cat = Mage::getModel("catalog/category")->load($category->getId());
    var_dump($cat->getData('mymodule_myattribute')); // NULL
    var_dump($cat->getMymoduleMyattribute()); // NULL

    var_dump($cat->getName()); // My Cool Category Name

}

The above calls for the custom attributes return NULL even though I know it is getting saved (because Magento saves it for me).

Is there something blindingly obvious I'm missing here?


texts: Add to cart - Loader spins until timeout, but product was added quickly

texts:
Magento Community 1.9.2.4

Systems were working until an extension from BSS Commerce (Defer Javascript) was installed and a couple of other internal small changes were made.
EDIT
The BSS Commerce replied stating that it is unlikely that after removing the extension, that the fault lies with their code as it doesn't update  or re-write any other code.

It may have been that this was the trigger for some underlying issue that was simply waiting to appear...?
EDIT

Am having trouble tracking down exactly which element is causing the fault.

Defer Javascript has now been disabled and then removed (via FTP - the exact same way it was installed) - all cache flushed, compiler now disabled for testing purposes.

Only other changes are;
Cookie path and cookie domain fields empty (previously were "/" for path and "domain.co.uk" for Cookie Domain
These were changed as we started getting the login redirect loop problem on the backend. Not sure if that is linked to the defer javascript problem.

SSL certificate was installed by the server host company - everything appeared to be functioning correctly after this though.

Zend full page cache now disabled during testing.

Site is effectively dead - as customers get bored of waiting and leave!

Adding a product to the cart shows the AJAX loader spinning endlessly, but if a user clicks in the background - they find that the product has been added to the cart. The cart hasn't updated on the page, but if a user clicks the cart - or changes pages the cart updates with the item in there.

Prior to the changes, everything was working fine.

Anyone able to give a couple of suggestions as to what the cause might be \ how to track it down \ similar issues & how they fixed it.

Thanks :)


texts: Magento 2.1: Custom Payment Gateway Method-Renderer JS File Is Ignored

texts:
I'm working on implementing a payment gateway using the sample code from Magento github on my Magento 2.1 site.

For some reason, Magento does not seems to use the new functions I added to ..payment/method-renderer/sample_method.js. Let's say I have a function called getAwesomeInfo() that will return "hello world" string, I got the error function is not defined when I tried to add it to ../template/payment/form.html

So far I have checked the following:

.../view/frontend/layout/checkout_index_index.html, and confirm that include the payment component file. If I try to change the path, the site will throw error 500.
However, when I tried to edit the component file .../payment/sample_gateway.js and .../payment/method-renderer/sample_gateway.js, it doesn't seem to do anything. It's as if Magento either ignore the file or look up the javascript code from any else.
The site is currently on development mode. I have tried to disable cache and rebuild the static content, but that didn't seem to have any effect.

I may have missed something here. Any advise would be appreciate.

Thank you very much.


texts:
Installed update for an extension (EmailDirect, after running patch 6788) successfully on local environment, but when uploaded to testing server it throws a "404 page not found".

I even reinstalled a local copy from GIT, so both local and testing servers have the same code. Flushed cache several times and nothing, keeps missing the page only on testing server.

I've tried https://stackoverflow.com/questions/18724995/magento-404-on-admin-page accepted answer. If the page is ok then it shows the stacktrace, but if it's 404 it doesn't.

So i basically don't know why it's throwing a "404 not found" or how to debug it.

Any ideas?

Thanks!


texts: Magento 2: Swagger not showing Admin endpoints

texts:
I'm trying to view my local's API endpoints via swagger:
http://magento2.docker/swagger

However, even though i already pasted the API KEY into the box, it's still not showing the admin endpoints that the user has permission to view.

I tried using that API KEY in Postman and it's working fine, so the user has correct permissions. I also inspected the headers of the requests made by swagger, it does include the key in Bearer for Authorization so something is preventing swagger from generating the correct list of endpoints.

I know there could be some custom modules that potentially broke this. Any advice on where to check would be greatly appreciated. Thanks.