texts: I'm having trouble joining the customer_entity_varchar table to the sales_flat_order_grid table

texts:
A client wants a specific piece of data from the customer_entity_varchar table to display in place of the customer's last name in the Sales Order Grid. I'm trying to join the customer_entity_varchar table to the sales_flat_order_grid table, but have run into issues. I was able to successfully join the sales_flat_order_payment table to the sales_flat_order_grid table to display the PO Number in the grid; Presumably due to the similar nature of the tables. Here's the join I initially tried from the Mage_Adminhtml_Block_Sales_Order_Grid class. And yes, I know not to modify core files. I just wanted to make sure the code was right before extending the framework. :)

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $resource = Mage::getSingleton('core/resource');
    $collection->getSelect()->join('customer_entity_varchar', 'main_table.customer_id = customer_entity_varchar.entity_id', array('value'));
    $this->setCollection($collection);
    return parent::_prepareCollection();
}


texts: Make Description tab by default active on product pages in magento 2.3.3

texts:
On product pages, by default specification tab is active. How can i make the first tab i.e Description tab active by default.
See https://5iallk0uwem1coeq.mojostratus.io/fabrics/zorb/zorb-original/zorb-silver.html page for reference
See https://prnt.sc/vbkov0


texts: After updating to Magento 2.3.2 checkout page throws error

texts:
After I update Magento version from 2.3.0 to 2.3.2 on checkout page I got knockout errors on my console and payments, product items do not show on-page. Before update, it works well.

    Uncaught ReferenceError: Unable to process binding "visible: function(){return isVisible() }"
Message: isVisible is not defined
    at visible (eval at createBindingsStringEvaluator (knockout.js:2992), <anonymous>:3:60)
    at update (knockout.js:4971)
    at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3383)
    at Function.evaluateImmediate_CallReadThenEndDependencyDetection (knockout.js:2183)
    at Function.evaluateImmediate_CallReadWithDependencyDetection (knockout.js:2150)
    at Function.evaluateImmediate (knockout.js:2111)
    at Object.ko.computed.ko.dependentObservable (knockout.js:1964)
    at knockout.js:3381
    at Object.arrayForEach (knockout.js:159)
    at applyBindingsToNodeInternal (knockout.js:3353)

and

Uncaught ReferenceError: Unable to process binding "template: function(){return detailsTemplate }"
Message: detailsTemplate is not defined
    at template (eval at createBindingsStringEvaluator (knockout.js:2992), <anonymous>:3:61)
    at init (knockout.js:5464)
    at knockout.js:3368
    at Object.ignore (knockout.js:1480)
    at knockout.js:3367
    at Object.arrayForEach (knockout.js:159)
    at applyBindingsToNodeInternal (knockout.js:3353)
    at applyBindingsToNodeAndDescendantsInternal (knockout.js:3233)
    at applyBindingsToDescendantsInternal (knockout.js:3215)
    at applyBindingsToNodeAndDescendantsInternal (knockout.js:3242)


texts: Magento 2 knockout template rendering via getTemplate

texts:
I have been checking out M2's frontend structure and I stumbled in some knockoutjs's template binding, for example in Magento/Checkout/view/frontend/web/template/shipping-address/form.html(this file render the add new address popup form in Shipping page of checkout), we got:

<form class="form form-shipping-address" id="co-shipping-form" data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">

        <input type="checkbox" class="checkbox" id="shipping-save-in-address-book" data-bind="checked: saveInAddressBook" />

I understand the checkbox part, but not the . I tried deleting one of those and the popup is empty. What is getTemplate() exactly and where can I find the piece of code that it references to?


texts: Magento2 add multiple buttons in single slide

texts:
How to add multiple buttons in single slide? We have followed below link for the same
https://docs.magento.com/user-guide/cms/page-builder-media-slider.html#slide-links-and-buttons
From the above link there is section like "Slide links and buttons" and from there is below section like
Method 2: Multiple links or buttons
Can you please explain how can we Add a block placeholder to the slide stage? We have tried it but it is adding into all slides of the slider not for perticular slide.


texts: Magento 2.5 show out of stock products at the end of the catalog

texts:
I want to display out of stock products at the end of the category page of Magento 2.5.
I add this code:

vendor/magento/module-catalog/Block/Product/ListProduct.php

$collection = $layer->getProductCollection();

$this->_productCollection->getSelect()->order('is_salable DESC');

But shows error:

  Fatal error: Uncaught Error: Call to a member function getSelect() on null


texts:
In magento 2 (checkout) I need to hide and show some fields.
<div class="field" data-bind="visible: visible, attr: {'name': element.dataScope}, css: additionalClasses" name="shippingAddress.custom_attributes.codice_fiscale">

<style>
.nascondi {
display:none;
}
</style>

<script type="text/javascript">
    require(['jquery'], function($){
        $(document).ready(function(){
        $('div[name="shippingAddress.custom_attributes.codice_fiscale"]').addClass('nascondi');
            alert("test di lettura jquery");

        });
    });
</script>

But not work.
Alert function work (there is not an error) but the field div[name="shippingAddress.custom_attributes.codice_fiscale"] still visible.
Why? where is the error?
Thanks


texts: Uncaught Error: Script error for: tinymce in Magento 2 Admin backend

texts:
I am facing this error in the admin panel. Due to this error my admin panel menus such as order, customers are not loading. It loading forever. Kindly help me to solve this issue.

Uncaught Error: Script error for: tinymce
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:166)
at HTMLScriptElement.onScriptError (require.js:1681)


texts: Product image upload button not shown in magento 1.9

texts: I am working on magento 1.9 but product image upload button not shown up, i solved that issue by changing upload_max_filesize=100M but after one day when i run it then the image upload button is not there.


texts: i want change language according to access point

texts: hi i want to change language according to country visitors means if any user access my website in us than price show in dollar and another access in india than price shows in INR. please help me how can i do


texts: Paypal payment pro PayPal express order not sending confirmation email in Magento

texts:
I have a very long standing issue with PayPal Payments Pro in magento. If a customer places an order using PayPal express they don't receive the order email. If a customer pays with card they get it with no problems.

I have spent a lot of time investigating this with no joy at all. I am wondering if other people have had the same issue and if anyone has managed to solve it. I am running magento community 1.9.2.

The IPN seems to be working properly, and there are no orders in the email que.

Any help would be gratefully appreciated.


texts: Is Re-indexing possible from admin in mangeto2, if yes, please explain how

texts: I have no ssh access, so I want re-indexing from my admin panel in magento 2. Is this possible to re-index data from admin panel in Magento 2?


texts: Creating a module with custom database table, cannot save

texts:
I have developed a custom module that also has a custom database table.
However, I cannot insert records since I am presented with the following error:

Fatal error: Call to a member function beginTransaction() on boolean in /httpdocs/includes/src/__default.php on line 6105

Here is the code that I am trying:

$data = array(
          'voucher'     => 'voucher',
          'customer_name' => 'customer_name',
          'order'           => 'order',
          'value'           => 'value',
          'status'      => 1,
          'date'            => '',
        );
$model = Mage::getModel('antikatavoles/antikatavoles')->setData($data);

And this is my config file:

<?xml version="1.0" ?>
<config>

<modules>
    <ID_Antikatavoles>
        <version>0.1.0</version>
    </ID_Antikatavoles>
</modules>

<frontend>
    <routers>
        <antikatavoles>
            <use>standard</use>
            <args>
                <module>ID_Antikatavoles</module>
                <frontName>antikatavoles</frontName>
            </args>
        </antikatavoles>
    </routers>
</frontend>
<global>
    <models>
        <antikatavoles>
            <class>ID_Antikatavoles_Model</class>
            <resourceModel>antikatavoles_mysql4</resourceModel>
        </antikatavoles>
        <antikatavoles_mysql4>
            <class>ID_Antikatavoles_Model_Mysql4</class>
            <entities>
                <antikatavoles>

antikatavoles

                </antikatavoles>
            </entities>
        </antikatavoles_mysql4>
    </models>
    <resources>
        <antikatavoles_setup>
            <setup>
                <module>ID_Antikatavoles</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </antikatavoles_setup>
        <antikatavoles_write>
            <connection>
                <use>core_write</use>
            </connection>
        </antikatavoles_write>
        <antikatavoles_read>
            <connection>
                <use>core_read</use>
            </connection>
        </antikatavoles_read>
    </resources>
    <helpers>
        <antikatavoles>
            <class>ID_Antikatavoles_Helper</class>
        </antikatavoles>
    </helpers>
</global>

</config>

Can anyone help me figure this one out?

thanks!


texts: No stock decrease at order if certain conditions are met

texts:
I'm developing some functionality using events, observers to determine if certain conditions for an order are met. If not, the user is redirected back to the cart screen with a message.

The conditions are that the first order must be at least 500 and the user must be in a certain customer group. This works fine. Now when i click the order button, stock gets decreased but no order is made. I'm trying to find a way to have this stock decrease not happen.

I'm using an observer on the following event:

  "sales_model_service_quote_submit_before"

The observer sits in a custom module. I was trying to find an event "before" stock decrease but i couldn't find it. I'm happy if you provide me with the right event, also with a solution to this stock decrease. I'll show you some of my code:

part of config.xml

<frontend>
    <events>
        <sales_model_service_quote_submit_before>
            <observers>
                <company_firstorder>
                    <type>singleton</type>
                    <class>COMPANY_FirstOrder_Model_Observer</class>
                    <method>firstOrder</method>
                </company_firstorder>
            </observers>
        </sales_model_service_quote_submit_before>
    </events>
</frontend>

Part of my observer.php

        if ($isActive){
        if ($customer->isLoggedIn() && $customerGroupId === $currentCustomerGroupId){
            if ($ordersCount < 1){
                if ($orderGrandTotal < $minimumOrderAmount){

                    // Here, something should happen that fixes my stock decrease problem
                    Mage::getSingleton('checkout/session')->addNotice('Custom error notice - To Do: Add field in backend for this notice');
                    Mage::app()->getResponse()->setRedirect(Mage::getUrl('checkout/cart'))->sendResponse();
                    exit;
                }
            }
        }
    }

I have been stuck on this issue the whole day so any help is greatly appreciated :)

P.s. There is a post about programatically increasing the stock but this is not a good solution to my problem. I checked loads of stack posts before writing this one.

EDIT
Due to complexity i used a different approach. I'm performing these checks now on the checkout page. This will hide/show my checkout button and display a message. This alternative works for me. Case closed


texts: Is there a way of adding promotion information to the basket?

texts:
I've starting creating various promotions, which are all working fine.

I will be adding information about the special offer to the product listing.
However, I would like to tell the customers about the special offers at the cart stage, which will read the contents of the cart and highlight the appropriate offer/s.
ie: "Buy One More Banana For Only £1"

Is there a way of doing this?


texts: Grouped Product getAssociatedProducts() is not working in attributes tab template

texts:
In the main view template for my grouped products, grouped.phtml, I have had no problems fetching the associated products and displaying some attributes in a loop.

I have done the same thing in a custom version of the attributes.phtml sub-template used to display attributes, and there, the code returns NULL.

<body>
    <attribute name="class" value="page-product-grouped"/>
    <referenceContainer name="product.info.form.content">
        <block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="Magento_GroupedProduct::product/view/type/grouped.phtml"/>
        <container name="product.info.grouped.extra" after="product.info.grouped" before="product.info.grouped" as="product_type_data_extra" label="Product Extra Info"/>
    </referenceContainer>
    (...)
    <referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="Magento_GroupedProduct::product/view/type/grouped/attributes.phtml" group="detailed_info">
            <arguments>
                <argument translate="true" name="title" xsi:type="string">More Information</argument>
                <argument name="sort_order" xsi:type="string">27</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

I am assuming that the reason is because the second block is of class="Magento\Catalog\Block\Product\View\Attributes" but obviously if I change it to Magento\GroupedProduct\Block\Product\View\Type\Grouped then the attribute functionality disappears so I am not better off.

There has to be a way to "cross load" the Grouped functionality into the Attributes block (or vice versa) OR I must use something other than $block for the grouped loading code:

$_product = $block->getProduct();
$_associatedProducts = $block->getAssociatedProducts();

but what?


texts: order_new.html email template by payment method

texts:
I try to modify some text in the order_new.html if the customer pay by a custom payment method.

For example, if he pay with 'tati' payment method, I want to remove a sentence of the mail template.

Can I do that, I try to add conditions on the template but it doesn't work..

Thanks.


texts: How to add count down hide all message in magento 2

texts: I want to hide the message displayed in magento 2, after doing actions like add to cart, login, add wishlist, compare, error info, ... anyone have a good idea for my question? . Thanks everyone


texts: How can i override the luma theme category page stylings in new custom theme?

texts:
We have to override the luma theme stylings of the category page,we have applied pearl theme on top of it.And we are extending same for custom child theme.

How can i override the default luma css for it?


texts: Configurable product with image swatch only on product page

texts:
Is it possible to show image swatches only on product page, and on category pages, related, upsell sliders to stay default color swatches.
By default magento configuration its colors or image swatches everywhere.


texts: How to get Order Status from order id in magento 2?

texts:
I'm creating a custom module for order tracking in which i'm  accepting order id from customer and using the order id i want to display the status of particular order.

Now I'm not getting the order status where it gets store.

I want the status of order using order id in frontend. Is there any way to get status of order in magento 2.

this is my controller where I get order id

<?php
namespace Codazon\AjaxCartPro\Controller\Customer;
class Trackorder extends \Magento\Framework\App\Action\Action {

    protected $resultPageFactory;
    protected $request;

    /**
     * Constructor
     *
     * @param \Magento\Framework\App\Action\Context  $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
    \Magento\Framework\App\Request\Http $request,
    \Magento\Framework\Registry $coreRegistry
    )
    {
    $this->_coreRegistry = $coreRegistry;
    $this->request = $request;
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    /**
     * Execute view action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
    $orderid = $this->request->getParam('orderID'); // all params
    $this->registry->register('order_status', $orderStatus);
    return $this->resultPageFactory->create();
    }
}

I need whole process after this.


texts: Third language should have own configuration

texts:
Today my store support two different languages. Where the root domain is English and /no is Norwegian. They both share the same prices with NOK being the base currency.

However we are about to add a third language. For SEO purposes we need the domain to remain intact and just add a sub folder like the Norwegian purpose. However the third language need to have its own base price, cost, tax settings and more.

Is this possible and if so, how do I create the third language to be "independent".


texts:
With the help of this documentation http://info2.magento.com/rs/magentosoftware/images/Installing-a-Patch-for-Magento-Community-Edition.pdf

i tried to patch on my magento site. but it gives me error as follows

  [~/public_html/my_proj]# sh PATCH_SUPEE-7405_CE_1.9.2.3_v1.1-2016-02-23-07-46-32.sh
    Checking if patch can be applied/reverted successfully...
    ERROR: Patch can't be applied/reverted successfully.

    patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file app/code/core/Mage/Adminhtml/Helper/Sales.php.rej

    patching file app/code/core/Mage/Core/Model/Config.php
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file app/code/core/Mage/Core/Model/Config.php.rej

    patching file app/code/core/Mage/Sales/Model/Quote/Item.php
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    1 out of 1 hunk ignored -- saving rejects to file app/code/core/Mage/Sales/Model/Quote/Item.php.rej

    patching file lib/Varien/File/Uploader.php
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n]
    Skipping patch.
    2 out of 2 hunks ignored -- saving rejects to file lib/Varien/File/Uploader.php.rej


texts: Getting : Fatal error: Call to a member function toHtml() after rewriting a class

texts:
This is my xml:

<blocks>
    <mynamespace_mymodule>
         <class>Mynamespace_Mymodule_Block</class>
    </mynamespace_mymodule>
    <adminhtml>
         <rewrite><catalog_product_composite_configure>Mynamespace_Mymodule_Block_Catalog_Product_Composite_Configure</catalog_product_composite_configure>
            </rewrite>
     </adminhtml>
</blocks>

This is my block content:

class Mynamespace_Mymodule_Adminhtml_Block_Catalog_Product_Composite_Configure extends Mage_Adminhtml_Block_Catalog_Product_Composite_Configure
{

    protected function _construct()
    {
        parent::__construct();
echo 1; exit();
//        $this->setTemplate('mynamespace_mymodule/catalog/product/composite/reset.phtml');
    }

}

I am getting this error message:

Fatal error: Call to a member function toHtml() on boolean in ..... /app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php on line 105

Any idea what did I do wrong ? thx


texts: Problems re-indexing Category Products and Products Categories in Magento 2.3

texts:
We are facing the Reindex for the Category Products and Product Categories and we are getting the following error while reindexing through SSH (php bin/magento indexer:reindex)

Category Products indexer process unknown error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-5' for key 'PRIMARY', query was: INSERT  INTO `temp_catalog_category_tree_index_6be8e2c1` (`parent_id`,`child_id`) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?)

Product Categories indexer process unknown error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-5' for key 'PRIMARY', query was: INSERT  INTO `temp_catalog_category_tree_index_83868f3d` (`parent_id`,`child_id`) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?)

[root@server public_html]# php bin/magento indexer:status
+-----------------------------+------------------+-----------+-----------------+------------------+
| Title                       | Status           | Update On | Schedule Status | Schedule Updated |
+-----------------------------+------------------+-----------+-----------------+------------------+
| Catalog Product Rule        | Ready            | Save      |                 |                  |
| Catalog Rule Product        | Ready            | Save      |                 |                  |
| Catalog Search              | Ready            | Save      |                 |                  |
| Category Products           | Reindex required | Save      |                 |                  |
| Customer Grid               | Ready            | Save      |                 |                  |
| Design Config Grid          | Ready            | Save      |                 |                  |
| Google Product Feed         | Ready            | Save      |                 |                  |
| Google Product Removal Feed | Ready            | Save      |                 |                  |
| Inventory                   | Ready            | Save      |                 |                  |
| Product Categories          | Reindex required | Save      |                 |                  |
| Product EAV                 | Ready            | Save      |                 |                  |
| Product Price               | Ready            | Save      |                 |                  |
| Stock                       | Ready            | Save      |                 |                  |
+-----------------------------+------------------+-----------+-----------------+------------------+

Please kindly help us.


texts:
How do I change the default by which the products are listed in the catalog? I tried from the Admin Panel but didn't work. The current default is by "Product Name" but now I want to set my own sorting option.
The new sorting option is in place (coded), it's only that I don't know how to set it as the default.
Thanks.
EDIT:
List of options in the Admin Panel

List of options in the catalog:


texts: Magento 2.3 Unable to inject classes in __construct in Magento/Ups/Model/Carrier.php

texts:
I have overridden the Magento/Ups/Model/Carrier.php to Custom/Module/Model/Carrier.php successfully.
I need a cart quote from it, so I have inject the class in constructor.

When I add to cart a product and go to cart page the error:

  Type Error occurred when creating object: Custom\Module\Model\Carrier, Argument 16 passed to Magento\Ups\Model\Carrier::__construct() must implement interface Magento\Framework\Locale\FormatInterface, array given, called in /var/www/html/xxx/app/code/Custom/Module/Model/Carrier.php on line 56

Adding the __construct() doesn't work in my custom module.

Custom/Module/Model/Carrier.php

<?php
namespace Custom\Module\Model;

use Magento\Quote\Model\Quote\Address\RateResult\Error;
use Magento\Quote\Model\Quote\Address\RateRequest;
use Magento\Shipping\Model\Carrier\AbstractCarrierOnline;
use Magento\Shipping\Model\Carrier\CarrierInterface;
use Magento\Shipping\Model\Rate\Result;
use Magento\Shipping\Model\Simplexml\Element;
use Magento\Ups\Helper\Config;
use Magento\Framework\Xml\Security;

class Carrier extends \Magento\Ups\Model\Carrier
{
    protected $_cart;

    public function __construct(
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory
    $rateErrorFactory,
    \Psr\Log\LoggerInterface $logger,
    Security $xmlSecurity,
    \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory,
    \Magento\Shipping\Model\Rate\ResultFactory $rateFactory,
    \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory
    $rateMethodFactory,
    \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory,
    \Magento\Shipping\Model\Tracking\Result\ErrorFactory
     $trackErrorFactory,
    \Magento\Shipping\Model\Tracking\Result\StatusFactory
    $trackStatusFactory,
    \Magento\Directory\Model\RegionFactory $regionFactory,
    \Magento\Directory\Model\CountryFactory $countryFactory,
    \Magento\Directory\Model\CurrencyFactory $currencyFactory,
    \Magento\Directory\Helper\Data $directoryData,
    \Magento\CatalogInventory\Api\StockRegistryInterface
       $stockRegistry,
    \Magento\Framework\Locale\FormatInterface $localeFormat,
    array $data = [],
    \Magento\Checkout\Model\Cart $cart
    )
    {
    $this->_cart = $cart;
    parent::__construct(
        $scopeConfig,
        $rateErrorFactory,
        $logger,
        $xmlSecurity,
        $xmlElFactory,
        $rateFactory,
        $rateMethodFactory,
        $trackFactory,
        $trackErrorFactory,
        $trackStatusFactory,
        $regionFactory,
        $countryFactory,
        $currencyFactory,
        $directoryData,
        $stockRegistry,
        $data
    );
    $this->_localeFormat = $localeFormat;
    }

    protected function _parseCgiResponse($response)
    {
    //my custom logic goes here
    //get cart quote here
    return $result;
    }
}


texts: How to show Products on carousel as like as images?

texts:
Am using slick carousel,showing images on carousel like these

    ...

and calling my-class on custom.js,Am showing Recently viewd products,cross-sell,up-sell on carousels.All works fine.

How to show products with add-to-cart btn in carousel? Is these possible?

How to mark up Html for calling particular Product-ids to be shown on carousel?

Note : I spent more time on searching solution to my problem,But unfortunately no hints from our magento.stackexchange & Google.
Any ideas pls!!


texts: wyomind install vendor folder in magento 2.3

texts:
How to Install Wyomind Elastic Search on vendor folder in magento 2.3 composer thorw
please advance thanks for help


texts: How to trace the magento2 modules more efficiently?

texts:
Without any background knowledge of Magento 1.x, I'm currently studying Magento 2 modules and after following quite some tutorials & docs, I now understand the basics. But when it comes to creating my own module that adds some behaviors to the existing system, it really gives me a hard time.

For example, I wanted to add a fee in proportion to the item quantity per order. I knew it has something to do with Magento_Checkout, Magento_Sales, Magento_Quote, but I can hardly tell which class I should extend or which method in those classes actually do the trick.

Eventually I found an working example in this thread and modified a bit:

namespace My\Module\Model\Total;

class Fee extends \Magento\Quote\Model\Quote\Address\Total\AbstractTotal
{
    ...

    public function collect(
        \Magento\Quote\Model\Quote $quote,
        \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment,
        \Magento\Quote\Model\Quote\Address\Total $total
    ) {
        ...

        $fee = $quote->getItemsQty() * 10;

        $total->setTotalAmount('fee', $fee);
        $total->setBaseTotalAmount('fee', $fee);

        $total->setFee($fee);
        $total->setBaseFee($fee);

        $total->setGrandTotal($total->getGrandTotal() + $fee);
        $total->setBaseGrandTotal($total->getBaseGrandTotal() + $fee);
        ...
    }
    ...
}

and of course some other parts like XMLs, layouts, templates... etc.

But the point is, I feel like I could never reach this solution on my own.
The codebase is dauntingly huge that I couldn't find that the 'collect' and 'fetch' method in AbstractTotal is what I need if not for the answered thread.

I wonder if there is a recommended way of tracing the relations between modules. More specifically, when performing a task such as the above, in what order, depth-first or breadth-first, should I analyze the required modules? An example like "I start out reading the xml first then the layout systems..." would be nice.

Hope this topic isn't too vague to answer, thanks for any help.


texts:
I cannot found function to override (and relative core magento file) for edit total invoice coupon discount
I need to print discount value vat excluded


texts: How to Image resize this container in product page - Magento 2.3

texts:
In the product page i need to resize the product image container but i can't how to resize this, Please check the image for reference

The below image shown with big gap between the image and border

The result i need


texts: configurable product not allowing add to cart with only custom option selected

texts:
This is driving me crazy! All the products on my site are configurable products they all have 1 or more associated simple products attached to them they all also have a custom option check-box.

My issue is that my system will not allow add to cart when only the product option is selected it keeps saying please select from the associated products.

How do I make my system so that it will allow add the product to the cart with only the custom option selected?

I really appreciate any help with this issue I am going round in circles.

Thanks!!


texts: How do i implement import functionality in my custom module in admin area?

texts:
I have created my custom module in admin area with basic CRUD operations and now all I need is to place import functionality where I have a simple table, no EAV tables here.

Let me know if there is any way to do this or any reference in the core modules.

Any help would be appreciated. Thanks :)


texts: After forcing www, admin AJAX not working

texts:
I recently migrate my server from Apache to Nginx and followed this article to write the config file.

I use this piece of code to force www before all urls:

server {
  listen 80;
  server_name example.com;
  rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
}

But now in admin panel, I have this error:

XMLHttpRequest cannot load http://example.com/index.php/admin/catalog_category/edit/key/710d9916b160c08e3560406812eb3bf3/?SID=kovh5h4r7etpl0v7cn61t6dil3&isAjax=true. The request was redirected to 'http://www.example.com/index.php/admin/catalog_category/edit/key/710d9916b…r7etpl0v7cn61t6dil3&isAjax=true?SID=kovh5h4r7etpl0v7cn61t6dil3&isAjax=true', which is disallowed for cross-origin requests that require preflight.

How could I fix this problem? Thanks.


texts: magento 2 does not use all ram of my system

texts:
I set PHP memory_limit to -1 and when I want to use di:compile command it is very slow. sometimes it needs over 4 min for a `di:compile'.
my laptop ram is 32G and hard is SSD.
already I use Linux (Ubuntu) and now, I use win 10.
is it a global problem or it is just for me?


texts: Adding Minicart to custom header results in a empty cart in magento 2

texts:
I tried adding the mini cart phtml to my header like this

<?php  echo  $this->getLayout()->createBlock('Magento\Checkout\Block\Cart\Sidebar')->setTemplate('Magento_Checkout::cart/minicart.phtml')->toHtml(); ?>

And the icon appears but the cart appears empty while there most certainly is something added in the cart.

my best guess is that I need to add some javascript file to show the information. would anybody know what to add to make it work?


texts: Magento 2: best practice cache management

texts:
I just installed Magento 2 and noticed that the caches are all disabled by default. Should I enabled them or leave them disabled? Does it make any different?

Thank you in advance.


texts: Email functionality is not working in magento 1.9

texts:
I tried lot of options in last two days but none of them is working for me:

I was having google apps account on my primary domain and it was not working so I tried SMTP pro somehow but that also has not worked. So I uninstalled the same and tried to have email hosting on my subdomain (where Magento is installed). So my email looks like support@shop.xxxx.in and it is same server where hosting is. Hoping it would serve the purpose, but it is not.

So I thought cronjob might be the problem so I configured the same in my cpanel for every five min. however, it was there in magento already.

I also tried to send forgot password email if it works but it didn't. So I understand it is something configuration related, now I have this from exception log:

2016-10-14T17:54:14+00:00 ERR (3):
exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /home/trishstm/public_html/shop/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace:
#0 /home/trishstm/public_html/shop/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /home/trishstm/public_html/shop/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /home/trishstm/public_html/shop/app/code/core/Mage/Core/Model/Email/Template.php(455): Zend_Mail->send()
#3 /home/trishstm/public_html/shop/app/code/core/Mage/Core/Model/Email/Template.php(507): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#4 /home/trishstm/public_html/shop/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(79): Mage_Core_Model_Email_Template->sendTransactional('customer_passwo...', 'support', Array, Array, Array, '1')
#5 /home/trishstm/public_html/shop/app/code/core/Mage/Customer/Model/Customer.php(676): Mage_Core_Model_Email_Template_Mailer->send()
#6 /home/trishstm/public_html/shop/app/code/core/Mage/Customer/Model/Customer.php(693): Mage_Customer_Model_Customer->_sendEmailTemplate('customer/passwo...', 'customer/passwo...', Array, '1')
#7 /home/trishstm/public_html/shop/app/code/core/Mage/Customer/controllers/AccountController.php(715): Mage_Customer_Model_Customer->sendPasswordResetConfirmationEmail()
#8 /home/trishstm/public_html/shop/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Customer_AccountController->forgotPasswordPostAction()
#9 /home/trishstm/public_html/shop/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('forgotpasswordp...')
#10 /home/trishstm/public_html/shop/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /home/trishstm/public_html/shop/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#12 /home/trishstm/public_html/shop/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /home/trishstm/public_html/shop/index.php(87): Mage::run('', 'store')
#14 {main}

But completely unable to understand where the problem is. Is there any workaround for this?


texts:
Hi i am trying to integrate third party library in magento. I put it the folder in lib  and my path is lib/surange/abrahim. the autoload sits inside surange. I made an observer inside custom model. the code is below

<?php
class Rkt_CustomBlock_Model_Observer
{
/**
 * @param Varien_Event_Observer $event
 */
public function controllerFrontInitBefore(Varien_Event_Observer $event)
{
    self::init();
}

static function init()
{
    // Add our vendor folder to our include path
    set_include_path(get_include_path() . PATH_SEPARATOR . Mage::getBaseDir('lib') . '/suranga');

    require_once(Mage::getBaseDir('lib') . '/suranga/autoload.php');

}

}

Few things I need to know. How do i access my library from web browser. for example like this localhost/magento/index/twitter. Second which other file do i need to modify for it? my observer have all the paths to the module.
any help is appreciated as I am new to magento. My library name is abrahim/twitterAutho


texts: Add custom to field to CMS page based on template in Magento 2

texts:
I have several custom fields I added to my CMS pages but I only want them to show up on the backend if the admin user selects a specific template. For example, the text field "doctor name" would only show after "doctor" template was selected under layout->Design
New fields are added through the cms_page_form.xml and InstallSchema.php


texts: Develop on Localhost VS Hosting Provider

texts:
I tried to work with Magento on Localhost, but is extremely slow. I tried everything i found on forums in order to make it faster but nothing really changed. My PC is i7, 8GB RAM, HHD on windows.

After i couldnt make it faster on localhost, i tried to setup Magento on a hosting provider server and the results were very very better. But it was a promotion package, i paid for the hosting about 10$ for the first month, but after the first month hosting price went 30$ per month so i don't think its so clever to pay 30$ per month in order to develop a website, because now i just need to develop the website, i don't need visitors, bandwidth etc. I will need about 4-5 months for development.

I am thinking to buying an SSD and setup Magento on localhost again. But iam confused because i cant be sure if SSD make it work faster.

So i have 2 options and i ask for your opinions:

Give 40$ for an SSD and work on localhost
Buy a cheap hosting server on about 10$ per month. After development
i will swich to a good hosting.

What do you think?


texts:
I have set $40 as flat shipping and I want that if anyone purchase above or equal $50 then the flat shipping become 0. So I am setting this rule for the purpose:

If ALL  of these conditions are TRUE :
Subtotal  equals or greater than  50

and for action:

But there is a strange issue:

Case 1: If I buy 1 product of $25 then there is shipping of $40 (Correct)

Case 2: If I buy 3 * 25 then subtotal is $75 and shipping is 0 (Correct)

Case 3: If I buy 1 product of $80 then the subtotal is displaying as $40 and free shipping too(Incorrect)

So I want to correct the result of Case 3 that price should be remain $80 but the shipping should be free only. Please help to get this. Thank you


texts: I have installed magento 2.3.3 with sample data. dashboard page is not loading. please suggest the solution


texts: How to empty the shopping cart when a customer logs in?

texts: I would like to do this in Magento 1.9. Can it be done?


texts:
I have a restaurant store and  want to add extra options on each product that ihave in my store.

For example, I have product: http://store.hbros.co.uk/guacamole-falafel-salad.html

And I want to add these extras: jalapeños or sundries tomatoes.

But rather than doing this product by product, I wonder if I can make this on all products.


texts: Error when trying to ban url with Varnish Cache

texts:
I've updated the EcomDev_Varnish module to it's latest version and it seems I've gotten everything properly running, but as a test I tried following command: php ecomdev-varnish.php cache:ban -v b2b_int/customer/account/login/ from the /var/www/src/shell directory and it give the following error:

PHP Fatal error:  Class 'ride\library\varnish\VarnishPool' not found in /var/www/src/app/code/community/EcomDev/Varnish/Model/Connector.php on line 76
PHP Stack trace:
PHP   1. {main}() /var/www/src/shell/ecomdev-varnish.php:0
PHP   2. EcomDev_Varnish_Shell->run() /var/www/src/shell/ecomdev-varnish.php:238
PHP   3. EcomDev_Varnish_Shell->runCacheBan() /var/www/src/shell/ecomdev-varnish.php:136
PHP   4. EcomDev_Varnish_Model_Connector->getVarnishPool() /var/www/src/shell/ecomdev-varnish.php:208
PHP   5. EcomDev_Varnish_Model_Connector->_initVarnishPool() /var/www/src/app/code/community/EcomDev/Varnish/Model/Connector.php:62

The file in question is: /src/app/code/community/EcomDev/Varnish/Model/Connector.php (I have not edited any of the files).

The line in question is:
$this->pool = new VarnishPool(); (protected function _initVarnishPool).

I've tried to edit this line to ... = new ride\library\varnish\VarnishPool();, as I've found in answers to similar questions, also no succes (I've done this without the () at the end, but no difference).

Has anyone come across this before or knows how to fix this? Maybe I've done something wrong during installation/update, but this, however possible, seems unlikely since everything else appears to work.

Many thanks


texts: Change position of elements/uiComponents in Magento 2 checkout depending on screen size

texts:
I have 2 html elements on my checkout for which I need to change the position on the page, depending on whether it's being displayed on mobile device or desktop.
I cannot solve this using css only because it would require a lot of aboslute positioning which would be messy.
I also cannot have the elements on the page twice, one for mobile one for desktop and show/hide via breakpoint. The elements contain too much code which would be duplicate, and are also linked to a lot of js which would have to run twice.
So my approach is to have some js move the element depending on $(window).width (don't know if that's the correct width to check but that's not the problem for now)
So I added this to onepage.phtml
<script type="text/javascript">
    require(['jquery', 'checkoutjs'], function($, checkoutLoadAfter) {
        checkoutLoadAfter();
    });
</script>

And this is in Magento_Checkout\web\js\checkoutjs.js
define(['jquery'], function($){
    "use strict";
    return function checkoutLoadAfter()
    {
        $(document).ready(function() {
            console.log($(window).width());
            if ($(window).width() >= 786) {
                console.log("yo");
                $('.opc-benefits-wrapper').appendTo('#opc-sidebar');
            }
        });
    }
});

Of course this does not work because all the checkout elements are added via jsLayout themselves and my script seems to run before that so there are no elements to move on the page.
How Can I change the position of my elements based on screen width?
Assuming the elements are either uiCOmponents or could be changed to be uiComponents could I have some sort of if/else screen width checking in my jsLayout or within the html templates that are calling the knockout templates?
Or can my code be changed to load after the rest of the jsLayout script?


texts: Flat Rate  ==>Type ==> Per Order Option not working price change when add more than one product magento 2.2.3 both Main Website & Default Config store view .


texts: How to get a value from a running action?

texts:
I have a case looks like this:
Here is my controller code:

//example controller:

public function runAction() {
    // a example code that run a long time
    $count = 0;
    while (true) {
        $count = $count + 1;
        Mage::register('testcount', $count);
        sleep(3);
    }

}

public function viewAction() {
    echo Mage::registry("testcount");
}

I want to view $count while "runAction" is running by using viewAction. But the viewAction loads forever. Any solution for me?


texts: How to create user for special website level magento2?

texts:
Is there an option to create a user for a particular website when there is several website and store ?
Thanks


texts: Magento 2 how to restrict add wish list a product

texts:
I would like to stop adding products to the wishlist based on the product attribute how to do that? I would like to use the plugin concept instead of overriding the entire controller file.
Magento\Wishlist\Controller\Index\Add.
But I unable to stop redirecting to a wishlist page after satisfied my condition. Please review and let me know how to do that?

app/code/Vendor/Wishlist/etc/di.xml

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
       <type name="Magento\Wishlist\Controller\Index\Add">
           <plugin name="AddWishlistRestriction" type="Vendor\Wishlist\Plugin\AddWishlist" sortOrder="10" disabled="false"/>
       </type>
    </config>

app/code/Vendor/Wishlist/Plugin/AddWishlist.php

    public function __construct(
        \Magento\Framework\Message\ManagerInterface $messageManager,
        \Magento\Framework\App\Response\RedirectInterface $redirect,
        dataHelper $dataHelper,
        \Magento\Framework\App\Action\Context $context,
        ProductRepositoryInterface $productRepository

    ) {
        $this->dataHelper         = $dataHelper;
        $this->messageManager     = $messageManager;
        $this->redirect           = $redirect;
        $this->productRepository  = $productRepository;
        $this->resultRedirectFactory = $context->getResultRedirectFactory();
        $this->request = $context->getRequest();

    }

    /**
     * Plugin for restrict wishlist
    */
    public function beforeExecute(\Magento\Wishlist\Controller\Index\Add $subject)
    {
        echo "before execute method is calling".
    }
}


texts: How to use custom navigation menu instead of categories menu

texts: As per my requirement in current project i need to place custom menu which should have general pages as menu items like Home,About Us etc but in basically we get categories as nav-menu in magento so how to do this.


texts: How to add stock alert notification when for items on the wishlist?

texts: I want to add product alert notification when the product is out of stock on the Magento wishlist page, For this task, I need product ID how we get out of stock product ID?


texts: Show/Hide dependent attribute field on toggle attribute field of product add/edit admin form into Magenot 2

texts: As per the requirement, I have created 2 product attribute into magento 2 admin. First attribute is toggle(Yes/No) attribute and Second is Text attribute which is dependent on First attribute. Now I have to Show/Hide Text attribute based on Toggle attribute value into product admin form.


texts: How do I put shopping cart and checkout in the same page? I don't want any extensions. I want to do it in XML, but I don't how to do it.


texts:
I'm trying to work out a way of embedding attributes in other attributes, e.g. name or description in Magento 2.3

As an example

static product name - Blue T-Shirt Size Large

dynamic - {colour_attribute} T-Shirt Size {size_attribute}

{colour_attribute} and {size_attribute} would be separate M2 attributes

I'm not sure it's possible and I can't find a module to do it and I wondered if anyone has tried this?

Hope that makes sense.


texts:
I'm trying to add a simple shipping and handling fee apply when the customer chooses to ship to different address in onepage checkout. It does add the simple product to cart but it refreshes the page forcing the user to start over instead of progressing to the shipping information step. How can I add to the cart but progress to the next step?

<?php $_product = Mage::getModel('catalog/product')->load(19580);?>
<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"
<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>"
onChange="setLocation('<?php echo (string)Mage::helper('checkout/cart')->getAddUrl($_product); ?>').$('shipping:same_as_billing').checked = false;"
class="radio" />


texts: Magento 2 : Change Top Menu Alignment from Vertical to Horizontal

texts:
Curerntly top menu navigation show subcategories with images like this:

How to change default navigation behavior from vertical to horizontal display?

I need to get menu horizontally?


texts: How load getStoreConfig option as a code for use in phtml?

texts:
I want to load the option saves the admin panel and use as configuration loading and being inserted into my custom.phml, but the two ways I tried not work, as I proceed? thank you.

<? php echo Mage :: getStoreConfig ('customizefooter / option / custom_html_code'); ?>
<? php echo {{config path =" customizefooter / option / custom_html_code "}}; ?>


texts: How can i add a custom javascript module to custom module?

texts:
Hi this code is working perfect without magento.

i added to flipbook.js to  view/frontend/templates/web/js
and added to layout

Can u explain why its not working?
And how can i fix it?


texts: Unable to overwrite Contact Form in Magento 2

texts:
I'm trying to overwrite contact form but it's unable to overriding. For this I have followed below steps.

Step 1) app/code/Learning/Contact/composer.json

{
  "name": "learning/contact",
  "description": "contact",
  "require": {
      "php": "~5.5.0|~5.6.0|~7.0.0",
      "magento/framework": "100.0.*",
      "magento/module-ui": "100.0.*",
      "magento/module-config": "100.0.*"
  },
  "type": "magento2-module",
  "version": "1.0.0",
  "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
  "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Learning\\Contact\\": ""
        }
    }
}

Step 2) app/code/Learning/Contact/registration.php

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Learning_Contact',
    __DIR__
);

Step 3) app/code/Learning/Contact/etc/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="Learning_Contact" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Contact"/>
        </sequence>
    </module>
</config>

Step 4) app/code/Learning/Contact/view/frontend/layout/contact_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Contact Us</title>
    </head>
    <body>
        <referenceContainer name="content">
            <referenceBlock name="contactForm">
                <action method="setTemplate">
                    <argument name="template" translate="true" xsi:type="string">Learning_Contact::form.phtml</argument>
                </action>
            </referenceBlock>
        </referenceContainer>
    </body>
</page>

Step 5) app/code/Learning/Contact/view/frontend/templates/form.phtml

<h1> Hi I'm here.... </h1>

Step 6) cleared cache

php bin/magento cache:clean

Step 7) enabled module

php bin/magento setup:upgrade

Is above steps are correct or something went wrong?

Could you please throw me right direction?


texts: Decrease the download size of an product image

texts:
you can use inspect element to see product image source and download the images .

the sizes of image are more than 400 kb.

I want to reduce the size of the image.

media.phtml =http://pastebin.com/QBVrCu2X

please help me to find solution.


texts:
I have a problem my emails from magento store not getting send, someone said I must install aoe installer and see if cron is set up correctly, I installed AOE_Scheduler it says my cron is not set up corrctly, how do I set it up ?

HELP ASAP please

None of my emails are getting send


texts: Magento 2.3 how to automatically upload videos to page from youtube channel

texts:
I want to get all videos from youtube channel and load it on page. How can I do that? Is there some free plugins or mb I need to use some of JavaScript libraries? I found YouTube Gallery Widget, but I'm not sure that it's suits for me.
https://marketplace.magento.com/elfsight-youtubegallery.html


texts: Magento 2: How to create color swatch attribute for the customer?

texts: I want to create a color swatch attribute for the customer same like we use for the product attribute.


texts: IsSecureMode di.xml frontend / backend don't work

texts:
Magento 2.0.10 and PHP 5.6.27

i have declare a etc\frontend\di.xlm en frondend whitch

<type name="Jbpevasion\Cartebleu\Block\Info">
    <arguments>
        <argument name="data" xsi:type="array">
            <item xsi:type="string" name="is_secure_mode">1</item>
        </argument>
    </arguments>
</type>

and in etc\adminhtml\di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Jbpevasion\Cartebleu\Block\Info">
    <arguments>
        <argument name="data" xsi:type="array">
            <item xsi:type="string" name="is_secure_mode">0</item>
        </argument>
    </arguments>
</type>

but if i test

if (!$this->getIsSecureMode()) { .... }

i have the same for the admin et front ...
I've forgotten something?

thanks


texts: How to remove the URLs from XML Sitemap in Magento 1.14.2.2

texts:
Currently, the XML Sitemap is having unwanted duplicate URLs which are blog URLs with the common folder path /index.php/blog/

Although, the /index.php/ is blocked in robots.txt. We are not able to edit the existing sitemap in Magento CMS.

How to remove only these URLs (with /index.php/blog/) from the XML sitemap?


texts: Magento 2: Download order history from Customer account

texts:
From customer account i have to give option to download order history. It will be like table of all order records.
Order #     Date    Ship To     Order Total     Status

Can i have any suggestion or reference please?


texts:
I have magento running in my localhost. But a trailing slash is not getting added to the URL. This causes javascript and css files to be not found and so the entire magento application is not running properly. Below are the URLs

<link rel="stylesheet" type="text/css" href="https://localhostskin/adminhtml/default/default/print.css" media="print">
<link rel="stylesheet" type="text/css" href="https://localhostskin/adminhtml/default/default/menu.css" media="screen, projection">
<script type="text/javascript" src="https://localhostjs/prototype/prototype.js"></script>
<script type="text/javascript" src="https://localhostjs/prototype/window.js"></script>

which are supposed to be

<link rel="stylesheet" type="text/css" href="https://localhost/skin/adminhtml/default/default/print.css" media="print">
<link rel="stylesheet" type="text/css" href="https://localhost/skin/adminhtml/default/default/menu.css" media="screen, projection">
<script type="text/javascript" src="https://localhost/js/prototype/prototype.js"></script>
<script type="text/javascript" src="https://localhost/js/prototype/window.js"></script>


texts: How to redirect to previous page in admin?

texts: In my admin controller action I want to redirect to the previous page. How can I do this?


texts:
I am developing a store in magento 1.9.1, local on MAMP

The site is set up in navigation bar with a store-button which shows all the products (or a selection), category-buttons etc. In each category-button there are subcategories, drop down buttons like brands or designers.

All products are grouped with various sizes.

On the product page I have placed a “more about” link to a CMS page. This page contains more information and there are images of the other products in this brand. The images are links to their individual pages.

An image with link looks like this:

Orange

It works fine and so does yellow, green, blue etc. the url in the store is like  - - /magento/blue.html

Suddenly a new one, “red” gives a 404. Refresh works fine for all except “red” which is still 404.

From “store” I click “red” it opens the product page and I copy the URL from that page - - /magento/store/dave-david.html  (dave-david is the category url key) and change the url in the CMS page to this

  - it works fine. I can remove - store - in url,  "{{store direct_url="dave-david.html"}}" works, too.

(The “Orange” link in store is - - /magento/store/orange.html)

Going from the “category” “red” button I get this url - - /category1/dave-david-930.html and that works fine when entered in the CMS page.

A bit strange, 930 is the id number, well not quite it is 922. Replacing 930 with 922 works, but it generates 930 when entered.

Removing category1/ and use - - /dave-david-930.html gives 404

Now the drop down button category1 - Dave David URL is - - /magento/category1/dave-david.html
and change URL in CMS page to {{store direct_url=“category1/dave-david/dave-david.html"}} works as well but remove category1/ gives 404.

I have googled for days but not been able to find anything like this.

I can set up the CMS page and adjust the links that is not working with links from “store” or “category” but somehow I have a feeling this could easy conflict in some browsers.

Has anyone experienced the same problem and found a solution? Help will be much appreciated.

This is missing

Image with links should be

I do not know why this platform is skipping the html.

I try again

Orange

Sorry new to this tried to add some html in the text. This site interpreted the html. I hav tried to remove the question to make it right, no succes.
Removed some of the missing html plus some signs and the part of the link in question seems to show.

<a class="product-image" title="Orange" href="{{store direct_url="orange.html"}}"


texts: Change label and position of media in store views via API

texts:
I encountered a problem today while saving images via the API: catalogProductAttributeMediaGalleryManagementV1. The label and position of the image for all the store views except the default one are set to null because they are not a global scope and I don't understand how I can set all the fields as the same as the default one. Is there any way to do this?

What I see:

default store view -> image label: abc;  image position: 1;
second    store view  -> image label: null; image position: null;

What I want to see:

default store view -> image label: abc;  image position: 1;
second store view  -> image label: abc; image position: 1;


texts: Most reliable way to get product page URL that customer added at last in the cart

texts: I would like to get the URL of the product which was recently added to cart (lastly added to the cart) and assign it to Continue Shopping url in cart page.


texts: How to add the logo hyperlink in magento

texts:
In my magento store i have put in my logo, that logo contains two links one is my site link, and another one is my external site link, these two link are created in image mapping functions using adobe dreamweaver tool mapping options,
So how to add the code in my magento store header.phtml page, pls anyone help me


texts:
I am creating page layout using xml

<referenceContainer name="content">
    <container name="page.container.main" htmlTag="div" htmlClass="page-container-main" before="-">
        <block name="page.container.h2" class="Magento\Framework\View\Element\Text" before="-">
            <arguments>
                <argument translate="true" name="text" xsi:type="string"><![CDATA[
Page List
]]></argument>
            </arguments>
        </block>
    </container>
</referenceContainer>

<referenceContainer name="page.container.main">
    <container name="page.container.info" htmlTag="section" htmlClass="page-lists" after="page.container.h2">
        <block name="page.container.text" class="Magento\Framework\View\Element\Text" before="-">
            <arguments>
                <argument translate="true" name="text" xsi:type="string">Simple Text</argument>
            </arguments>
        </block>
    </container>
</referenceContainer>

I want to display page output in div page-container-main show h2 tag and after show text in but current output is

Page List

Simple Text

As shown 'Simple Text' section is rendering out of page-container-main div but what i am actually expecting is below

Page List

Simple Text


texts: I want to know that form which file this label is coming:


texts:
I'm new to Magento development. I was trying to display related products in the product view.

While method ->getName() works fine, ->getProductUrl() renders the path of the actual product. I tried create an external link for www.google.com, i had the same issue.

Thank you for your help.

Here is my code :

$categoryId = array_shift($_product->getCategoryIds());
$related_prods = Mage::getModel('catalog/product')
                ->getCollection()
                ->addAttributeToSelect('*')
                ->addUrlRewrite($categoryId)
                ->addAttributeToFilter('entity_id',
                        array('in'=>$_product->getRelatedProductIds()));

<?php foreach($related_prods as $related) { ?>
<a href="<?php $related->getProductUrl()."
";?>">
<?php echo $related->getName();?>
<?php } ?>


texts: How can i display product detail page page notes for Selected Store?

texts:
I have notes for
my store 1 like Delivery:  10 Days,

and I have another store and I need to change notes like Delivery: 20 Days,

The condition like if store 1, Delivery:  10 Days,
and if store 2, Delivery: 20 Days.

How can I display the message based on the current store?


texts: Migration from Magento 1.14 to Magento 2.0 - Enterprise Edition for both

texts:
We have an enterprise application running on Magento 1.14
Our new requirement is to migrate EE 1.14 to EE 2.0. Going through the links available online, I could not find a complete solution or steps involved for migration.
It may include real time key points like

How to migrate site settings and configuration?
Migrate categories, products, customers, order and other details ?
Migrate other data ?

It would be great if someone could guide on a good starting point and what would be the real time steps involved for migration from 1.14 EE to 2.0 EE ?


texts: SOLVED - Delete Out of Stock Products Programmatically

texts:
I'm using Magento 2.2.3 and I need to create a php script to delete all out of stock items from my catalog.

Any idea?

Thanks in adv


texts:
I installed Magento 2.0.12 with sample data. I press add to cart button but minicart is not working (keeps updating but nothing happens ie stuck). See below.

I have full page caching enabled from backend and php 7 + apache 2.4.


texts: How to redirect domain.com to www.domain.com?

texts:
I have this code in .htaccess
Options +SymLinksIfOwnerMatch
RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

But it still appears to be the domain.com


texts:
How to set price including tax in product admin edit view?
In Stores -> Configuration -> Sales -> Tax I set all options to "Incuding tax" but still I can't see [Inc.Tax]. Anyone know how to set it?


texts: How to add some custom code javascript in core widget without override

texts:
I want to modify mediabrowser widget of magento
Location that implement widget in

  vendor/magento/module-cms/view/adminhtml/templates/browser/content.phtml

browser widget stay in
lib/web/mage/adminhtml/browser.js. I want to add id variable to id element such as "#new_folder" "delete_folder". It will be "#id_new_folder"..

_selectNode: function (event, data) {
      var node = data.rslt.obj.data('node');
      var my_id = this.options.ID; <== pass my var here
      this.activeNode = node;
      this.element.find('#'+my_id+'_delete_files, #insert_files').toggleClass(this.options.hidden, true);
      this.element.find('#contents').toggleClass(this.options.hidden, false);
      this.element.find('#delete_folder').toggleClass(this.options.hidden, node.id == 'root'); //eslint-disable-line eqeqeq
      this.element.find('#content_header_text').html(node.id == 'root' ? this.headerText : node.text); //eslint-disable-line eqeqeq

      this.drawBreadcrumbs(data);
      this.loadFileList(node);
},

I am a bit confuse to choose which one is a better way to create my custom widget

Approach 1

create my new widget with same behavior with browser
So in template i will try to call data-mage-init="customMediaBrowser"

map: {
        "*": {
            "customMediaBrowser" : "InsideMyModule/js/mage/adminhtml/browser",
        }
    },

Approach 2

Use feature "mixins" of magento

config: {
        mixins: {
            'mage/adminhtml/browser': {
                'Module_Name/js/mage/adminhtml/browser': true
            }
        }
    },

UPDATE
Here is my content mixins js. Current using magento 2.2.0 with jquery ui 1.9.2

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

    return function (Browser) {
        $.widget('mage.mediabrowser', Browser, {
            /**
             * {@inheritDoc}
             */
            _create: function () {
                this._super();
                console.log('Custom module js widget is triggered!');
            }
        });
        Browser.mediabrowser = $.mage.mediabrowser;
        return Browser;
    };

});


texts: Proper way to include a third party library (phpCAS)

texts:
I'm trying to find the correct way to include CAS into Magento. The way I currently have it set up is by including the required files in the index.php file. This works until I turn FPC caching on in Magento then I run into the problem where the first time I login it works but if the next person logs in they are thrown into a redirect loop.

Clearing the cache fixes it for the first person but then the next person runs into the loop issue. It seems to be Magento is caching the ticket it should be receiving so it works the first time but not after.

I don't even know where to being to bust the cache for this.

EDIT: Figured out how to autoload correctly. Still can't figure out why CAS is being cached. I'm initing CAS in the observer by doing phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context).

Looking at the headers I see that CAS is returning with a ticket set but when Magento goes to validate it isn't providing the correct ticket which cause it to go get another and loop.

Final edit: CAS' class wasn't being instantiated correctly. This is resolved with just the library being included correctly.


texts: What's the advantage of factory classes?

texts:
I figured out that magento 2 uses a proxy class which then creates an instance of a class.
I don't understand why this proxy class is used, whats the advantage of it? Why not just creating the instance normally like always?

Example:

vendor\magento\module-catalog\Model\Product\Link.php:

public function __construct(
    ...
    \Magento\Catalog\Model\ResourceModel\Product\Link\Product\CollectionFactory $productCollectionFactory,
    ...
    array $data = []
) {
    ...
    $this->_productCollectionFactory = $productCollectionFactory;
    ...
}

public function getProductCollection()
{
    $collection = $this->_productCollectionFactory->create()->setLinkModel($this);
    return $collection;
}

The method create() from $this->_productCollectionFactory->create() is defined in generated\code\Magento\Catalog\Model\ResourceModel\Product\Link\Product\CollectionFactory.php:

public function create(array $data = [])
{
    return $this->_objectManager->create($this->_instanceName, $data);
}

It uses objectManager to create the object from the class defined in $this->_instanceName which is \Magento\Catalog\Model\ResourceModel\Product\Link\Product\Collection

This looks totaly complicated and unecessary, why all this trouble? Why not just creating the object directly from start in the constructor:

public function __construct(
    ...
    \Magento\Catalog\Model\ResourceModel\Product\Link\Product\Collection $productCollection,
    ...
    array $data = []
) {
    ...
    $this->_productCollection = $productCollection;
    ...
}

public function getProductCollection()
{
    $collection = $this->_productCollection->setLinkModel($this);
    return $collection;
}

Please help me to understand the advantage of the factory way.


texts: When merging CSS or JS, a new file is generated for each page type

texts:
We have a lot of small CSS and JS files and enabling merging seems to be a good choice.

Many of the CSS and JS files are used on every page (home page, category page, product detail page).

Whenever we saw that a different merged file is loaded again on each page, even the contained CSS must be overlapping.

How can we avoid this and reuse more data?


texts: "Shop by" sort order of attributes on category page

texts:
Is there a way to change the sort order of the "shop by" attributes?

I tried changing the order in the attribute set, but that does not seem to work


texts:
A client of mine would like to have a filter (in the left menu, on product listing pages) which updates the product's in the product listing bases on the selection in the filter. Values in the filter would include attributes like length, material etc. So far the request is quite common of course.

But, whats specific for this request is that (as products are imported from an ERP), there are no attributes filled. All the 'attributes' are contained in the names of the products. So a product has a name like for example 'Product X 250mm grey steel cable". The client would like to supply the values for the filter, for example "grey" and "steel". When a user clicks on a value, the products which have that term in their product name, show up. It should be possible to select multiple values.

I have already informed the client that it's wiser to move all the data, which is now in the product names to separate attributes, but as the product stock contains a large amount of products this is not really an option at the moment.

What would be the best approach?

Thanks in advance


texts: How to make custom menu in magento admin panel and make it work?

texts:
I create a menu Employee on admin panel. This menu has a sub menu Manage Employees. When I click on Manage Employees I get an 404 error. The given below are my codes:

The given below is a part of my controller
Location: /var/www/html/magento/app/code/local/Test/User/etc

<adminhtml>
  <menu>
   <user module="adminhtml">
    <title>Employee</title>
    <sort_order>71</sort_order>
    <children>
     <items module="user">
      <title>Manage Employees</title>
      <sort_order>0</sort_order>
      <action>adminhtml/adminhtml_employee/</action>
     </items>
    </children>
   </user>
  </menu>
  <acl>
   <resources>
    <all>
     <title>Allow Everything</title>
    </all>
    <admin>
     <children>
      <Test_User>
       <title>Employee Module</title>
       <sort_order>10</sort_order>
      </Test_User>
     </children>
    </admin>
   </resources>
  </acl>
  <layout>
   <updates>
    <user>
     <file>user.xml</file>
    </user>
   </updates>
  </layout>
 </adminhtml>

This is my controller
Location: /var/www/html/magento/app/code/local/Test/User/controllers/Adminhtml

<?php
 class Test_User_Adminhtml_EmployeeController extends Mage_Adminhtml_Controller_action
  {
   public function indexAction()
    {
     $this->loadLayout();
     $this->renderLayout();
    }
  }
?>

This are the block files
Location: /var/www/html/magento/app/code/local/Test/User/Block/Adminhtml

<?php
 class Test_User_Block_Adminhtml_Employee extends Mage_Adminhtml_Block_Widget_Grid_Container
  {
   public function __construct()
   {
    $this->_controller = 'adminhtml_employee';
    $this->_blockGroup = 'employee';
    $this->_headerText = Mage::helper('employee')->__('Employee Manager');
    $this->_addButtonLabel = Mage::helper('employee')->__('Add Employee');
    parent::__construct();
   }
  }
?>

Location: /var/www/html/magento/app/code/local/Test/User/Block/Adminhtml/Employee

<?php
 class Test_User_Block_Adminhtml_Employee_Grid extends Mage_Adminhtml_Block_Widget_Grid
  {
    public function __construct()
    {
        parent::__construct();
        $this->setId('employeeGrid');
        $this->setDefaultSort('id');
        $this->setDefaultDir('ASC');
        $this->setSaveParametersInSession(true);
    }

    protected function _prepareCollection()
    {
        $collection = Mage::getModel('user/employee')->getCollection();
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

    protected function _prepareColumns()
    {
        $this->addColumn('id', array(
          'header'    => Mage::helper('employee')->__('ID'),
          'align'     =>'right',
          'width'     => '10px',
          'index'     => 'id',
        ));

        $this->addColumn('name', array(
          'header'    => Mage::helper('employee')->__('Name'),
          'align'     =>'left',
          'index'     => 'name',
          'width'     => '50px',
        ));

        $this->addColumn('content', array(
            'header'    => Mage::helper('employee')->__('Description'),
            'width'     => '150px',
            'index'     => 'content',
        ));
        return parent::_prepareColumns();
    }
  }
?>

and this is my xml file user.xml present inside my module:

<?xml version="1.0"?>
<layout version="0.1.0">
<employee_adminhtml_employee_index>
        <reference name="content">
            <block type="employee/adminhtml_employee" name="employee" />
        </reference>
    </employee_adminhtml_employee_index>
</layout>


texts: Add RabbitMQ to existing Magento 2 EE installation

texts: Is there a way to add RabbitMQ/AMQP setup to an existing M2 EE installation? All the docs seem to shout that it has to be done at install time but that seems a bit limiting. However, I can't find anywhere in the admin to configure host, port etc.


texts: Invalid Form Key. Please refresh the page while creating new users in Magento 2.3

texts:
Whenever adding new users or editing, updating the products in
  frontend shows the error Invalid Form Key. Please refresh the page.

*I increased the value of input_max_var but still it showing the error often. Is I need to increase the values for max_input_time and max_execution_time too? Between the site is slow. Will the slow loading cause such issues? *

It also displaying the alert messages lately after saving the product or creating users.

What is the solution?

Kindly help me.


texts: When open a productin multi-store website it redirects to 404 - page not found

texts:
I have Multi-Store Magento Website, that is managed by only One Admin

in one of its store website,

when i click on product name, it redirects me to 404 page.

what can be the problem ?


texts: Magento 2: How to stop order from Invoicing Programmatically?

texts:
I have requirement when done Payment with Paypal using Capture Method.

It automatically creates Invoice.

I need to stop that. How to achieve Programmatically?


texts: Products imported with custom script "disappear" from the category listing

texts:
I've run into an interesting situation problem with Magento EE 1.13.1

We have a custom module to sync product data between Magento and an external ERP system. Most of the time it works without an issue, but, on rare occasions, our customer reports that products are disappearing from the front end. The products display correctly after executing a command line reindex of the catalog_product_price index.

In this implementation, we are using the Magento product API model to create and update products by calling the API methods directly.

For example, when creating a product, first an array is created with all the product data -

$productData['sku'] = $sku;
$productData['name'] = $productName;
$productData['description'] = $productName;
(etc)

then the stock data is added -

$productData['stock_data']['qty'] = $available;
$productData['stock_data']['is_in_stock'] = true;

Finally the array is passed to the API create method -

$magentoApi = Mage::getModel('catalog/product_api');
$productId = $magentoApi->create('simple', '4', $sku, $productData, null);

So the result is that the product is created properly, but occasionally the indexes are not being updated. Do you think we should modify the code to force a reindex after creating or updating a product?  I thought Magento was doing this automatically in 1.13 onward or am I mistaken?

Thanks for any pointers or suggestions.


texts: How to Use Helper Function in checkout_cart_index.xml?

texts:
I've to override checkout_cart_index.xml file from vendor/Magento for removing estimate shipping and discount code block!
It's working successfully but my requirement is...it only should run when an admin or user select Yes from config part.I've tried ifconfig part but it's not working. Can anyone suggest any better idea to fulfil this requirement!? Here's my code of  checkout_cart_index.xml. In this code  set true in checkout.cart.coupon part is for removing Discount code and the above part is for for removing estimated shipping block and also override shipping.phtml

        <action method="setTemplate">
            <argument name="template" xsi:type="string">vender_extensionname::shipping.phtml</argument>
        </action>
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="block-summary" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="componentDisabled" xsi:type="boolean">true</item>
                        </item>
                    </item>
                </item>
            </argument>

        </arguments>
    </referenceBlock>

    <referenceBlock name="checkout.cart.coupon" remove="true"/>

Here's my config part

in which if user set to yes in discount code then it should be displayed but if one select  NO then it should not be displayed.I've created helper data.php for fetching that yes no value but I'm confused in how to use helper function in my XML part.


texts: How to use Context object to get config values

texts:
I am getting this error after compiling in command prompt,

  Incorrect dependency in class ParadoxLabs\TokenBase\Helper\Data in

  /var/www/html/magento2/app/code/ParadoxLabs/TokenBase/Helper/Data.php

  \Psr\Log\LoggerInterface already exists in context object

  \Magento\Framework\App\Config\ScopeConfigInterface already exists in
  context object

I have added scope config dependency in my helper.

But as it says, that it is already present in context, then how to use it to fetch config values.

Currently I am using this way to get config values

$this->_scopeConfig->getValue('section/group/field');

Now how to access same, by using context object

Injection for my context object is

\Magento\Framework\App\Helper\Context $context


texts: worldpay payment gateway error using SNI - change the callback URL to use HTTP instead of HTTPS

texts:
Worldpay is my payment gateway and we use SNI certificate on the server.

However, WorldPay is not compatible over SNI at the moment. The recommended solution by the tech team over there is to change the callback URL to use HTTP instead of HTTPS.

1) Can someone guide me how to do this on Magento because I am totally confused?

2) Also what kind of security implications could this cause? and should his page be hidden from search engines etc?

i think the change needs to be made in the htaccess file, but i'm not sure.
Just change the one page to be sent over http instead of https


texts:
I am trying to load phtml template on my block in magento 1.9 but it is not loading. Here is my code.

app/code/local/Amactech/Events/etc/config.xml

<?xml version="1.0" ?>
<config>
    <modules>
        <Amactech_Events>
            <version>1.0</version>
        </Amactech_Events>
    </modules>
    <global>
        <model>
            <events>
                <class>Amactech_Events_Model</class>
            </events>
        </model>
        <block>
            <events>
                <class>Amectech_Events_Model</class>
            </events>
        </block>
    </global>
    <frontend>
        <routers>
            <events>
                <use>standard</use>
                <args>
                    <frontName>events</frontName>
                    <module>Amactech_Events</module>
                </args>
            </events>
        </routers>
        <layout>
            <updates>
                <events>
                    <file>events.xml</file>
                </events>
            </updates>
        </layout>
    </frontend>
</config>

app/design/frontent/base/default/layout/events.xml

<?xml version="1.0" ?>
<layout version="1.0">
    <events_index_index>
        <update handle="page_two_columns_left" />
        <reference name="content">
            <block type="events/eventblock" />
        </reference>
    </events_index_index>
</layout>

app/design/frontent/base/default/template/events/myevents.phtml

My Events.

app/code/local/Amactech/Events/Block/Eventblock.php

<?php

    class Amactech_Events_Block_Eventblock extends Mage_Core_Block_Template{

        public function __construct(){
            parent::__construct();
            $this->setTemplate('events/myevents.phtml');
        }

    }

?>

app/code/local/Amactech/Events/controllers/IndexController.php

<?php

    class Amactech_Events_IndexController extends Mage_Core_Controller_Front_Action{
        public function indexAction(){
            $this->loadLayout();
            return $this->renderLayout();
        }

    }

?>

Can anyone guide me that where I made mistake because nothing is loaded from phtml template file.


texts:
I would like to ask, what sort of logic caused the developers of Magento to include [GLOBAL], [WEBSITE], and [STORE VIEW] scopes but not [STORE] scopes as well. Why does it make sense to exclude the [STORE] scope from the scopes appearing on the

System -> Configuration

magento admin panel page?


texts: Invalid Document Element 'total': Missing child element(s). Expected is one of ( title, title_source_field, font_size, amount_prefix ). in magento 2

texts: open admin panel and go to sales->invoice and select invoice and download PDF this issue is generated. i have check network show 500 error it is a permission issue hello everyone plz give me a solution. this problem ow to resolve in magneto 2


texts: How to add only footer in checkout page Magento 2

texts:
How can I add only footer section in my checkout page
I tried this code

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column">
    <body>
        <referenceContainer name="page.main.title" remove="true" />
        <referenceBlock name="top.search" remove="true" />
        <referenceBlock name="catalog.compare.link" remove="true" />
        <referenceBlock name="catalog.topnav" remove="true"/>
        <referenceContainer name="footer-container"  remove="false"/>
    </body>
</page>

But this gives me header and footer both
I am not able to get footer alone.


texts: Override a function from app/code/core/Mage/Core/functions.php file into a Custom module

texts:
Recently I came across a site which contains some modifications in app/code/core/Mage/Core/functions.php file. I would like to keep code clean and move the changes to custom module in local scope; but as the functions.php file does not fall under any basic magento block, I don't know how to create custom module for it.

I would like to hear if you have encountered such problem before and you approach to solve it.

Any constructive comment is welcomed.

Thanks in advance.


texts: Magento 2.3.4 to 2.4 after upgrade product can't save showing error

texts:
Bellow error showing I did do an update on schedule, setup upgrade, cache clean reindex, give root user try everything but still get this issue on product saves.
The Bellow problem is showing when I try to save the product from the admin pannel.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'm24.scconnector_google_feed_cl' doesn't exist, query was: DELETE FROM `catalog_product_entity_media_gallery_value` WHERE (value_id = 630 AND entity_id = 640 AND store_id = 0)

I did try bellow code:
php bin/magento cron:install
php bin/magento cron:run
php bin/magento index:reindex
mysql -u root -p set global log_bin_trust_function_creators=1;
php bin/magento module:disable Magento_GoogleShoppingAds

I didn't see scconnector_google_feed_cl can anyone tell why this table not showing after migrate from Magento 2.3.4 to 2.4?
Can anyone give me the SQL for creating this scconnector_google_feed_cl so I can create it?


texts: Magento 2 Configurable Product Show Tier Prices By Default

texts:
I am trying to setup tier prices to simple products of a configurable product.
Tier prices render in product view page when I click on the swatch and it have tier prices.
But I have my tier prices are same for all simple products as I am selling blank T-shirts.
I want to render tier prices by default without selecting the swatch so it always show customer the tier prices.
I have tried to auto select the first swatch by default on rendering swatches and it does show tier prices.
I was wondering if there is possibility to render the tier prices by default and show without the user select a swatch?
Thank you


texts: Sales orders is not displayed in admin panel in grid of Magento2.2.0?

texts:
After data migration process I see that orders data is not displayed in Magento admin sales grid.

All data is available in the database. Than why data is not in sales grid?

Anyone has idea about this problem?


texts: Magento, Successful Login Redirects to Login

texts:
When logging in to the admin panel I am redirected to a url such as follows (where 4.2.2.2 is a random value):

 http://4.2.2.2/index.php/admin/index/index/key/24633634065368573042cf976992f849244a20c6bd0e364a41cb6962ccb87bef/

To be clear, this occurs after a successful login; as opposed to a failure where the failure count is updated for the user in the admin_user table.

The install I was working with originally had an issue for logging into the admin section. I reset the password and made the following changes to app\code\core\Mage\Core\Model\Session\Abstract\Varien.php:

#1 $cookieParams = array(
#2    'lifetime' => $cookie->getLifetime(),
#3    'path' => $cookie->getPath(),
#4    //'domain' => $cookie->getConfigDomain(),
#5    //'secure' => $cookie->isSecure(),
#6    //'httponly' => $cookie->getHttponly()
#7);

#8/*
#9 if (!$cookieParams['httponly']) {
#10    unset($cookieParams['httponly']);
#11    if (!$cookieParams['secure']) {
#12         unset($cookieParams['secure']);
#13         if (!$cookieParams['domain']) {
#14             unset($cookieParams['domain']);
#15            }
#16    }
#17 }
#18
#19 if (isset($cookieParams['domain'])) {
#20     $cookieParams['domain'] = $cookie->getDomain();
#21 }
#22 */

Where the commented out lines (4 through 6, and 8 through 22) are the changes. These changes are described in numerous sources related to this issue (and similar admin login issues), such as this: :

Magento 1.9 Can’t login to admin panel!

This corrected the issue for a time; and then it reared its head again. I've cleared the file based sessions; var/session. I've cleared the cache; var/cache.

Any tips on solving this?


texts: Magento 2 Autoload error after moving site on live domain

texts:
I set up my site on my test server and after moving it to my live domain, its giving me

Autoload error

Vendor autoload is not found. Please run 'composer install' under application root directory.

Please suggest me how to fix this issue.

Thanks


texts:
I have an shop that cannot reindex.

I've tried to re-index programmatically, with this code:

//Following 3 lines will load the magento admin environment.
require_once 'app/Mage.php';
$app = Mage::app('admin');
umask(0);

// to reindex the processes we require their ids
// for default magento there are 9 processes to reindex, numbered 1 to 9.
$ids = array(1, 2, 3, 4, 5, 6, 7, 8, 9);

// Sometimes there are processes from our custom modules that also require reindexing
// We need to add those ids to our existing array of ids
// To know the id of process, just hover on each process in your
// admin panel-> System-> Index Management
// You will get a url : admin/process/some_id/......
// this id corresponds to the process

$ids = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 390, 391, 478);
foreach ($ids as $id) {
    //load each process through its id
    try {
        $process = Mage::getModel('index/process')->load($id);
        $process->reindexAll();
        echo "Indexing for Process ID # " . $id . " Done<br />";
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}

But I still get an error. Here is the error:

  An error occurred while saving the URL rewriteSQLSTATE[23000]:
  Integrity constraint violation: 1452 Cannot add or update a child row:
  a foreign key constraint fails (`pukindustri`.`#sql-c67_7a9d2c9`,
  CONSTRAINT
  `FK_MAGE_MAGE_CAT_PRD_FLAT_1_ENTT_ID_MAGE_CAT_PRD_ENTT_ENTT_ID`
  FOREIGN KEY (`entity_id`) REFERENCES `mage_catalog_product_entity`
  (`entity_id`) ON)Indexing for Process ID # 5 Done

Can someone help me to get the reindex to function again?


texts: How to Redirect Buy Now Button to View Cart instead of Shipping Address

texts:
When we click on Buy Now button it is redirecting to the shipping page
(https://vitalticks.in/checkout/#shipping)

But for us, it will be redirected to the View Cart page.
https://vitalticks.in/checkout/cart/

How can I achieve this one?


texts: how to change constants of class in Magento\Framwork?

texts:
I'm newbie.
My boss want to increase value of this const:

const MAX_NUM_COOKIES = 50;

path: vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php

is it possible? if yes, which's the best way to do that?


texts: Different form key in template and controller

texts:
When I am directly accessing customer/account/login page
then, values for $this->getRequest()->getParam('form_key'); and Mage::getSingleton('core/session')->getFormKey(); are different when I am checking in controller.

But when I am going to login page by clicking login link on the website, then values for $this->getRequest()->getParam('form_key'); and Mage::getSingleton('core/session')->getFormKey(); are same.

It would be very helpful if any one faced similar issue or if someone can help me out to figure out and fix this issue.


texts: Magento 2 url_rewrite table contains "az-categories/" prepended to URLs for all of our stores

texts:
We have a multi-store Magento 2.1.4 installation, with 3 stores, and in recent weeks we've noticed that our category URLs will some times include one of our store code's prepended with "-categories/" to all of our URLs.

Eg. az-categories/wheel-brake-tire/brake.html when it should be wheel-brake-tire/brake.html where az is the store code.

After investigating this further we discovered that any time we save a category the system generates more URLs like this.

It creates these URLs for each Store ID but only adds one Store Code to the URL. All stores will have a URL of az-categories/wheel-brake-tire/brake.html One row where store_id = 1, another where store_id = 2 and a third where store_id = 3.

We don't want this occurring on any of our sites.

We've disabled our custom extensions in our local environment and it still occurs. We also tried to prevent this by commenting out the Magento code in vendor/magento/module-catalog-url-rewrite/Model/CataegoryUrlRewriteGenerator.php as a test but it still occurred.

Does anyone know how to resolve this so that the system no longer generates these extra URLS and returns our categories are back to normal?

Thanks.


texts: AddAttributeToFilter doesn't seem to be working

texts:
For my Magento shop, I'm trying to retrieve all products that have an attribute set to yes called "uitgelicht_categorie" under the categories. The products should be shown depending on the categories. Meaning that if a product is attached to a category with ID 1 and in that category a sub category with ID 3, the product shouldn't be shown in a category with ID 2.

On my test environment with Magento version 1.9.2.4 this works fine, but the exact same code does not work on my live environment with Magento version 1.9.2.1. I've checked the settings as well, but these seem to be the exact same. All the selected products are turned on and showing on the rest of the shop as well.

Here is the code I'm using:

$yesOpID=null;
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'uitgelicht_categorie');
if ($attribute->usesSource()) {
    $options = $attribute->getSource()->getAllOptions(false);
    foreach($options as $e){
        if($e['label']=='Yes'):
            $yesOpID=$e['value'];
        endif;
    }
}

// get the current category
$currentCategory = Mage::registry('current_category');

if($currentCategory->getProductCount() == 0 ):
    // Instantiate a product collection object
    $products = Mage::getModel('catalog/product')->getCollection();

    // Select which fields to load into the product
    // * will load all fields but it is possible to pass an array of
    // select fields to load
    $products->addAttributeToSelect('*');

    $subCategories = explode(',', $currentCategory->getAllChildren());

    $products->addAttributeToFilter('uitgelicht_categorie', $yesOpID);
    $products->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left');
    $products->addAttributeToFilter('category_id', array('in' => array('finset' => $subCategories)));
    $products->getSelect()->group('e.entity_id');

    $products->getSelect()->order('RAND()');
    $products->getSelect()->limit(8);

    if(count($products) != 0):
?>

<?php echo $this->__('Meest populair in deze categorie'); ?>

    <?php
        foreach ($products->load() as $product):


texts: Magento 2: How to change video to first position in product page

texts:
I'm looking for a solution to move the video to the first position in left gallery in product page WITHOUT changing from admin.

I've set the video in 3rd position, but I want the video should in the 1st position.The result will look like this:

I've custom some in function setData() from fotorama.js, i've create datanew, then i load data, and check if its a video or not, then move video to top by using "unshift", then assign data = datanew:

    // other code

    function setData() {
        data = that.data = data || clone(opts.data) || getDataFromHtml($fotorama);
        size = that.size = data.length;

        ready.ok && opts.shuffle && shuffle(data);

        var datanew = [];
        for (var i = 0; i < data.length; i++) {
            if (data[i].type == 'video') {
                datanew.unshift(data[i]);
            } else {
                datanew.push(data[i]);
            }
        }
        data = datanew;

        checkForVideo();

        activeIndex = limitIndex(activeIndex);

        size && appendElements(true);
    }

    // other code

But most of the time, its doesn't show the play video button and video thumb icon.
Other time, it shows both thumb icon in the image as well (which I don't want to).

I'm following @Dhiren Vasoya solution, and its almost work, but the content in the right is not video, its image.

Here are the code that i've custom in Gallery.php

public function getGalleryImagesJson()
{
    $imagesItems = [];
    $n = 1;
    /** @var DataObject $image */
    foreach ($this->getGalleryImages() as $image) {
        $position = $image->getData('position') + 1;
        if ($image->getMediaType() == 'external-video') {
            $isMain = true;
            $position = $n;
            $n++;
        } else {
            $isMain = false;
        }
        $imageItem = new DataObject([
            'thumb' => $image->getData('small_image_url'),
            'img' => $image->getData('medium_image_url'),
            'full' => $image->getData('large_image_url'),
            'caption' => ($image->getLabel() ?: $this->getProduct()->getName()),
            'position' => $position,
            'isMain'   => $isMain,
            'type' => str_replace('external-', '', $image->getMediaType()),
            'videoUrl' => $image->getVideoUrl(),
        ]);
        foreach ($this->getGalleryImagesConfig()->getItems() as $imageConfig) {
            $imageItem->setData(
                $imageConfig->getData('json_object_key'),
                $image->getData($imageConfig->getData('data_object_key'))
            );
        }
        if ($image->getMediaType() == 'external-video') {
            array_unshift($imagesItems, $imageItem->toArray());
        } else {
            $imagesItems[] = $imageItem->toArray();
        }

        // $imagesItems[] = $imageItem->toArray();
    }
    if (empty($imagesItems)) {
        $imagesItems[] = [
            'thumb' => $this->_imageHelper->getDefaultPlaceholderUrl('thumbnail'),
            'img' => $this->_imageHelper->getDefaultPlaceholderUrl('image'),
            'full' => $this->_imageHelper->getDefaultPlaceholderUrl('image'),
            'caption' => '',
            'position' => '0',
            'isMain' => true,
            'type' => 'image',
            'videoUrl' => null,
        ];
    }

    return json_encode($imagesItems);
}


texts: Script to automatically add items to categories based on a specific attribute

texts:
we use magento 1.8.1ce

We have build our shops products mostly on attributes.

Now i need for a special storeview the brands in a category form too.
But i don't want to do double work when adding products.

Is there a way a script can read the attribute manufacturer and create/add the items to the same manufacturer in the category tree.

So like the manufacturer attribute has the options: Apple, Sony And WD
And It creates sub-categories (when not made yet) with the same name and add all items which have the the attribute

Like
Brands -> Apple -> Apple product 1, Apple product 2 etc
          Sony-> Sony product 1, Sony product 2 etc

And a there must be a possibility to run this by cron.


texts: Trying to remove the new customer creation area on Customer Login

texts:
Magento 2

I'm trying to remove the new customer creation area on the Customer Login page. I'm using:

<referenceBlock class="Magento\Customer\Block\Form\Login\Info" name="customer.new" template="newcustomer.phtml" remove="true">

But its not working. What am I missing?