texts: Newsletter Subscription messages core session

texts:
On Magento 1.9, in /app/code/core/Mage/Newsletter/controllers/SubscriberController.php there's newAction() function that returns success or error messages.

The success message for example uses Mage::getSingleton('core/session'); which is an admin message and on the front end it doesn't get any styling.

I would think it should be using Mage::getSingleton('customer/session'); so that customers see the regular success or error messages.

Why was this assigned to core/session?

public function newAction()
{
    if ($this->getRequest()->isPost() && $this->getRequest()->getPost('email')) {
        $session            = Mage::getSingleton('core/session');
        $customerSession    = Mage::getSingleton('customer/session');
        $email              = (string) $this->getRequest()->getPost('email');

        try {
            if (!Zend_Validate::is($email, 'EmailAddress')) {
                Mage::throwException($this->__('Please enter a valid email address.'));
            }

            if (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_ALLOW_GUEST_SUBSCRIBE_FLAG) != 1 &&
                !$customerSession->isLoggedIn()) {
                Mage::throwException($this->__('Sorry, but administrator denied subscription for guests. Please register.', Mage::helper('customer')->getRegisterUrl()));
            }

            $ownerId = Mage::getModel('customer/customer')
                    ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
                    ->loadByEmail($email)
                    ->getId();
            if ($ownerId !== null && $ownerId != $customerSession->getId()) {
                Mage::throwException($this->__('This email address is already assigned to another user.'));
            }

            $status = Mage::getModel('newsletter/subscriber')->subscribe($email);
            if ($status == Mage_Newsletter_Model_Subscriber::STATUS_NOT_ACTIVE) {
                $session->addSuccess($this->__('Confirmation request has been sent.'));
            }
            else {
                $session->addSuccess($this->__('Thank you for your subscription.'));
            }
        }
        catch (Mage_Core_Exception $e) {
            $session->addException($e, $this->__('There was a problem with the subscription: %s', $e->getMessage()));
        }
        catch (Exception $e) {
            $session->addException($e, $this->__('There was a problem with the subscription.'));
        }
    }
    $this->_redirectReferer();
}


texts:
I try to translate my product names in the new English store view and import changes, but when I import the csv, it override the default data.

sku,_store,name
31006,default,Небе
31006,en,Sky

After the import I can see in the Admin Panel that the "Use Default Value" checkbox is allays checked in the English store view.

I have also tried to specify the sku only 1 time and insert my modification right after it in a new row. This method is described here.

sku,_store,name
31006,default,Небе
     ,en,Sky

The problem here is that there is an error - Skipping import row, required field "sku" is not defined.

I really can't understand my fault, please help!


texts:
I want to see search results in list mode by default in desktop, and see it on grid mode on mobile.
What should I do?
Right now I edited catalog search list.phtml to show list mode by default on search result page but on mobile, I see list mode too. I want to see grid mode on mobile.

Update from comment:

if ($block->getMode() == 'grid') {
    $viewMode = 'list';
    $image = 'category_page_list';
    $showDescription = false;
    $templateType =
    \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
} else {
    $viewMode = 'grid';
    $image = 'category_page_grid';
    $showDescription = true;
    $templateType =
    \Magento\Catalog\Block\Product\ReviewRendererInterface::FULL_VIEW;
}

but it works on any device, can not seperate them for devices


texts: Display a message if cash on delivery is not available on Checkout page

texts:
I just want to show the message on the checkout page, when COD is not applicable.
for Eg: if we are adding the minimum order total 500 for COD.

Then any user tries to purchase below 500 then they able to see a message on checkout page. Like: COD not available to on cart value below 500.

Please help me to create this.


texts: Why is the shipping form is display in register page - Magento 2

texts: Where is config enable or disable the shipping address form in the Register page ?? Thanks!


texts: Magento 2: Custom theme no products on listing page

texts:
I have created magento 2 custom theme and set that theme as current theme from admin. On frontend no products are found on listing page, search page and home page. I already have sample data.

Please let me know if I am missing anything.


texts:
How to get product id from product which already added to cart in mini cart ?

I've opened this file :

app/design/frontend/<theme_name>/default/template/checkout/cart/minicart/default.phtml

but I still not have idea to get product id.


texts: Count the occurrence of duplicate and print the count in separate column in Custom grid

texts:
In my table , I have column named product_id , in that duplicate entries are allowed. Now in my custom grid , I have to avoid that duplicate and display how many times, the duplicate are occurred in custom grid , in that screen-shoot below I have product_id , in that I need to avoid duplicate and count the
occurrence of duplicate and print in a custom grid as a separate column. Can any one please help me.


texts: Table rates not working in backend Magento 2.2.6

texts:
When editing an existing order or create a new one in the backend of Magento I'm getting the following notification when trying to select a shipping method:

Sorry, no quotes are available for this order.

All fields have been filled correctly. The only shipping method that is activated on this Magento installation is the table rates method. If I enable the flat method it will not give the above notification and shows only the flat shipping option. Since there are multiple shipping prices used in this Magento installation I cannot use the latter.

The strange part about it is that the frontend works absolutely fine with the table rates method and orders are being placed daily.

Since I cannot see any strange things in the MySQL table and Magento is not outputting any errors in the logs or any javascript errors in the browser I'm kinda lost in finding the solution to this problem.

Any help is greatly appreciated and if more information is needed I'm glad to share it.


texts: inventory_source_item and cataloginventory_stock_item data is not same? which table to used for stock now. Please explain. Thanks so much


texts: Create group price based on markup from cost

texts:
I want to set a group price by adding a percentage to the cost of a product(s) in my store.

Is there a way to do this without adding an extension?

How can I achieve this programmatically?

SR_Magento EDIT:

The answer to this questions appears to lie in the table catalog_product_entity_group_price

By manually creating a group price for a product, I was able to create additional group prices based on the original example:

It stands to reason that it is possible to do this programmatically by creating a markup cost + x% and then populate the field "value". The entity_id is the products Magento ID, the customer_group_id is the ID of the Group you wish to give special pricing.

Bounty expires in 2 days, if I don't get at least an SQL statement I can work with I will let it expire.


texts: Is it possible to create a plugin for an existing plugin class in Magento 2.3.5-p2 and if so, are there any special ways of doing this besides the normal plugin creation?


texts: How to save the custom field data in payment section magento 2 to payment related table?

texts:
I am trying to save the payment related custom data in additional_information column through my custom module.can any one help me on this.
Observer class

namespace Vendor\Module\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Quote\Api\Data\PaymentInterface;

class PaymentAssignData implements ObserverInterface {

    protected $_request;

    /**
     * @var ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectManager, \Psr\Log\LoggerInterface $logger, \Magento\Quote\Model\QuoteFactory $quoteFactory, \Magento\Framework\App\RequestInterface $request
    ) {
        //die(__METHOD__);
        $this->_objectManager = $objectManager;
        $this->logger = $logger;
        $this->quoteFactory = $quoteFactory;
        $this->_request = $request;
    }

    /**
     * customer register event handler
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer) {
        $order = $observer->getEvent()->getOrder();
        $addInfo = $order->getPayment()->getData();
        var_dump(json_encode($addInfo));
        exit;
        $quoteRepository = $this->_objectManager->create('Magento\Quote\Model\QuoteRepository');
        /** @var \Magento\Quote\Model\Quote $quote */
        var_dump(json_encode($observer));
        exit;
        $quote = $quoteRepository->get($order->getQuoteId());
        $order->setDeliveryDate($quote->getDeliveryDate());

        $order = $observer->getEvent()->getOrder();
        //$quote = $order->getQuote();
        $quoteId = $order->getQuoteId();
        $payment = $order->getPayment()->getData('additional_data');
        $quote = $this->quoteFactory->create()->load($quoteId);
        // $postData = $this->_request->getParam();;
        var_dump($payment);
        exit;
        // var_dump($quoteId);exit;

}
}

additional field in payment section.that fields are for all payment method.
js file

  define(
        [
            'ko',
            'jquery',
            'uiComponent'
        ],
        function (ko, $, Component) {
            'use strict';
            return Component.extend({
                defaults: {
                    template: 'Vendor_Module/checkout/formdata-form',
                    taxCode: '',
                    taxState: ''
                },
                initialize: function () {
                    this._super()
                            .observe(
                                    [   'taxCode',
                                        'taxState'
                                    ]
                                    );
                    return this;
                },
                getData: function () {
                    return {
                        "additional_data": {
                            'tax_code': this.taxCode(),
                            'tax_state': this.taxState()
                        }
                    };
                }
            });
        }
);


texts: Magento 2.3.0 Reset password page showing blank

texts:
For some reason in our 2.3.0 installation the admin's reset password page does not show the form.

There is nothing appearing in the Magento error logs or reports. Also server logs are not showing anything.

I re-deployed static files by force (I'm in developer mode) and cleared the caches.

Everything else seems to work.

Any ideas what could cause this?


texts: aligning magento top links left and right

texts:
I have added additional static links in magento top link beside checkout login etc.
Default welcome, my account etc links are left aligned, and i want my additional links to be right aligned.

I am wondering how can i just control additional links i mean set of additional links to align right?
 For controlling with css we need some container element for only additionl links, but adding it with xml only create more li tags and append it in same ul.

here is my code

<default>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Custom Link 1</label>
<url>http://www.example.com/</url>
<title>Custom Link 1</title>
<prepare/>
<urlParams/>
<position>101</position>
       <liParams >
       <class>custom_link</class>
       </liParams>
<aParams><![CDATA[target="_blank"]]></aParams>
</action>
</reference>

I am wondering how can sorround these links with a div or any container element to which i can apply my css. i Can add class to individual item, but how to add class to the bunch 5 additional links only without touching the postioning of default links
can someone help?

Below is the Snapshot how i want to achieve.


texts:
If customer purchase more than and equal to 50. They can get specify SKU with qty 10 for free?

is it possible? I can define the condition. But for the Action, where I can insert the SKU and qty as for free gift?


texts: Magento 2: How to get file size in folder to check size?

texts:
i try get_headers function of php but how can get size by path file in magento 2?

$url = 'http://www.example.com';

print_r(get_headers($url));


texts: How to get Login customer entity_id in the template in Magento 2?

texts:
How to get Login customer entity_id in the template in Magento 2
 print on list.phtml


texts: Magento-2 How to convert price from current currency to base currency

texts:
I want to convert product price from the current currency to base currency.

For Example, if the product price is 5000 INR. I want to convert 5000 INR to USD.

I don't know which core function will be best used for. Can anyone give me examples? Any function which is used for convert price to current to base and base to current?

Purpose: I am adding a product to cart programmatically, if a current currency is USD then it's working properly but if I switch currency as INR, added product price convert INR amount to USD. So I want to convert INR amount to USD.


texts: Magento 2 - Get product qty and special price from product collection

texts:
I am able to get a product collection by using the ProductRepositoryInterface:
\Magento\Catalog\Api\ProductRepositoryInterface

Then loop through products by doing:
$list = $this->_productRepository->getList($searchCriteria);
$items = $list->getItems();
foreach ($items as $item) {

}

I need to get 'qty' and 'special price' from each $item (product). But $item does not provide these methods:

As you can see $item is a ProductInterface. And in 'vendor\magento\module-catalog\etc\di.xml' there is this line:
<preference for="Magento\Catalog\Api\Data\ProductInterface" type="Magento\Catalog\Model\Product" />

So when I call $item->getQty; or $item->getSpecialPrice();  I should get the corresponding values, because both methods are implemented in Magento\Catalog\Model\Product. But this does not work.
In my Block Class I do:
 $this->setItems($items);

In my phtml file I do:
$items = $this->getItems();
if(!empty($items)){
    foreach ($items as $item) {
        echo "<p> id: ".$item->getId().", name: "
        .$item->getName().", sku: "
        .$item->getSku().", price: ".$item->getPrice()
        .", typeId: ".$item->getTypeId()
        .", visibility: ".$item->getVisibility()
        .", status: ".$item->getStatus()
        .", QTY : ".$item->getQty()
        .", special price: ".$item->getSpecialPrice();
    }
}

Everything works, I get all values except for 'getQty()' and 'getSpecialPrice()'.
I absolutely need 'qty' and 'special price' from each product in the collection.
Can someone help ?
EDIT:
@Manthan Dave : I did the following, but got an error because getExtensionAttributes()->getStockItem() returns NULL:

Info: the cache was cleared/flushed multiple times.


texts: Magento2.3: How to move sku above product title?

texts: I want to move the sku above the product title. But the problem I'm facing is that I can see two of the sku's in the product page(one is under product title and another is parallel to price). Please anyone tell me how to move the sku at above product title.


texts: Magento observer is not viewing product details

texts:
I have created custom checkout_cart_save_before observer in magento by create the following files

app/etc/modules/Cart_Override.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Cart_Override>
            <codePool>local</codePool>
            <active>true</active>
            <depends>
                <Mage_Contacts />
            </depends>
        </Cart_Override>
    </modules>
</config>

app/code/local/Cart/Override/etc/config.xml

<?xml version="1.0"?>
<config>
    <global>
        <models>
            <cartoverride>
                <class>Cart_Override_Model</class>
            </cartoverride>
        </models>
        <events>
            <checkout_cart_save_before>
                <observers>
                    <cart_override_qty_observer>
                        <type>singleton</type>
                        <class>Cart_Override_Model_Qtyc_Observer</class>
                        <method>checkout_cart_save_before</method>
                    </cart_override_qty_observer>
                </observers>
            </checkout_cart_save_before>
        </events>
    </global>
</config>

and app/code/local/Cart/Override/Model/Qtyc/Observer.php

class Cart_Override_Model_Qtyc_Observer extends Varien_Event_Observer
{

    public function checkout_cart_save_before($observer)
    {
        $action  = Mage::app()->getFrontController()->getAction();
        $product = $observer->getProduct();
        echo "<pre>";
        print_r($product);
        echo "</pre>";
        die();
    }

}

The observer is working fine, when i click the add to cart button it is going to checkout_cart_save_before function. But i could not get the product values from the observer using the following code inside the checkout_cart_save_before function

$product = $observer->getProduct();

I have to add something for get the product details from the observer parameter?....any guess??


texts: Magento 2.1.1 - How to add color picker in admin configuration options?

texts: How to add color picker in magento 2.1.1 admin system config custom module general settings


texts: Why I see X-Magento-Cache-Debug in production mode?

texts:
I have Varnish configured in my server and my project is running in production mode, even though, I continue seeing the debug tag X-Magento-Cache-Debug in the header.

According to Devdocs - Varnish Final verification this header tag just show up in developer mode.

Why does it happen and how could I solve it?
Thanks


texts: Magento2.3: How to hide static block-widget from specific page?

texts:
I have created one widget by creating a static block.
My widget options are set to show on All pages. It's working fine.
Now I need to hide that static block from the Checkout page, Cart page and contact us page only. For all remaining pages, The same as earlier.
My static block's identifier is 1800_popup

How can I do this?


texts: How to add plain functions (not class's method) in Magento 2 Module?

texts: I want to add plain functions that I can use instead of static methods from classes. What is the best way to add this?


texts:
How I can find action from URl, if I have just  http://mysite.loc/onestepcheckout/
I now, how find it, if I have a something like that:

agentdeposit/adminhtml_order/finalize/order_id/
    |            |              |
    | Module     |              |
                 | Controller   |
                                | Action


texts: How to get Category Id of current product?

texts:
I have get the current product category id on product details page. I have used some method like :

$_product = Mage::getModel('catalog/product')->load(prodId);
$ids = $_product->getCategoryId();
$cat = Mage::getModel('catalog/product')->setId($ids);

but its not work as i want.

$products = Mage::getResourceModel('reports/product_collection')
        ->addAttributeToSelect('*')
        ->setStoreId($storeId)
        ->addStoreFilter($storeId)
        ->addViewsCount()
        ->addCategoryFilter($cat)
        ->setPageSize($productCount);

but its return some times this error

 Fatal error: Call to a member function getId() on a non-object in /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php on line 719


texts: How to add translations for new words in Magento?

texts:
I'm using English, Spanish and German as three store views for my site. What is the easiest way to add translations for new words?

Even if I add new words with the translations it doesn't show in the frontend.


texts: Magento 2.2.5 Product attribute "use in search" RESETTING after index:reindex

texts:
UPDATE:: Today i discover that happen when the cron run index:reindex

How can I fix?

Today during configuring  manufacturer attributes I found a bug or however an anomaly on Magento 2.2.5
I, setting "use in search" on "Yes" in the product attribute, but after a search on the frontend (the website return true result only the first search, after not found nothing)
The product attribute get on "No" completely alone.


texts: Create product tab that displays custom attribute - Ultimo Theme

texts:
On the product page, I would like to create a new tab next to the description tab named 'What's Included'.

I have created a attribute with text area named included to display what items that come with a product.

Here is the section of code in the local.xml file of the theme for the tabs:

<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >

            <!-- Product description -->
            <action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>

If I duplicate the Product Description tab code above it will add another description tab but I do not know how to change it to be the included tab.

Also, I understand that I need to create .phtml file such as included.phtml but do not know what to put in that file to display the included attribute info.


texts: admin gird using block, not using UiComponent

texts: How to create amdin gird using block, but not using UI and not Teampalates.


texts: Magento2 staging getting error in my custom module

texts:
I am facing this error in our staging environment  Exception: Warning: array_key_exists() expects parameter 2 to be array, null given

here added my code

$hash = array();
$hash['0'] = 'test';
$array_out = array();
foreach($data as $i_tem) {
    $hash_key = $i_tem[2];

 if(!array_key_exists($hash_key, $hash)) {
        $hash[$hash_key] = sizeof($array_out);
        array_push($array_out, array(
            'id' => $i_tem[2],
            'title' => $i_tem[4],
            'count' => 0,
        ));
    }
 $array_out[$hash[$hash_key]]['count'] += 1;
}


texts:
We are running a magento site 1.8.1.0. For the last couple months, we keep getting customers' complaint about their unauthorized charges on their credit cards. We have applied all the security patches (including the newest supee-6788), magereport.com all pass. And also passed PCI compliance scan. Magmi removed, wordpress removed. However customers are still losing their credit card info.
Can someone point us what we should do to locate the problem, is there a possibility that certain extension massed up our site? How can we find it out.
Thanks.


texts: Conditional if checkout success page in footer

texts: I'm trying to add some some code on the checkout success page in the footer. Is there a conditional to check if its the checkout success page?


texts: How can I retrieve data from database when I change the drop down?

texts:
I have created a custome module for window calculation there is a drop down that we can select color in my .phtml file like below

Frame Color

<select id="color">
<option value="White">White</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Black">Black</option>
<option value="Wood limitation">Wood limitation</option>
</select>

if i select something from my drop down it will change the value. I have used jQuery foe that like below in my .js file

//frame color calculation
        var color = jQuery('#color').val();

        if(color=="White"){
            var framecolor = (0);
        }
        else if(color=="Red"){
            var framecolor = (4);
        }
        else if(color=="Green"){
            var framecolor = (8);
        }
        else if(color=="Black"){
            var framecolor = (12);
        }
        else if(color=="Wood limitation"){
            var framecolor = (18);
        }
        jQuery("#framecolor").html("FrameColor Price: " + framecolor);

Now Im using hard coding for display price. Its not the good way so I created a database table like below

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

How can I get values from databse table when I select something from the drop down. Can someone tell me how to that step by step


texts: How to move the top links to the navigation bar Magento 2

texts: I would like to put the top links (Login, Create Account, Log out, ...) to my navigation bar. Any idea how?


texts: When I create a user in the Magento admin, it automatically unsubscribes them from Mailchimp

texts:
Obviously this only happens if that user has previously subscribed to our mailing list, and yes we have the MageMonkey extension.

Has anyone encountered something like this before? I'm guessing it automatically sets the user NOT part of the newsletter (in magento), and that information gets sent to Mailchimp because the unsubscribe happens immediately on creation of the user. And there's no way to set the Newsletter before creating the user.

Please feel free to simply respond with Mailchimp alternatives, as well.


texts: Paypal Express logo in cart - configuration options

texts:
I want to modify the layout of the Paypal Express logo in the cart (below the "Proceed to checkout" button).
In the admin panel, it looks as if this can be configured:
Shops > Configuration > Sales > Payment Methods > Paypal Express > Advanced Settings > Frontend Settings
However, the changes (different color, layout etc.) don't have any effect in the frontend.
I then looked into the code and found that Magento\Paypal\Model\Config with its methods getExpressCheckoutShortcutImageUrl() and _getDynamicImageUrl() doesn't seem to load the configuration at all.
Am I correct, or do I overlook something?
Using Magento Open Source 2.3.4.


texts: How to get the data of custom attribute in magento 2 after migration

texts:
I have a few doubts about migration.

If I migrate m1 data to m2 what happens to my m1 custom attribute.

I know that its data migration to Magento 2.

Now how can we link that data to Magento 2 custom attribute? or does it automatically generate the attribute in Magento 2?

Can anyone help me out with this?


texts: sku is not taking more than 64 charactars

texts:
we are uploading a sku i.e having more than 64 charactars.

but if we enter the sku with more than 64 charactars, its not taking in the backend

I want to increase the value to more than 64 cahractars.

please help me to find solution


texts: Can we restrict Column pages for a particular pages?

texts: I Want to insert a static block in this way <?php echo $this->getChildHtml('headerimage') ?>  in 1 column.phtml now I want this thing to be worked only for one page say Homepage which is 1 Column not for all the other 1 column pages now can I restrict this changes only to my homepage??


texts: Magento 2: How to override new_grid.phtml in Custom Module?

texts: I need to override product/widget/new/content/new_grid.phtml file in my custom module. Please tell me the possible ways to do it.


texts: how to use library js in child module for current module magento 2

texts:
question 1:how to use library js in child module for current module Magento 2?

question 2:
how to check?

if(child module not exist)
{
    use library js in current module
} else {
    use library js in child module
}

Any help? Thank in advance.


texts: Show % discount in configurable products magento 2

texts:
I have added the following code in /public_html/vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml

   <?php if ( $block->hasSpecialPrice()): ?>

    <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
        'display_label'     => __('Regular Price'),
        'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
        'price_type'        => 'oldPrice',
        'include_container' => true,
        'skip_adjustments'  => true
    ]); ?>

  <?php
  $wasPrice = $priceModel->getValue();
 $nowPrice = $finalPriceModel->getValue();
  $saving = $wasPrice - $nowPrice;
  $savingpct = number_format((float)(100*(($wasPrice -
  $nowPrice)/$wasPrice)), 0);
   if ($nowPrice < $wasPrice){
   echo $savingpct. "% Off";
   }
  ?>

 <?php  endif; ?>

Its showing % discount but on changing variation the % discount  is not changing its same as first product %

How to change the % discount on changing variations

Ex
if configurable options have 3 simple products A,B and C

If A has 10% discount,B has 20% discount and C has 30% discount

Its showing only 10% for all products on change

how to fix the issue


texts: Magento 2 - Transactional Emails Received with Variable Instead of Content

texts:
As you can see by the screenshot, I am getting variables instead of the actual content in transactional emails. This particular template is the New Order Guest template but this happens with New Order as well. I've modified the template but that didn't work. I looked it up but can't find much related to this issue.

The email sends but I get the variables instead of what should be there. Is there something I am missing?

Thanks.


texts: eaDesign Invoice PDF Generator - Support is blocking bug report

texts:
We got a problem with the extension "eaDesign Invoice PDF Generator". Unfortunately the developer do not really help. I spend more than 10 hours in finding the bug but now I am stuck and don't now how to fix it. Currently wasted more than 2 hours with contacting support and try to explain in super high detail the bug... without any success... We bought it 5? times and I am kind of p***

Does someone use "eaDesign Invoice PDF Generator" and can confirm the following bug?

Version: Design Invoice PDF Generator 1.0.26
Tried Magento Versions: 1.9.2.1, 1.9.3.2, 1.9.2.4

The extension allows to call spezific tax values. Like if your VAT is 24% and 20% you can call the tax value of 24%.

eg. 100€ value
20% tax => call 20% tax => showin 20€

eg. "{{var tax_tva}}"

This function is not working on all machines and stores where I have tried it. Incuding eaDesigns own Demo store. I send them detailed information and screenshots but they don't confirm the bug. It's just sending nonsene like other things are the reason...

Please find below a screenshot.

Can someone confirm this is working in his store? I mean explicit not "grandtaxtotal"(!) This is working perfectly. It's just about the marked variable calls.


texts: Is there a way to grey out the picture of items that are sold out? or does it exist in any magento connect extensions?


texts: How to restrict admin access based on Role Created with IP?

texts:
I have created 2 separate roles under Permission -> Roles.

1). For Employees
2). For Suppliers

I was wondering how to restrict Role: Employees to access admin area only from specific IP. We have static IP, which I believe would make this thing easier for us to restrict the admin access.

Or

Is there any other way to restrict some users from accessing admin area by IP only.

Please suggest if this is possible or not.

Thank you


texts: Magento 2 Arabic language character saperated in Invoice PDF

texts:
I have facing the issue with arabic character in invoice PDF. You can see attach screenshot for better understanding. I guess here is some font issue but not getting exact idea how to resolve this issue.

You can see arabic character but it's not arabic. If anyone know the issue please help me resolve the issue.

Thank you in advance.


texts: Magento 2 shopping cart and checkout: show discounts tax included

texts:
In my checkout and shopping cart discounts are appearing tax excluded. I would like to show it tax included

I'm searching where is defined the displayed value to place something like amount * 1.21, in order to show to the visitors this amount tax included (+21%)

By the way, In my Tax configuration, I have selected "Apply Discount On Prices, excluding tax" and it should remain like it is.

¡Thank you!


texts: I have a MultiPHP Manager on my WHM and I have installed Magento 2.2 with PHP 7.1.9. However, whenever I execute a simple cli command I receive an error Magento supports 7.0.2, 7.0.4 and 7.0.6 or later - see screenshot. How do I fix this?


texts: Enable only all fridays in calendar of magento for a specific product

texts:
In a series of products i have select calendar option.

I want to set only friday enabled in calendar for specific product, not in all products having calendar.

Is there any possible way to do it.

will be appreciated.

Thank you in advance.


texts:
I am using Sphinx Search Extension. it was working good on Magento 2.2.8 version.
Now am upgrade my store on 2.3.2 it give error

  Undefined factory sphinx

Anyone also face this issue? if then how to resolve it?


texts: Magento 2: Programmatically update & apply shopping cart rule

texts: how can we update sales rule by ruleId in Magento 2 Programmatically


texts: Login redirects to login page instead of login

texts:
For a few days, the login and register in our shop do not work. A login will be directly redirected to the login page instead of logging in the user.

Form_key is set.
The action of the login form is HTTPS.
The login page is https://xxxx.com/de/customer/account/login/
I have checked the config in :

  System > Configuration > Customer > Customer configuration > Login
  options

The value for "re-direct to account dashboard" was YES. A switch to "NO" had no effect.

What could be a possible reason? This is our shop: https://www.serverandstorage-shop.de


texts: 500 PHP error on Mage:getSingleton('admin/session') after separating admin and frontend servers

texts:
Working with Magento CE v1.9.2.3 with Redis

Doing development for a website that makes use of a separate frontend and admin server in their production environment. I'm attempting to deploy TaxJar and a custom module that I've written to the production environment. They both happen to make use of the same Magento PHP resource in code:

Mage::getSingleton('admin/session');

They've been wanting to install TaxJar for a while and were aware of the error but couldn't make sense of it. Now I've created a module that makes use of the same getSingleton resource and they both trigger the same 500 error whenever it's used in the production environment. Here is the error message on TaxJar:

  PHP Fatal error:  Call to a member function isLoggedIn() on a non-object in
  /var/app/current/app/code/community/Taxjar/SalesTax/Model/Observer/AdminNotifications.php
  on line 31

Worth noting this 500 error does not occur in my local environment, development, or staging where the frontend and admin instances are not separated and do not make use of Redis.

Has anyone ever seen an issue similar to this for other modules or extensions? What could be a cause of this error?

Some context around the code that is causing the 500 error in my custom module:

$session = Mage::getSingleton('admin/session');
if (!$session->isLoggedIn() || !$session->getData(self::IS_PASSWORD_EXPIRED)) {
    return;
}

The context for TaxJar:

    if (Mage::getSingleton('admin/session')->isLoggedIn()) {
        $this->checkUpdate();
    }

In both cases it's using a conditional.


texts: Check if Magento 2 is using pub directory

texts:
How can we check if the website is using pub directory or not, independent of its mode?

Is there any Magento function present to check the root document?


texts: Why preference not working in Magento 2 observer (Custom module)

texts:
etc/di.xml

<preference for="Custom\Pricerule\Observer\Frontend\Catalog\Catalog\ProductGetFinalPrice" type="Lof\RequestForQuote\Observer\ProductGetFinalPrice2" />

  observer/ProductGetFinalPrice2.php

   <?php
    namespace Lof\RequestForQuote\Observer;
    use Magento\Customer\Model\Session as CustomerModelSession;
    use Magento\CatalogRule\Model\RuleFactory as RuleFactory;
    use Custom\Pricerule\Helper\Data;
    use PaarthMage\Document\Model\DocFactory as DocFactory;
    class ProductGetFinalPrice2 implements \Magento\Framework\Event\ObserverInterface
    {

        protected $customerSession;

        protected $catalogRuleFactory;
        protected $helper;
 public function __construct(

        CustomerModelSession $customerSession,
        RuleFactory $catalogRuleFactory,
        DocFactory $DocFactory,
        \Magento\Framework\App\State $state,
        Data $helper

        ) {
        $this->customerSession = $customerSession;
        $this->docFactory =  $DocFactory;
        $this->catalogRuleFactory =  $catalogRuleFactory;
        $this->_state = $state;
        $this->helper =  $helper;

        }

    /**
     * Execute observer
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(
        \Magento\Framework\Event\Observer $observer
    ) {
$event = $observer->getEvent();
        $product = $event->getProduct();

    $productFinalPrice=100;
     $product->setData('special_price', $productFinalPrice);
       $product1=$product->getSpecialprice();

        }
        return $this;
        }
        }
    }

Why I am getting special in this module preference not working in my Lof_RequestForQuote module how I can solve this?


texts:
I don’t know what I did (I haven’t changed anything as far as I’m aware) but all pages in my local magento 2.1 installatin, including admin url seem to redirect to catalog/product/view/id/1/
I think it started when I tried to change from production mode to developer mode and I got an error that some directory in var/view_preprocessed wasn't empty

Admin URL is http://localhost/magento2/admin_txezgg/ and redirects to http://localhost/magento2/admin_txezgg/catalog/product/view/id/1/key/cb1b86e778c363acb15ecf571a2557d6cf06413595c15eb65800f3dd350dba23/

I have done upgrade, cleared/disable/flush caches, reindex, restart laptop and the last thing I did was to uninstall and install magento again, and still is happening!!

Has anybody ever come across this? This is driving me insane...


texts: How to remove the prefix field from the checkout in 2.2

texts:
How do I remove this prefix field from the checkout in Magento 2.2?

When Googling this it appears there used to be an admin setting that has since been moved/removed:

Update - I don't have the Show Prefix option


texts: Magento 2.3.1 : how to get custom options html with price variation assigned to it?

texts:
I tried with this code

public function getCustomOptionsHtml($product)
{

    $_product = $this->_objectManager->create('\Magento\Catalog\Model\Product')->load($product);
    $layout = $this->layoutFactory->create();

    $blockOptionData = $layout->createBlock("Magento\Catalog\Block\Product\View\Options")->setProduct($_product)->setTemplate('Magento_Catalog::product/view/options.phtml');

    $block_links1 = $layout->createBlock('Magento\Catalog\Block\Product\View\Options\Type\DefaultType', 'default')->setTemplate('Magento_Catalog::product/view/options/type/default.phtml');
    $blockOptionData->setChild('default', $block_links1);

    $option_price_renderer_block = $layout
            ->createBlock(
                    "Magento\Framework\Pricing\Render", "product.price.render.default", [
                'data' => [
                    'price_render_handle' => 'catalog_product_prices',
                    'use_link_for_as_low_as' => 'false'
                ]
                    ]
            )
            ->setData('area', 'frontend');

    $option_price_renderer_block->setProduct($_product);
    $blockOptionData->setChild('product.price.render.default', $option_price_renderer_block);

    $block_links2 = $layout->createBlock('Magento\Catalog\Block\Product\View\Options\Type\Text', 'text')->setTemplate('Magento_Catalog::product/view/options/type/text.phtml');
    $blockOptionData->setChild('text', $block_links2);

    $block_links3 = $layout->createBlock('Magento\Catalog\Block\Product\View\Options\Type\File', 'file')->setTemplate('Magento_Catalog::product/view/options/type/file.phtml');
    $blockOptionData->setChild('file', $block_links3);

    $block_links4 = $layout->createBlock('Magento\Catalog\Block\Product\View\Options\Type\Select', 'select')->setTemplate('Magento_Catalog::product/view/options/type/select.phtml');
    $blockOptionData->setChild('select', $block_links4);

    $block_links5 = $layout->createBlock('Magento\Catalog\Block\Product\View\Options\Type\Date', 'date')->setTemplate('Magento_Catalog::product/view/options/type/date.phtml');
    $blockOptionData->setChild('date', $block_links5);

    return $blockOptionData->toHtml();

}

  show error like this

    Fatal error:  Uncaught Error: Call to a member function renderAmount()
    on boolean in
    /home/userdrive/www/magentoproject/vendor/magento/module-catalog/Block/Product/View/Options/AbstractOptions.php:161
    Stack trace:
     /home/userdrive/www/magentoproject/vendor/magento/module-catalog/Block/Product/View/Options/Type/Select/Multiple.php(95):
    Magento\Catalog\Block\Product\View\Options\AbstractOptions->_formatPrice(Array,
    false)
     /home/userdrive/www/magentoproject/vendor/magento/module-catalog/Block/Product/View/Options/Type/Select/Multiple.php(43):
    Magento\Catalog\Block\Product\View\Options\Type\Select\Multiple->processSelectOption(Object(Magento\Framework\View\Element\Html\Select),
    Object(Magento\Catalog\Model\Product\Option))
     /home/manishm/www/magentoproject/vendor/magento/module-catalog/Block/Product/View/Options/Type/Select.php(79):
    Magento\Catalog\Block\Product\View\Options\Type\Select\Multiple->_toHtml()
     /home/userdrive/www/magentoproject/vendor/magento/module-catalog/view/frontend/templates/product/view/options/type/select.phtml(21):
    Magento in
    /home/userdrive/www/magentoproject/vendor/magento/module-catalog/Block/Product/View/Options/AbstractOptions.php
    on line 161


texts: Magento 2 Not Removing Product Special Price by importing CSV

texts:
I am trying to remove the special price of my product by the import CSV. Tried Several Ways.
By adding "0" in the column. Also tried to import with Empty Column. But nothing happened.


texts: How can i remove Discount and Grand Total from magento cart total page, just wanted to show only sub total

texts:
am using aramex for our store, the shipment amount is calculating by aramex,
but we are giving Free Shipping for our customers,so i can't apply discount to aramex shipping charges so now am applying discount to cart, but in the cart total page its discounting 20 and in the cart page its adding another 20 by aramex and discounting it again.

so my solution is just hide the discount thing from cart total page.

Please help me to hide Discount and Grand Total from Cart Total Page.


texts: How to import Etsy products into Magento?

texts:
I have an Etsy shop I want to transfer to Magento. I've exported a CSV file from Etsy, tried to import it in Magento ut got an error message: "Can not find required columns: sku"

I assume my CSV file doensn't follow Magento's csv format. Is there any solution / template I can follow?

Thank you,
Brice


texts: Show product based on customer attributes

texts:
I've added a field for my customer (called "Group").

I want to show the product from the catalog based on this group (I have added a "group" field in my product).

What do I need to override to do this ?

EDIT : based on answer I found a start for the solution, I'm overriding ListProduct.php but when I change the collection sort by adding addAttributeToFilter it shows the same result. See :

    protected function _getProductCollection()
{
    $group = $this->customerSession->getCustomer()->getData("groupe"); //NOT CUSTOMER GROUP, BUT A CUSTOM FIELD CALLED GROUP

    if ($this->_productCollection === null) {
        $this->_productCollection = $this->initializeProductCollection();
        $this->_productCollection->addFieldToSelect("*");
        try {
            $this->_productCollection->addAttributeToFilter("groupe_product", array('eq' => $group));
        } catch (LocalizedException $e) {
            echo $e;
        }

    }

    return $this->_productCollection;
}

Any thoughts ?


texts: Age verification. Varien.DateElement vs Varien.DOB

texts:
I try to add a age verification to the day of birth field on the registration page.
For now I added this code to the Varien.DateElement validate function in the js\varien\js.js file:

today = new Date();
var dateLegal = new Date(today.getFullYear() - 18, today.getMonth(), today.getDate() );
console.log(dateLegal);
if (test.valueOf() > dateLegal.valueOf()) {
    error = 'You must be 18.......';
}

This works how I want it. The problem I have with this is, Varien.DateElement is for every date fields. There is a Varien.DOB special for day of birth. I tried to add there a validate function, but it will be never called.

Varien.DOB = Class.create();
Varien.DOB.prototype = {
    initialize: function(selector, required, format) {
        var el = $$(selector)[0];
        var container       = {};
        container.day       = Element.select(el, '.dob-day input')[0];
        container.month     = Element.select(el, '.dob-month input')[0];
        container.year      = Element.select(el, '.dob-year input')[0];
        container.full      = Element.select(el, '.dob-full input')[0];
        container.advice    = Element.select(el, '.validation-advice')[0];

        new Varien.DateElement('container', container, required, format);
    },
    validate: function() {
        var error = false;
       console.log("validate called"); //I will never be called
    }
};

So is there a better way to add a validation then to place it in Varien.DateElement ?


texts: Magento 2 - CMS Block redirection to url

texts:
I would like to be able to redirect to a url when the user clicks the category.

I have this menu, with the News category. This category loads a CMS Block:

And only having a script which redirects me to an url:

<script type="application/javascript">
window.location.href = "http://web/blog/news/";
</script>

I have also used:

<meta http-equiv="refresh" content="0; URL='http://web/blog/news/'" />

Basically it redirects fine, but in between it loads the CMS Block, which has the javascript:

And after it does properly redirect to the wanted url.

The issue here is that it shows the CMS Block in between, can I avoid that somehow? Or is there a better way to do it?

The main point here is to be able to create a categories link to this webpage, and so far, creating a block and adding it to the category is what I have comed up to. If necessary I can open de code and do it programatically, but it's not what I'm seeking for due to the clients would like to add more and they are not developers.


texts: How to add date filter to product collection

texts:
I was wondering if there is any way to add a date filter to a product collection.
What i am trying to do: I have a collection for new products, i need to add a filter to it so it filter the products by date. i dont need all days just three past days. The idea is just like layered navigation just the option must be three past days and they mus be generated dynamically.
Note: The date mus be selected in frontend by the user.
THanks in advance


texts: want to hide estimate shipping methods on cart page while page reload

texts:
After adding GET ESTIMATE button ,shipping method will shown but when we reload the page that shipping methods loaded again and I want  estimate shipping method will hide on page reload.
tell me the solution.


texts: Getting this error on checkout page in magento2

texts:
1 exception(s):
  Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'block',
  attribute 'name': [facet 'pattern'] The value 'Question Block' is not
  accepted by the pattern '[a-zA-Z0-9][a-zA-Z\d-_.]*'. Line: 1816


texts:
<?php
namespace Queueapp\Queueapp\Controller\Query;
// Mage::app();

class Products extends \Magento\Framework\App\Action\Action {
    /** @var  \Magento\Framework\View\Result\Page */
    protected $resultPageFactory;
    /**      * @param \Magento\Framework\App\Action\Context $context      */
    public function __construct(\Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory)     {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    /**
     * Blog Index, shows a list of recent blog posts.
     *
     * @return \Magento\Framework\View\Result\PageFactory
     */
    public function execute()
    {
      //How do I access the products/categories information here and send it to my frontend as json
      $resultPage = $this->resultPageFactory->create();
      $resultPage->getConfig()->getTitle()->prepend(__('Products'));
      echo json_encode("me");
      return $resultPage;

    }
}


texts: Add custom product attribute to URL product view

texts:
I have created an EAV entity (that represents the brand) which can be associated to a product as an attribute.
Now, I would like to add the name of the brand to the product view URL.
I would like something like this:

http://myhost.com/category-name/brand-name/product-name

Is there a way to extend the url rewrite for products view?


texts:
I have a question about magento 1.9.0.1.

I'm doing the support of an online shop for customers.
Currently, I'm making a search engine optimization. In the analysis I noticed that we have 3643 rewrite URLs in the system.
But we have only 973 Single Products in the system. In addition, the few are used by the Single Products in 57 configurable products.

Could be problems with SEO or the Site speed it might.

It is also interesting that the SEO Alnalysesoftware 265 URLs were analyzed with limited indexing. And 256 with 302 redirect URLs


texts: How to add a date picker recursively in magento2 admin form

texts:
How to add a date picker recursively in backend ?

System.xml

 <field id="mapping" translate="label comment tooltip" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0">
                    <label>Date off</label>
                    <frontend_model>Companyname\DeliveryDate\Block\Adminhtml\System\Config\Form\Field\Datemap</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                    <comment>                        <![CDATA[Allows admins to choose any date off that they want]]>
                    </comment>
                </field>

My code:

<?php
namespace Companyname\DeliveryDate\Block\Adminhtml\System\Config\Form\Field;

class Datemap extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray
{
    /**
     * @var \Magento\Framework\Data\Form\Element\Factory
     */
    protected $_elementFactory;

    /**
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Framework\Data\Form\Element\Factory $elementFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Data\Form\Element\Factory $elementFactory,
        array $data = []
    )
    {
        $this->_elementFactory  = $elementFactory;
        parent::__construct($context,$data);
    }
    protected function _construct()
    {
        $this->addColumn('field1', ['label' => __('Date'), 'class' => 'input-text required-entry field']);
        $this->_addAfter = false;
        $this->_addButtonLabel = __('Add');
        parent::_construct();
    }

}
?>
<script>
 require([ "jquery", "mage/calendar" ],
function($){
 $(".field").calendar({
 changeYear:true,
changeMonth:true,
yearRange: "1970:2050",
buttonText:"Select Date",
dateFormat:"dd-mm-yy"
});
});
 </script>

My output is:


texts: Loading products collection via php_cli fails

texts:
There's around 18 000 products in a shop. When loading all in the front-end script it works. When loading them via cron(php_cli) the script times out/fails. The code:

$collection = Mage::getModel('catalog/product')->getCollection()
    ->setStoreId($storeId)
    ->addAttributeToSelect('name')
    ->addAttributeToSelect('url_path')
    ->addAttributeToFilter('visibility', 4)
    ->addAttributeToFilter('status', 1);

I thought that it's a memory/performance issue so I added ini_set('memory_limit', '1024M'); on the top of the script and limited number of products to 20 with ->setPageSize(20)->setCurPage(1);. It still freezes when called by cron. I don't get any error report or exception.

Is it possible that 18k products are still loaded on the MySql side, despite adding page size limit, and make the server freeze?

Or does adding this limits the number of handled products to 20 on all levels of the application?

Which php/mysql settings shall I check/debug in this problem?

Sorry for a quite general question but it's difficult to choose the best approach in this situation.


texts: How would I delete Products that has value over a specific amount in magento?

texts: I am looking for sql code that will allow me to delete products from my magento database that is over a certain price. Can some help me with this code please.


texts: Toolbar not display on catalog search magento 2.x luma theme

texts:
When I search any product Toolbar and Pagination is not showing on the Catalog Search page.

But it is Working on my local server.

Magento V 2.0.17 Custom Luma theme
PHP 7.0.3


texts: Onepage checkout, or not Onepage checkout

texts:
I have noticed a lot of sites replace the default OnePage checkout with 3rd party modules.

Two replacements I am familiar with is OneStep, and CheckItOut.

My personal opinion, from experience, is that the 3rd party checkouts are not worth the extra hassle they bring, mainly in extending their functionality.

Why are some so keen in replacing OnePage?
What is so wrong with it?


texts: How can you tell why full page cache is not working on a category page in Magento2

texts: I have enabled full page cache on a Magento2 site which has had quite a few modifications. It does not seem to be taking effect however and I know that if any of the blocks on the page are set to be cacheable="false" then the whole page will not cache. Is there anyway to tell what blocks on a page are cacheable and what is not so that I can ensure that full page cache is enabled? Or is this not possible?


texts:
Hey I've started getting this error yesterday:

"Illegal scheme supplied, only alphanumeric characters are permitted"

The error started after we implemented this fix for Varnish cache. Caracter fix

First I did, disabled the Complination manually.

Then went to phpMyadmin and checked the secure and unsecure urls:
both are set to: http://www.golulo.es/, also tryed others, like http://golulo.es/etc. Nothing fixed the issue.

Checked the app/etc/local.xml and everything seems to be correct in this format:

<![CDATA[usrname]]>

The password has + in it, but it worked before, so I don't think this is what causing it.

Cleared cache manually on every change I made. I can't find where is the issue?

Could anyone point me to the right dirrection?

Thanks,


texts: Which pages is Magento FPC actually caching?

texts:
I'm wondering what Magento Enterprise FPC is actually caching. I read a couple times now that it is only caching category pages, product detail pages and CMS pages.

But what happens to the other pages/content?

Header (since it a block)
Homepage
Footer (since it is a block)
Wishlist (all pages)
Gift registry (all pages)
Customer Account (all pages)
Category Page / Search
Cart
Checkout
Success
Product Page Simple Product
Page Configurable
Product Page Grouped
Product Page Virtual
Product Page Bundle
Product Page Downloadable
Product Page Giftcard
Static pages (CMS Pages)
BACKEND

So only the pages in "bold" get cached?

Thank you!


texts: In a products collection have addAttributeToFilter 'check' child products of a configurable product?

texts:
For our API we have an option to use filters, these work great so far and are pretty simply made with the addAttributeToFilter function.
However, the problem is that when a configurable product has a child product with an attribute which indicates that it's blue, and I filter the products on the color attribute with the corresponding blue filter value, it also filters out that configurable product.
We'd like to have these configurable products in our response, but how? I've seen suggestions to use addFieldToFilter, but that gives the same results.


texts: How to remove all associated quote objects of a customer completely

texts:
I found out I have some quote objects* that have some invalid data or item data that cause a huge lag every time a customer tries to add items to cart or view cart.

*quote object: database records from quote,quote_item,quote_address...

This is what I've got so far:

/**
 * @param string $email
 * @return bool
 */
function deleteCustomerQuote($email) {
    // \vendor\magento\module-customer\etc\di.xml : \Magento\Customer\Api\CustomerRepositoryInterface = \Magento\Customer\Model\ResourceModel\CustomerRepository
    // \vendor\magento\module-quote\etc\di.xml : \Magento\Quote\Api\CartRepositoryInterface = \Magento\Quote\Model\QuoteRepository
    /** @var \Magento\Framework\App\ObjectManager $objectManager */
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */
    $customerRepository = $objectManager->get('\Magento\Customer\Api\CustomerRepositoryInterface');
    /** @var \Magento\Quote\Api\CartRepositoryInterface $cartRepository */
    $cartRepository = $objectManager->get('\Magento\Quote\Api\CartRepositoryInterface');
    try {
        $customer = $customerRepository->get($email);
        $cart = $cartRepository->getForCustomer($customer->getId()); // Magento\Quote\Api\Data\CartInterface
        $cartRepository->delete($cart);
        return true;
    } catch (\Exception $exception) {
        return false;
    }
}

and also this:

/**
 * @param string $email
 * @return bool
 */
function deleteAllCustomerQuotes($email) {
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */
    $customerRepository = $objectManager->get('\Magento\Customer\Api\CustomerRepositoryInterface');
    /** @var \Magento\Quote\Model\ResourceModel\Quote\CollectionFactory $quoteCollectionFactory */
    $quoteCollectionFactory = $objectManager->get('\Magento\Quote\Model\ResourceModel\Quote\CollectionFactory');
    /** @var \Magento\Quote\Api\CartRepositoryInterface $cartRepository */
    $cartRepository = $objectManager->get('\Magento\Quote\Api\CartRepositoryInterface');
    try {
        $customer = $customerRepository->get($email);
        $customerId = $customer->getId();
        $quoteCollection = $quoteCollectionFactory->create()->addFieldToFilter('customer_id', $customerId);
        if ( $quoteCollection->getSize() ) {
            /** @var \Magento\Quote\Model\Quote $item */
            foreach ( $quoteCollection as $item ) {
                $cartRepository->delete($item);
            }
        }
        return true;
    } catch (\Exception $exception) {
        return false;
    }
}


texts: How to update default value (frontend_label to DB) attribute programmaticaly Magento2?

texts:
I want to edit the frontend label attribute.
I know how to do this through the database, but I haven’t found anything on the Internet how to change the attribute name

How do I change the attribute name programmatically ?


texts: How to display a popup on the product page at the touch of a button, add to the basket? Magento 2

texts:
There is an event that checks if the goods in the basket when we go to the product page. If there is an attribute in the goods that allows to deliver the goods on the day of the order, if this attribute is included in the product, then it returns "1" if it is disabled, then there is nothing.
Now how to show the popup when you click on "add to cart" on the product page if there is already a product in the basket with the possibility of delivery today, and the second product that we want to add does not have this possibility.
And on the pop-up there should be two buttons, "Continue" or "Cancel". If the user clicks "Continue" then we add the item to the basket, and if the user clicks "Cancel", then we close the popup and there is nothing to add to the basket.

  Observer->DayDelivery.php

namespace Ronis\SameDayDelivery\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;

class DayDelivery implements ObserverInterface
{
    protected $resultPageFactory;

    /**
     * @var \Magento\Checkout\Model\Cart
     */
    protected $_cart;
    protected $_productCollectionFactory;
    protected $_resultJsonFactory;

    /**
     * [__construct description]
     * @param \Magento\Framework\App\Action\Context $context [description]
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory [description]
     * @param \Magento\Checkout\Model\Cart $cart [description]
     */
    public function __construct(
        \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Checkout\Model\Cart $cart,
        CollectionFactory $productCollectionFactory
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        $this->_cart = $cart;
        $this->_resultJsonFactory = $resultJsonFactory;
        $this->_productCollectionFactory = $productCollectionFactory;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/samDayDelivery.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);

        $cartProductIds = $this->_cart->getQuoteProductIds();
        $productCollection = $this->_productCollectionFactory->create();
        if (!$cartProductIds) {
            return false;
        } else {
            $productCollection->addFieldToFilter('entity_id', ['in' => [$cartProductIds]]);
            $productCollection->addAttributeToSelect('allow_same_day_delivery');
            foreach ($productCollection as $item) {
                $id = $item->getId();
                $check = $item->getData('allow_same_day_delivery');
                $logger->info('Delivery sam day id: ' . $id . ' status ' . $check);
            }
//            $result = $this->_resultJsonFactory->create()->setData(['Shipment check' => $check]);
//            return $result;
        }
    }
}


texts: How layer navigation counter works in Magento 2

texts:
I want to add some conditions for the layer navigation counter. Basically I want to skip from counting some products.

In vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php in _getItemsData we have a products collection, and then based on the collection, all the counter for the categories comes form this line :

 $optionsFacetedData = $productCollection->getFacetedData('category');

On the getFacetedData function we have:

 $aggregations = $this->searchResult->getAggregations();

This will return all the counters for all categories, attributes, prices etc...

If I add some condition on the product collection nothing happen with the counter, even if i remove all the items from the collection i still have the same numbers for category counter.

Does anyone know how this getAggregations function works, and how the counter works?

I mean where in the code i can find the actual assignment for the category x and the number of products associated with the category.


texts: Add custom options pragmatically in products

texts:
Say I have 1000 product in some category, Now I want to add custom options in it, How can it be done?
Below in my custom option structure:
Title   Input Type  Is Required Sort Order
size    Dropdown     No

sizes(S, M, L, XL) and so on


texts: Magento 2 how to make sticky navigation top menu for frontend?

texts:
I am using Magento2 and I need to make header sticky for the frontend .how can I make header sticky?
When user scroll page then header should be sticky at the top, how we can do this? this code should apply for desktop view only not for a mobile and   iPad view.

Thanks in advance.


texts: How to display all stores on the home page

texts:
How in custom created module to make the logic of receiving and displaying all links to stores. The display should be on the homepage.

I tried the solution that suggested Google search, but I can’t finish the solution, because I don’t know how to put all the stores on the homepage.

public function __construct(
...,
\Magento\Store\Model\StoreManagerInterface $storeManager
) {
...
     $this->_storeManager = $storeManager;
}
....
private function getStoreData(){
    $storeManagerDataList = $this->_storeManager->getStores();
     $options = array();

     foreach ($storeManagerDataList as $key => $value) {
               $options[] = ['label' => $value['name'].' - '.$value['code'], 'value' => $key];
     }
     return $options;
}


texts: how to solve Fatal error: Class 'Aschroder_SMTPPro_Model_Mysql4_Setup' not found in includes\src\Mage_Core_Model_Resource_Setup.php on line 234

texts:
I install SMTP mail extension from magento connect manager..but when I return to my admin page from that window... after that admin page(back-end) and front-end both are not show..and error generate of this type..

Fatal error: Class 'Aschroder_SMTPPro_Model_Mysql4_Setup' not found in D:\NIORN\wamp\www\magentosec\includes\src\Mage_Core_Model_Resource_Setup.php on line 234

So ,you have any answer of this error. Please suggest...


texts: API V1 - Multicall updates only first digit

texts:
I am trying to update the inventory using multiCall, but it seems that it's only taking the first digit. Here is my php code:

$stockItemData = array(
    'sku' => 'somesku-30',
    'qty' => '32'
);

$result = $client->multiCall($sid, array(
     array('product_stock.update', $stockItemData)
));

When I look at the product in the control panel, I can only see that the quantity is set to 3. If I try to update with 40, then the control panel shows 4. If I try with 50, it shows 5 only etc..

Any ideas?


texts: How to solve jquery issues in Magento 2?

texts:
I am using Magento 2.2.3 and I have created customtheme

But in my website scripts are not working properly.It gives me below error:

  ReferenceError: jQuery is not defined

I have added requirejs-config.js file in below path:

app/design/frontend/vendor_name/theme_name/Magento_catalog

But it still gives me same error.

So how can i solve this issue


texts: Can I override getLoadedProductCollection() before it’s being loaded?

texts:
I'm trying to override the products collection that's coming from $this->getLoadedProductCollection() so I tried to override the method

class **_**_Model_Rewrite_Layer extends Mage_Catalog_Model_Layer {
  public function prepareProductCollection($collection) {
  ...
  $collection->addAttributeToFilter('my_attribute', array('in' => array(67)));
  ...
}

but that doesn't seem to work. When I add

echo ( $collection-&gt;getSelect() );

the query doesn't even include the layered navigation filters so I can't overwrite their logic.

What I'm trying to do is to change how one layered navigation filter works.

Am I on the right track to override prepareProductCollection() or should I go overriding a method that's called later in the process?

Any help would be appreciated.


texts:
I am looking to enable the sending of emails through the store using different email accounts in the case of general contact, sales and support.

So far I have been able to send emails by configuring ssmtp on my server with Ubuntu, but when I configure the different email addresses in the store panel, the emails do not go out, only with the account configured in the ssmtp.

Any ideas on how to enable mail delivery for certain addresses in my mail domain?


texts: One time script to set custom attribute for ~1m customers - memory leak

texts:
I'm trying to run a one-time script (in a custom module upgrade) to set a new attribute last_order_date based on the date of that customer's last order.

I have this script:

$users = mage::getModel('customer/customer')->getCollection()
           ->addAttributeToSelect('last_order_date');

foreach ($users as $user){
   $lastDate = $user->getData('last_order_date');
   if(empty($lastDate)){
       $orderCollection = Mage::getModel('sales/order')->getCollection()
            ->addFilter('customer_id', $user->getId())
            ->setOrder('created_at', Varien_Data_Collection_Db::SORT_ORDER_DESC)
        ;
        $numberOfOrders = $orderCollection->count();
        if($numberOfOrders!=0){
            $newestOrder = $orderCollection->getFirstItem();
            $lastOrderDate = $newestOrder->getCreatedAt();
            $user->setData('last_order_date', $lastOrderDate);
            $user->save();
        }
   }
}

But it's causing a memory leak:

  Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried
  to allocate 32 bytes) in
  [..]/web-root/lib/Zend/Db/Adapter/Pdo/Abstract.php
  on line 292

Which I understand is due to the looped calls to Mage::getModel('sales/order').

How do I achieve this without the repeated calls?


texts: How to use store image URL in Email Templates

texts: I have multiple stores and want to change Store Logo in Email templates specific to the store.


texts: How to move add to cart to right side bar

texts:
Can somebody help me to move add to cart button to right side bar in Magento 2.1.3 CE?

I succeed to move add to wish list and social icons by adding this code in   catalog_product_view.xml , but no success with add to cart.

Thank You.

<move element="product.info.social" destination="sidebar.additional" before="-"/>


texts: Changing the Attribute Set for a Simple Product

texts:
Basically the subject.

I have a simple product created with a particular attribute set.  Is there a way to change the attribute set associated with this product without having to create a new one?


texts:
I am creating a module and I want it should add a .phtml files contents to all pages what do I need to write in my layout.xml file to do this? I am unsuccessfully trying,

<?xml version="1.0"?>
<layout version="1.0.0">
    <default>
        <reference name="before_body_end">
            <block type="core/template" name="mypopup_block"  template="[namespace]/[module]/htmltoadd.phtml"></block>
        </reference>
    </default>
</layout>

here is the config.xml calling the layout file

<config>
...
<global>
<frontend>
    <layout>
        <updates>
            <[namespace]_[module module="[namespace]_[module">
                <file>[namespace]_[module].xml</file>
            </[namespace]_[module>
        </updates>
    </layout>
</frontend>
</global>


texts: Unable to select a single check box in the admin grid

texts:
I'm working on magento 2.1. For deleting two or more rows from the admin grid, I'm unable to select the corresponding rows using the checkbox. If I clicked on a single check box, then all check boxes is getting checked.

Is this because of any JS issues?


texts: How to redefine massaction actions in grid ui-component sales_order_grid

texts:
In my custom extension i have tried modify section massaction name="listing_massaction". Just copy content from ui_component/sales_order_grid only keep actions neccessary but after clear cache, magento still combine all action from module magento_sales

Thinks i have done

Overwrite layout sales_order_index in my directory adminhtml/layout

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

ui_component/sales_order_grid

<massaction name="listing_massaction">
        <action name="custom_print_orders" class="Company\Extension\Ui\Component\Action">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">custom_print_orders</item>
                    <item name="label" xsi:type="string" translate="true">Custom PDF - Print Orders</item>

                </item>
            </argument>
        </action>
        <action name="custom_print_invoices" class="Company\Extension\Ui\Component\Action">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">custom_print_invoices</item>
                    <item name="label" xsi:type="string" translate="true">Custom PDF - Print Invoices</item>

                </item>
            </argument>
        </action>
        <action name="custom_print_shipments" class="Company\Extension\Ui\Component\Action">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">custom_print_shipments</item>
                    <item name="label" xsi:type="string" translate="true">Easy PDF - Print Shipments</item>

                </item>
            </argument>
        </action>
        <action name="custom_print_creditmemos" class="Company\Extension\Ui\Component\Action">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">custom_print_creditmemos</item>
                    <item name="label" xsi:type="string" translate="true">Custom PDF - Print Creditmemos</item>

                </item>
            </argument>
        </action>
    </massaction>

Is there a way to remove original or disable action in massaction grid ui ?


texts: How can i add custom button (not add to cart) in product page in Magento2?

texts: I want to add a new button to the product page , in which file can I add or should I create a module for this?


texts: Why are Sales & General emails are not being received on my website?

texts:
Emails on my site are not working despite having SMTP Pro installed. The Self-Test works perfectly fine but once I test the contact form or anything else they are not coming through to the recipient. My mail server is with Office 365 and requires all SMTP info for it to allow the email.

Why do the emails not work despite having SMTP Pro installed and the self test working?

Any help is much appreciated!


texts:
I'm trying to migrate a CE 1.9.2.4 to CE 2.3.0 using the migration tool. I've managed to migrate the settings ok but when I try to migrate the data if get the following error.

[2019-03-11 14:02:16][INFO][mode: data][stage: data migration][step: Map Step]: started
7% [==>-------------------------] Remaining Time: < 1 sec
In Mysql.php line 173:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '13-1052-0' for key 'CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID'

I've seen posts about similar errors but nothing that relates to CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID. I realise that there is some kind of duplicate but can't find a way to identify and fix it.

Any help is really appreciated.


texts: I want to display login form in shopping cart page below checkout button in magento

texts:
I want to display login form in shopping cart page below checkout button in Magento.

There is any way to display the login form in that section, just like below image


texts: Magento2 Order Invoice layout file location and block?

texts:
I want to know the layout file and block file location that is being used to generate pdf invoice when we click on the print button on this page.
Your help will be appreciated.


texts:
Is there a way to order the CSS assets in Magento 2.2?

I want to include https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css Bootstrap's CSS before styles-m and styles-l css files.

I'm not seeing where to do this at, though. Seems like the most basic thing in the world of web design / web dev. Any ideas?


texts:
my layout.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <checkout_onepage_index>
        <reference name="checkout.onepage.billing">
            <action method="setTemplate"><template>checkout/onepage/billing.phtml</template></action>
        </reference>
        <reference name="checkout.onepage.shipping">
            <action method="setTemplate"><template>checkout/onepage/shipping.phtml</template></action>
        </reference>
    </checkout_onepage_index>
</layout>

And I have deleted the FAX line in both the billing and shipping.phtml, cleared cash, flushed, tried almost everything I can think of, even commented out the Fax in the billing in the base folder - the fax field still stays there, obviously I am doing something wrong and would apppreciate if anyone has an idea.


texts: Add dynamically generated CSS to  for a specific page

texts:
I have custom css

 <style>
        .flip-clock-wrapper ul li a div div.inn {
            background-color: **<?php echo '#' . $timerColor;?> !important;**
        }
    </style>

in view.phtml; But i want to add this css to <head> only for this page.
So how to add this css to page <head> ?


texts: Magento 2: Custom field Dropdown options admin form always empty

texts:
I'm using magento 2.3.4 and I tried to create a custom form with dropdown options like this:

   <field name="year">
         <argument name="data" xsi:type="array">
                 <item name="options" xsi:type="object">Vendor\Module\Model\Year\Attribute\Source\Years</item>
                 <item name="config" xsi:type="array">
                         <item name="dataType" xsi:type="string">text</item>
                         <item name="label" xsi:type="string" translate="true">Year</item>
                         <item name="formElement" xsi:type="string">select</item>
                         <item name="source" xsi:type="string">Year</item>
                         <item name="dataScope" xsi:type="string">year</item>
                         <item name="default" xsi:type="string">0</item>
                         <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
                         <item name="validation" xsi:type="array">
                                 <item name="required-entry" xsi:type="boolean">true</item>
                         </item>
                 </item>
         </argument>
  </field>

app/code/Vendor/Module/Model/Year/Attribute/Source/Years.php

namespace Vendor\Module\Model\Year\Attribute\Source;

class Years implements \Magento\Framework\Option\ArrayInterface
{

  public function toOptionArray() {
    $earliest_year = 2012;
    $options = array();
    foreach (range(date('Y'), $earliest_year) as $x) {
      $options[] = ['value' => $x, 'label' => $x];
    }
    return $options;
  }
}

but the dropdown options always empty, when i print the $options using print_r($options);exit; it shows:

Array
(
    [0] => Array
        (
            [label] => 2020
            [value] => 2020
        )

    [1] => Array
        (
            [label] => 2019
            [value] => 2019
        )

    [2] => Array
        (
            [label] => 2018
            [value] => 2018
        )

    [3] => Array
        (
            [label] => 2017
            [value] => 2017
        )

    [4] => Array
        (
            [label] => 2016
            [value] => 2016
        )

    [5] => Array
        (
            [label] => 2015
            [value] => 2015
        )

    [6] => Array
        (
            [label] => 2014
            [value] => 2014
        )

    [7] => Array
        (
            [label] => 2013
            [value] => 2013
        )

    [8] => Array
        (
            [label] => 2012
            [value] => 2012
        )

)


texts:
I'm using this extension - http://www.magentocommerce.com/magento-connect/sort-by-date.html , which orders products by date (specifically by created_at eav attribute). Basically all it does is adds one more sort type like so:

$installer->startSetup();

    $prodEntityTypeId = $installer->getEntityTypeId('catalog_product');
    $installer->updateAttribute($prodEntityTypeId, 'created_at', 'frontend_label', 'Date created');
    $installer->updateAttribute($prodEntityTypeId, 'created_at', 'used_for_sort_by', 1);

$installer->endSetup();

Is there any way to show this attribute in admin area and be able to edit it? (to change order of some products) To implement this, I was trying to edit its params eav_attributes, but without success – the field is not visible in "edit product" page.

EDIT: I gave up, created a custom date attribute and fetched data in it from created_at.


texts: Magento 2 - Correct way of Module Installation

texts:
Trying to install sample module in Magento 2 from this. Below is the module structure app/code/NameSpace/Module/

module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Magentostudy_News" setup_version="0.0.1" schema_version="0.0.1"/>
</config>

composer.json

{
    "name": "magentostudy/module-news",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/module-store": "100.0.0",
        "magento/module-email": "100.0.0",
        "magento/module-ui": "100.0.0",
        "magento/framework": "100.0.0"
    },
    "type": "magento2-module",
    "version": "0.0.1",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [ "registration.php" ],
        "psr-4": {
            "Magentostudy\\News\\": ""
        }
    }
    }

Registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Magentostudy_News',
    __DIR__
);

Executing below command to enable module

php ./bin/magento module:enable Magentostudy_News

It says there are no commands defined in the "module" namespace. Also on frontend it throws below exception. I am using composer but not github.

Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Source class "\Magento\Framework\Module\Updater\Setup" for "Magento\Framework\Module\Updater\SetupFactory" generation does not exist.'

CODE EDIT

Added Setup folder with file InstallSchema.php which includes below code

    <?php
/**
 * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
 */

/* @var $installer \Magento\Setup\Module\SetupModule */

namespace Magentostudy\News\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;

$installer = $this;
$installer->startSetup();

/**
 * Creating table magentostudy_news
 */
$table = $installer->getConnection()->newTable(
    $installer->getTable('magentostudy_news')
)->addColumn(
    'news_id',
    \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
    null,
    ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
    'Entity Id'
)->addColumn(
    'title',
    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    255,
    ['nullable' => true],
    'News Title'
)->addColumn(
    'author',
    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    255,
    ['nullable' => true,'default' => null],
    'Author'
)->addColumn(
    'content',
    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    '2M',
    ['nullable' => true,'default' => null],
    'Content'
)->addColumn(
    'image',
    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    null,
    ['nullable' => true,'default' => null],
    'News image media path'
)->addColumn(
    'created_at',
    \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
    null,
    ['nullable' => false],
    'Created At'
)->addColumn(
    'published_at',
    \Magento\Framework\DB\Ddl\Table::TYPE_DATE,
    null,
    ['nullable' => true,'default' => null],
    'World publish date'
)->addIndex(
    $installer->getIdxName(
        'magentostudy_news',
        ['published_at'],
        \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX
    ),
    ['published_at'],
    ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX]
)->setComment(
    'News item'
);
$installer->getConnection()->createTable($table);
$installer->endSetup();

What is the correct way to install Magento 2 modules ?
Any crucial step I missed ?

Reference URL : http://mageinferno.com/blog/setting-up-magento-2-module-right-way-composer-packagist


texts: Images uploading, going to the /media/tmp, but not saving in media/catalog after saving category magento 2

texts:
I have created custom image attribute. This is displaying perfect. But when i save category, it is not saving.
Images are uploading perfectly, Saving at /media/tmp, but not saving in media/catalog after saving category magento 2.


texts:
I have two database tables, zones and rules. The rules includes a foreign key to the zones table (i.e. zone_id) and I wish to create an admin form to edit these.
The zone edit form includes the various fields of the zone in one fieldset and an insertListings ui component in another. At the moment the rules listings shows all listings, for every single zone, but I want to limit this to the zone that is being editted.
How do I connect the insertListings to only show the rules associated with the id of the form?
Any help will be appreciated.


texts: Backend changes stopped working in Magento

texts: I'm trying to set the categories to view as 2 columns with left bar in display settings but Im still seeing the 3column template - also tried setting the category to show static block only but it's still showing products. Any ideas?


texts: Custom RWD theme falling back on base theme instead of rwd

texts:
I'm trying to create a custom RWD theme with magento 1.9 and for some reason even after following this guide:

https://www.flinttechnology.co.uk/customising-rwd-magento-responsive-theme/

Its using the base theme as the fallback instead of the RWD theme.


texts: Does Magento 2 offer .tar.gz file handling?

texts:
Magento 2 offers \Magento\Framework\Archive\Tar to handle TAR files and   \Magento\Framework\Archive\Gz to handle Gz archives.

Does Magento 2 offer a solution to directly unpack .tar.gz files or do I have to do it myself by first unpacking the .gz and then the .tar?


texts: getChildrenCategories only includes categories with Include in navigation set to yes

texts:
I want to display the child categories of a category and I want to display them in the order they're in in the admin panel. I've read a lot about it and the simplest way seems to be to use getChildrenCategories as that returns the children in the right order.

However, I've found this only returns categories with Include in navigation set to yes whereas all the child categories have this set to no in my case.

I've tracked this down to _loadNodes in flat.php. I've included the relevant code from it below and you can see the hard coded where statement in the penultimate line.

My question is simply how can I stop this? Is there a simple way?

Thanks

protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId = 0, $onlyActive = true)
{
    $_conn = $this->_getReadAdapter();
    $startLevel = 1;
    $parentPath = '';
    if ($parentNode instanceof Mage_Catalog_Model_Category) {
        $parentPath = $parentNode->getPath();
        $startLevel = $parentNode->getLevel();
    } elseif (is_numeric($parentNode)) {
        $selectParent = $_conn->select()
            ->from($this->getMainStoreTable($storeId))
            ->where('entity_id = ?', $parentNode)
            ->where('store_id = ?', $storeId);
        $parentNode = $_conn->fetchRow($selectParent);
        if ($parentNode) {
            $parentPath = $parentNode['path'];
            $startLevel = $parentNode['level'];
        }
    }
    $select = $_conn->select()
        ->from(
            array('main_table' => $this->getMainStoreTable($storeId)),
            array('entity_id',
                new Zend_Db_Expr('main_table.' . $_conn->quoteIdentifier('name')),
                new Zend_Db_Expr('main_table.' . $_conn->quoteIdentifier('path')),
                'is_active',
                'is_anchor'))

        ->where('main_table.include_in_menu = ?', '1')
        ->order('main_table.position');


texts:
I have to work on Magento and which uses Varnish cache.

How do I disable it? Or is there a way to see changes immediately?


texts: I need to know how to change the magento customer address book drop down to radio buttons

texts: I have a requirement in magento checkout page customer address input dropdown to  radio buttons please help me is it possible to change dropdown to radio buttons.


texts:
I'm using the rwd theme that came with Magento 1.9. I just modified the styling a bit. The problem is now, if I want to buy a product the checkout is working fine. But if I want to order something as a Guest I can't get past the Billing fields step. The button does nothing, not even a javascript error in the console.

Other things I've tried:

Disabled all third party modules
Disabled the other jquery scripts that does give an error in console
Cleared cache and everything, private browser etc.

Anybody came across this bug and had an solution? If anybody wants to give it a go, check:
http://yentlmobile.staging.pixelindustries.com/


texts:
I checked my website at google speed :

  https://developers.google.com/speed/pagespeed/insights/?hl=fr&url=http%3A%2F%2Fwww.mdsoft-test.com%2FSiteSajaddav2%2FSiteSajjada%2Fhome-demo-01&tab=desktop

and i found that it is slow so how to speed my website thanks in advance


texts: How to Disable Module on the basis of configuration Values in Magento 2

texts:
I have created a New module in Magneto 2 Which is Working well Now I want to control the status of the module on the bases of system Configuration setting

How can I do this?

I have already created a Field for status enable/disable in my system.xml


texts: Magento2 : Iterate over blocks and show them as products

texts:
I've got a set of blocks made in the backend. Now, I want the following to be possible:

Iterate over a selected count of blocks, starting with a certain name (which would not be the hardest part) in a custom phtml file
Show each block like as a product on my page
When I click on a 'block product', a pop up will show up with content corresponding to that block.

Now, I already have the code for the pop up and stuff, but my question is:

Is it possible to iterate over a set of CMS blocks and show them on my page (and preferably in the same way a product, so more like a link to the block rather than the whole block content) ?


texts: change url rewrite special character 'ñ' from '-' to 'n'

texts:
I have a Magento ver. 1.9.2.4 with friendly url rewrite active. It works, but it is replacing special characters as 'ñ' with '-' and I need to replace them with 'n'.

Now if the product is, for example, named 'piña' in the url rewrite is changed to 'pi-a', and I want to change it to 'pina'.

I do not find any option to change this in the backend, only the URL Rewrite management, but changing it one by one is not an option.

Where is the url rewrite code? I'm thinking about replacing 'ñ' character to 'n' in the string before the url encode, but I'm not finding the code.


texts: How to print out current url on Magento 1.4.1.1?

texts:
I'm looking for a way to get current URL from the file "view.phtml".
I've tried these 2 differents ways. None of them do print the entire product URL. Worst, the second way crashes...

/*1*/ Mage::log(__METHOD__ . '()'.Mage::getUrl('*/*/*'));
/*2*/ Mage::log(__METHOD__ . '()'.Mage::helper('core/url')->getCurrentUrl());

Don't hesitate to provide code snippets as I'm new in Magento.


texts: Catalog Search Query fetch records related to store categories

texts: I am working on one website - multi store functionality and facing issue in catalog search module. I am getting all store products when i search how i can fetch results on basis of store alloted category only.


texts: How can I add a Tab in sales_order, but not be selected by default?

texts:
I use the code below to add after order_info tab, but I want when I display the order details the active tab to be order_info.

<referenceBlock name="sales_order_tabs">
  <action method="addTabAfter">
    <argument name="name" xsi:type="string">name</argument>
    <argument name="block"xsi:type="string">VENDOR\MODULE\Block\Adminhtml\Order\View\Tab\Custom</argument>
    <argument name="after" xsi:type="string">order_info</argument>
  </action>
</referenceBlock>


texts: Magento 2 API: 3rd Party makes a post request to magento API with x-www-form-encoded data

texts:
I am trying to integrate a payment gateway with my headless magento 2 website.

So after the payment is processed/failed, the payment website makes a POST request to my API with x-www-form-encoded data, and it throws me the following error:

  {"message":"Server cannot understand Content-Type HTTP header media type application/x-www-form-urlencoded","trace":null}

I've tried using:

   $request_body = file_get_contents('php://input');

    $data = json_decode($request_body,true);

But this doesn't work either.

Normal form works, sending these params as JSON works too, but they are sending the params in x-www-form-encoded format, and we can't change that.

Please help!


texts: How to implement or extend product gallery widget

texts:
In template of module product-video. Widget productGallery called by data-mage-init attribute with template option pass through

<div id="<?php /* @escapeNotVerified */ echo $block->getHtmlId() ?>"
 class='gallery'
 data-mage-init='{"productGallery":{"template":"#<?php
 /* @escapeNotVerified */ echo $block->getHtmlId() ?>-template"}}'
 data-images="<?php /* @escapeNotVerified */ echo $block->escapeHtml($block->getImagesJson()) ?>"
 data-types="<?php /* @escapeNotVerified */ echo $block->escapeHtml(
     $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getImageTypes())
 ) ?>"
>
   CONTENT
</div>

My question is how to implement in right way to creat simple multiple upload images. Do i really need getImageTypes like original code. I don't want use all image type


texts: Custom module category multiselect option

texts:
I've created a module that has an option to select the categories which should have the module enabled to. For this I'm using a multiselect option and is created in my system.xml as follows:

<includecats>
  <label>Select categories</label>
  <frontend_type>multiselect</frontend_type>
  <source_model>admininfo/categories</source_model>
  <sort_order>30</sort_order>
  <show_in_default>1</show_in_default>
  <show_in_website>1</show_in_website>
  <show_in_store>1</show_in_store>
  <comment>Select categories you would like to include. Use Command + Click (Mac) or Ctrl + Click (Windows).</comment>
</includecats>

In "Model/Categories.php" I have included:

<?php
class Mymodule_admininfo_Model_Categories extends Mage_Core_Model_Abstract {

public function toOptionArray()
{
$categoriesArray = Mage::getModel('catalog/category')
    ->getCollection()
    ->addAttributeToSelect('name')
    ->addAttributeToSelect('url_path')
    ->addAttributeToSort('name', 'asc')
    ->addFieldToFilter('is_active', array('eq'=>'1'))
    ->load()
    ->toArray();

foreach ($categoriesArray as $categoryId => $category) {
    if (isset($category['name'])) {
        $categories[] = array(
            'value' => $categoryId,
            'label' => $category['name']
        );
    }
}

return $categories;
}
}

This all works like a charm. However in my module I get a list of all categories without any reference to its possible parent categories. This makes this list extremely hard to use since some categories used several times in the catalog. Without a reference to a parent or the actual id of the category it's pretty much unusable.

Current situation (example):

Shoes
Shoes
Shoes

Desired situation:

Men | Shoes
Women | Shoes
Childeren | Shoes

Or:

Shoes (9)
Shoes (10)
Shoes (11)


texts: Did i successfully pass the certification?

texts:
I just completed the certification exam (Magento developer plus) and no paper was given to me.
I am not sure if I have successfully passed the exam.

At the end of the test, there was a message “Congratulations! You have passed the Magento Developer plus certification”.
Please, what does it mean ? Success or not ? (the term “pass” is ambiguous in French).


texts: Redirect customer on same page instead of customer Dashboard

texts: I am using hide price extension, After login redirect customer on same page.


texts: Getting html content of an adminhtml template is empty

texts:
This is my code from my controller:

$block = $this->getLayout()
->createBlock('mynamespace_mymodule/adminhtml_pdf_invoice')
->setData('invoice', "mydata")
->setTemplate('mynamespace_mymodule/pdf/invoice.phtml');

This is my block content:

class Mynamespace_Mymodule_Myblock_Block_Adminhtml_Pdf_Invoice extends Mage_Core_Block_Template
{
//methods
}

I am trying to get the value of a template and put the content in a pdf file using the toHtml function. In my case:

$block->toHtml()

which is empty for some reason.

This is the path of my template:

.modman/Mynamespace_Mymodule/src/app/design/adminhtml/default/default/template/mynamespace_mymodule/pdf/invoice.phtml

My first thought was about the symlinks. There are enabled from system/configuration and the modman files are deployed.

Why the content of the toHtml function is empty ? What should I check more ?

Thx in advance !

[UPDATE]
I make a var_dump($block). and this is part of it:

...
["_allowSymlinks":protected]=>
  NULL
  ["_template":protected]=>
  string(29) "mynamespace_mymodule/pdf/invoice.phtml"
.....

I'm not sure why the allowSymlinks has the value NULL.