texts: Can't reindex Product Prices: a foreign key constraint fails

texts:
I receive an error when trying to reindex Product Prices: "Some problem with reindexing process."

Digging some more, I extracted this error message on exception.log:

2015-10-06T17:17:52+00:00 DEBUG (7): Exception message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`db1192491-myDB3`.`catalog_product_index_tier_price`, CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) O)

Trace: #0 /is/htdocs/wp1192491_HPZFWNW898/www/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /is/htdocs/wp1192491_HPZFWNW898/www/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /is/htdocs/wp1192491_HPZFWNW898/www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#3 /is/htdocs/wp1192491_HPZFWNW898/www/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#4 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php(412): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#5 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php(353): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price->_prepareTierPriceIndex()
#6 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Index/Model/Indexer/Abstract.php(125): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price->reindexAll()
#7 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Index/Model/Process.php(139): Mage_Index_Model_Indexer_Abstract->reindexAll()
#8 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Index/Model/Process.php(167): Mage_Index_Model_Process->reindexAll()
#9 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#10 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#11 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#12 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /is/htdocs/wp1192491_HPZFWNW898/www/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#14 /is/htdocs/wp1192491_HPZFWNW898/www/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#15 /is/htdocs/wp1192491_HPZFWNW898/www/index.php(78): Mage::run('', 'store')
#16 {main}

I tried this solution on MySQL but didn't work (MySQL says no row was changed):

delete FROM `catalog_product_index_tier_price` where entity_id not in (select entity_id from catalog_product_entity);

Do you have some suggestions about what could I try?

Quite a lot of people have similar issues but couldn't find any of them related to the Product Price index and the tier prices in particular.

Thanks for any ideas,

EDIT: also tried removing the contents on var/locks directory, to no avail. I re-saved as well the products with tier prices, but it made no difference.


texts: Magento 2 Credit Memos : Template override doesn't work after clicking "Update Qty's" button

texts:
I am creating a custom module to simplify the Credit Memo creation for admin users. One of the features is hiding the "Return to Stock" column. I have overwritten 2 files for this:

vendor/magento/module-sales/view/adminhtml/templates/order/creditmemo/create/items.phtml

vendor/magento/module-sales/view/adminhtml/templates/order/creditmemo/create/items/renderer/default.phtml

With the following files of my custom module:

app/code/ATC/CreditMemo/view/adminhtml/layout/sales_order_creditmemo_new.xml

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

        <referenceBlock name="order_items">
            <action method="setTemplate">
                <argument name="template" translate="true" xsi:type="string">ATC_CreditMemo::order/creditmemo/create/items.phtml</argument>
            </action>
            <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="ATC_CreditMemo::order/creditmemo/create/items/renderer/default.phtml"/>
        </referenceBlock>

</page>

app/code/ATC/CreditMemo/view/adminhtml/templates/order/creditmemo/create/items.phtml

In this file I simply removed the following code:

<?php if ($block->canReturnToStock()) : ?>
<?php /* @escapeNotVerified */ echo __('Return to Stock') ?>
<?php endif; ?>

app/code/ATC/CreditMemo/view/adminhtml/templates/order/creditmemo/create/items/renderer/default.phtml

In this file I simply removed the following code:

<?php if ($block->canParentReturnToStock($_item)) : ?>

    <?php if ($block->canReturnItemToStock($_item)) : ?>
        <input type="checkbox"
               class="admin__control-checkbox"
               name="creditmemo[items][<?php /* @escapeNotVerified */ echo $_item->getOrderItemId() ?>][back_to_stock]"
               value="1"<?php if ($_item->getBackToStock()):?> checked<?php endif;?>/>

    <?php endif; ?>

<?php endif; ?>

All of this works fine when creating a new Credit Memo until a user clicks
the "Update Qty's" button after changing the value of the "Qty to Refund" of any order item. When clicking this button, the following Javascript function is triggered:

submitAndReloadArea($('creditmemo_item_container'),'http://store_url.com/admin/sales/order_creditmemo/updateQty/order_id/xxxx/key/yyyy/')

The whole "#creditmemo_item_container" HTML area gets reloaded and the "Return to Stock" column reappears. It seems like the template files I have overwritten are still being used when calling that function. How could I fix this so the template files of my custom module are used instead (just like the first time the page is loaded)?


texts: How to remove zoom from product details page on 1.9 RWD theme

texts:
How do you remove the zoom feature from Magento 1.9's rwd theme?

I can remove it with css

div.zoomContainer {
  display: none;
}

But I don't think this is the best method?  It would be better to remove it from a template file or with xml.

I've tried editing the template/catalog/product/view/media.phtml but had no luck.


texts: Magento2 - Override Magento/Checkout/view/frontend/web/js/view/shipping.js

texts:
How can we override  Magento/Checkout/view/frontend/web/js/view/shipping.js file?

I need to add some custom code to selectShippingMethod function so i can hide/show a block if a specific shipping method is selected.

Is there a better way to do this?

Thank you!


texts: Button click to show custom static block in popup in magento 1.9

texts: I have a custom static block and on my CMS page, I have a button, when the user clicks the button, I need to show the static block in the popup. How can I achieve this in Magento 1.9, can anyone help me?.


texts: Magento 2 Invoice PDF logo looks blurred

texts: I have uploaded Invoice logo with size 200X50 as recommended. However when the invoice is downloaded the image looks blurred and takes the dimensions about 309X79. Any idea why is it taking this size? Where Can I check?


texts: Override - Display the vendor list in category home page instead of products

texts:
I have installed separate module for vendors. I need to display the vendor list on each category home page instead of displaying products.

How to display the vendor / manufacturer list from the selected category in category home page?

As I’m new to Magento, I'm just confused that where the product list controller exist. How to display the manufacturer list without modifying the Magento core code?

I have tried with new module for overriding the existing one. But I’m getting blank page only. I just added some sample text.

What is the clear method for overriding the existing coding and design?

Thanks in advance.


texts: Programmatically created a new category but cannot be found on admin page

texts:
I would like to write some code to create a new category under root category (as shown below).
The new category has been created at database, but I cannot found it on admin page

    /// Get Web Site ID
    $websiteId = $this->_storeManager->getWebsite()->getWebsiteId();
    echo $websiteId."/n/r";

    /// Get Store ID
    $store = $this->_storeManager->getStore();
    $storeId = $store->getStoreId();
    echo $storeId."/n/r";

    /// Get Root Category ID
    $rootNodeId = $store->getRootCategoryId();
    echo $rootNodeId."/n/r";

    /// Add a new sub category under root category
    $categoryTmp = $this->_categoryFactory->create();
    $categoryTmp->setName('test');
    $categoryTmp->setIsActive(true);
    $categoryTmp->setUrlKey('test5');
    $categoryTmp->setData('description', 'description');
    $categoryTmp->setParentId($rootNodeId);
    $categoryTmp->setStoreId($storeId);
    $categoryTmp->save();


texts: Cannot upload Product image after migration

texts:
I recently migrated my magento site from one server to another but I noticed I cannot upload images, actually when i cleared image cache, all product images disappeared. Here is a screenshot of the error received.

I have given suggested permissions to the respective folders but I am still experiencing the same issue. I noticed the product image was been pulled from /media/catalog/product/cache. Once i deleted that folder, all product images from frontend disappeared, however, backend images are showing


texts:
I have just created one module after checkout success event in Magento.

  etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Tech_Paymentinfo>
            <version>0.1.0</version>
        </Tech_Paymentinfo>
    </modules>
    <global>
        <helpers>
            <paymentinfo>
                <class>Tech_Paymentinfo_Helper</class>
            </paymentinfo>
        </helpers>
        <models>
            <paymentinfo>
                <class>Tech_Paymentinfo_Model</class>
                <resourceModel>paymentinfo_mysql4</resourceModel>
            </paymentinfo>
        </models>
        <events>
            <sales_order_place_after> <!-- identifier of the event we want to catch -->
                <observers>
                    <sales_order_place_after_handler> <!-- identifier of the event handler -->
                        <type>singleton</type> <!-- class method call type; valid are model, object and singleton -->
                        <class>paymentinfo/observer</class> <!-- observers class alias -->
                        <method>savePayment</method>  <!-- observer's method to be called -->
                        <args></args> <!-- additional arguments passed to observer -->
                    </sales_order_place_after_handler>
                </observers>
            </sales_order_place_after>
        </events>
    </global>
</config>

And here is my Observer.php file

class Tech_Paymentinfo_Model_Observer
{
    public function savePayment(Varien_Event_Observer $observer)
        {
            //Mage::dispatchEvent('admin_session_user_login_success', array('user'=>$user));
            //$user = $observer->getEvent()->getUser();
            //$user->doSomething();
        }
}

Now I want my custom payment method data after order success.

Can any one help me to sort it out issue.


texts: How to add last modified product date to product page header and last modified category date to category page header?


texts: Can I keep my database and data from installation of Magento?

texts:
I know tables will be created during the installation of a new Magento application.
But what if my database is not empty, will it skip this process during the installation?
I want to use old database structure and also skip any errors occurred during the installation.


texts: Magento 2 PWA Venia No definition MAGENTO_BACKEND_URL error

texts: I install venia store and upward and all then start yarn build and all things looks good but when i try access website i get {"error":"No definition for env.MAGENTO_BACKEND_URL"}, I set it MAGENTO_BACKEND_URL in .env file .


texts:
I have gone through some of the documentation and see it is written that the Dotmailer is bundled with Magento 2. But I cannot see the Dotmailer configuration at the admin side. What could be the problem?

Also, Is it possible to test the Dotmailer in localhost?


texts: How to get the store code in a phtml file of Magento2?

texts: In a custom phtml file I have to get the code associated to the store view (not the Id), any idea how to get this?


texts: Why do I have to refresh Blocks HTML output / Page blocks HTML every other hour?

texts:
Whenever I login to magento backend it shows invalidated Block HTML Cache. This is happening even without making a change to the website or database. Why is that and how to fix it?
I am using Magento ver. 1.9.2.0


texts: Translate text of email footer(Magento 1.9)

texts: I need to translate the text Share the love !. I have added the text in theme's translate.csv file like this "Share the love !","Partagez votre Passion !", but the text not translated in footer(app/locale/en_US/template/email/html/footer.html).I have translated the text by creating footer template for each store view. Is any other way there to translate the text?


texts: How to give custom acces permissions for admin users(roles) to an extension magento

texts:
I have created a admin user in magento and give certain access permissions, and i have an extension called support ticket, i gave user role access to this extension, when i logged in that particular user i am getting an error called access denied for that support ticket extension, when i login as admin it is working fine, and when i changed user role permission from custom to all, every thing is working as expected, but i need to give only this particular access permission,what can i do ?

adminhtml.xml

<?xml version="1.0"?>
<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <support_ticket_ultimate translate="title" module="supportticket">
                                        <title>Support Ticket Ultimate Section</title>
                                        <sort_order>0</sort_order>
                                    </support_ticket_ultimate>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>


texts: Add to chart not working says error in Add.php file as shown in the picture

texts: This is where the error is on $params =$this->get request()->getParams();


texts: How to have irregular price filter ranges?

texts:
If I configure manual price ranges, I can define the step, but that step is a constant for all ranges.

Is there a way to have, for example,

USD 1 to USD 199
USD 200 to USD 499
USD 500 to USD 5,000

Only those filters?

Further more, the filters should be displayed even if no products match a particular filter.

Regards

Jaime


texts:
I want to get an email notification after a new product review is created.

How can I do this with a simple event observer?

I created the following files and directories:

app/etc/modules/MyModule_ReviewNotify.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <MyModule_ReviewNotify>
            <active>true</active>
            <codePool>local</codePool>
        </MyModule_ReviewNotify>
    </modules>
</config>

app/code/local/MyModule/ReviewNotify/etc/config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <MyModule_ReviewNotify>
            <version>0.0.1</version>
        </MyModule_ReviewNotify>
    </modules>
    <global>
        <models>
            <reviewnotify>
                <class>MyModule_ReviewNotify_Model</class>
            </reviewnotify>
        </models>
    </global>
    <frontend>
        <events>
            <review_save_after>
                <observers>
                    <reviewnotify>
                        <type>model</type>
                        <class>reviewnotify/observer</class>
                        <method>reviewSaveAfter</method>
                    </reviewnotify>
                </observers>
            </review_save_after>
        </events>
    </frontend>
</config>

app/code/local/MyModule/ReviewNotify/Model/Observer.php:

<?php
class MyModule_ReviewNotify_Model_Observer
{
    public function reviewSaveAfter(Varien_Event_Observer $o) {

        //$reviewData = $o->getReview()->getData();

        $contactEmail = Mage::getStoreConfig('contacts/email/recipient_email');

        mail( $contactEmail, 'New Review', 'New Review' );
  }
}

Is this correct so far?


texts: Rewrite lib Varien Image and its Adapters classes

texts:
I need to resize images to exact input dimensions (centered crop), so, I have add additional functions to Varien_Image, Varien_Image_Adapter_Gd2, Mage_Catalog_Helper_Image, and Mage_Catalog_Model_Product_Image classes.

I can easily rewrite catalog model and helper classes, but I don't know how to rewrite Varien classes. Currently, I make copies to local folder, it's not the best approach.


texts: Overriding a core controller's preDispatch method

texts:
I need to override a core controller's preDispatch method.  The core controller inherits from Mage_Checkout_Controller_Action, which itself has a preDispatch method that needs to be called.  Since I'm extending from the core controller I want to override, I cannot just call parent::preDispatch(), since that would pull in functionality that I'm trying to avoid.

My question is - How can I call an overridden method that is 2 levels higher in the inheritance chain, or am I just going about this the wrong way?

Update

Apparently this works:

Mage_Checkout_Controller_Action::preDispatch();  (even though that method is not static, I guess you learn something new every day..)

Now my question is: Is there a better way of doing this without having to copy in all functionality from the class I am overridding?

The reason I am attempting this is because I was going down this path, attempting to force Magento to remember address assignments when customers go through multishipping checkout and then subsequently leave.  (FWIW, I found the linked to article great for getting me going in the right direction, but there seems to be a lot missing as far as steps that need to be taken to get this to work).

The controller I'm overriding is the core MultiShippingController which has a redirect back to the Multishipping IndexAction that needs to be avoided.  On a somewhat side-note, I have gotten this functionality mostly complete, save for a few issues (relating to the adding of the first item to the cart and the Mage_Sales_Model_Quote_Item->getQuoteItem() returning null in the addresses.phtml template, though that is an entirely different discussion).


texts: What does the error "Uncaught TypeError: mixin is not a function" mean?

texts: I'm trying to write a Magento Requirejs Mixin, but I'm getting the error "mixin is not a function."  What does it mean?


texts:
I have a problem with OnePageCheckout. Using Magento ver 2.1.8, AheadWorks OnePageCheckout extension and World Pay as a payment gateway.

I get this error:

Payment failed, please try again later One of Token or Payment page config must be provided

Anyone can help? anyone can direct?


texts: How to restrict admin user to log in if already any user logged in

texts:
I know about the feature of Admin Account Sharing of magento2. Using this feature if someone login to admin panel from another device then already logged in user get expired session error and logged out automatically.

But I want if any admin user is already login in admin panel and same user or another user try to login in admin panel then user will get message that any admin user already logged in system.

So Is there any setting in magento2 for this or any extension for this?

If no then How can I develop my own module to to so?


texts: Magento 2 Send email of order place from observer ?

texts:
Event is : checkout_onepage_controller_success_action

How can I send email to Same Customer again who placed order from observer?

Observer:

public function execute(Observer $observer)
{
    $orderIds = $observer->getEvent()->getOrderIds();
    if (count($orderIds)) {
        $orderId = $orderIds[0];
        $order = $this->_orderFactory->create()->load($orderId);
    }
}


texts: Missing setup_module table in Magento 2.3.2 database

texts:
i am missing a table setup_module in magent 2.3.2 database,
the site is working, however i cannot install any extensions as the new tables are not being created due to missing setup_module.
i could figure out the table columns as, not confirmed on data fields

module - PRIMARY KEY TEXT NOT NULL,
data_version - TEXT NOT NULL,
schema_version - TEXT NOT NULL,

if someone can send a screen shot of setup_module it can help.
found a post saying rename env.php and install magento 2.3.2 again


texts: Email friend redirect to login page for guest user. how to allowed them to email without login?

texts: I am using Magento 1.9 On product page when user click on email friend link redirect to login if not logged in. I want to allow them to email friend without login. is it possible? how can i achieve this


texts: Left Column Sidebar Not Showing Up on Shop Pages

texts:
I have a left column static block that shows an image for my CMS pages. Why does this image not show on the Shop left column sidebar as well? When I inspect each element, both have the same div's.

I've included images.


texts: "There are no products matching the selection"

texts:
In magento at my home page i have added the the product block

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

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

And i have added two products with different categories moreover included both the products into a default_category (id:2)

But still i am getting that message so how can i display the products on my home page. I have set the quantity to 5 and 15. Still i dont get those products.

Flushed cached and Re-Indexed them

Looking for help ? Thanks in advance


texts: Remove Customer Welcome Message in Magento 1.9

texts:
I found the switch to remove/edit the guest welcome message fairly easy but have not been so lucky with the customer logged in welcome message.

I have searched all over and have found nothing.  Would someone please point me in the right direction.

Thanks in advance...


texts: Restrict products to purchase using Observer not trigger

texts:
Condition: I have restricted category of products [category id = 680, 894, 895], this category of products should be purchase alone, not mixed with other products.

Workout:
Case 1: If cart had other products, if the customer tries to add restricted category products trigger observer like not eligible to add to cart and display a message like If you want this product, Purchase alone not mixed with other Products

case 2: If cart had a restricted category of products if customer try to add non-restricted products trigger observer like not eligible to add to cart and display a message like Cart has Special Product you can not add another

code :

  app/etc/modules/Gta_KolupadiRestrict.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <!-- Gta_KolupadiRestrict -->
        <Gta_KolupadiRestrict>
            <active>true</active>
            <codePool>local</codePool>
        </Gta_KolupadiRestrict>
    </modules>
</config>

  app/code/local/Gta/KolupadiRestrict/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Gta_KolupadiRestrict>
            <version>1.0.0</version>
        </Gta_KolupadiRestrict>
    </modules>
    <global>
        <models>
            <gta_kolupadirestrict>
                <class>Gta_KolupadiRestrict_Model</class>
            </gta_kolupadirestrict>
        </models>
        <events>
            <checkout_cart_product_add_after>
                <observers>
                    <Gta_KolupadiRestrict_Model_Observer>
                        <type>singleton</type>
                        <class>Gta_KolupadiRestrict_Model_Observer</class>
                        <method>cartevent</method>
                    </Gta_KolupadiRestrict_Model_Observer>
                </observers>
            </checkout_cart_product_add_after>
        </events>
    </global>
</config>

  app/code/local/Gta/KolupadiRestrict/Model/Observer.php

    <?php
    // Mage::log('fine dude', null, 'logfile.log');
    //create class

    class Gta_KolupadiRestrict_Model_Observer
    {

        //create function
        public function cartevent(Varien_Event_Observer $observer)
        {
            // $category_id = array(680, 894, 895) ; //category ids

            // $category_products  = Mage::getModel('catalog/category')
            //                  ->addAttributeToFilter('category_id', array('in' => array('680','894','895')))
            //                  ->setWebsiteId(2);              // load website id

            $product = $observer->getProduct();

            $category_id = $product->getCategoryIds();
            $productCatId  = Mage::getModel('catalog/category')
                                ->setWebsiteId(2)        // load website id
                                ->load($category_id);        // load category

            // check cart qty status
            $cart_qty = (int) Mage::getModel('checkout/cart')->getQuote()->getItemQty();

            //logic
            if($productCatId->getId()=='680' && $cart_qty > 0  ) //680 category id
            {
                Mage::throwException("If you want Kolu Padi, Purchase alone not mixed with other Products");
            }

             //check if cart have products
             $quote = Mage::getModel('checkout/cart')->getQuote();

            foreach($quote->getAllItems() as $item)
            {
                $productCategoryId  = $item->getCategoryIds();

                if($productCategoryId =='680')  //680 category id
                {
                    Mage::throwException("Cart has Special Product you can not add another");
                }
            }
        }
    }
?>

Observer not trigger.  Does anyone help me?


texts: Magento 2.1 : Pager Issue using Controller for frontend

texts:
I use below code in block, so pager is working perfect.

protected function _prepareLayout()
    {
        parent::_prepareLayout();
        if ($this->modelFactory->create()) {
            // create pager block for collection
            $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager');

            $pager->setLimit(2)->setCollection($this->getmodelCollection());
            $this->setChild('pager', $pager);// set pager block in layout
        }
        return $this;
    }

public function getmodelCollection()
    {
        $q = $this->getRequest()->getParam('p', false);
        $limit = 2;

        $Collection = $this->modelFactory->create();
        $Collection->setPageSize($limit)
                      ->setCurPage($q);
        return $Collection;

    }

I try to use below code in controller, But not working. So please if any one know give me answer.

public function execute()
    {
        $pager = $this->layoutFactory->create()
                      ->createBlock('Magento\Theme\Block\Html\Pager');
        $pagerTemp = $pager->setLimit(2)->setCollection($this->getmodelCollection());
        $pagerTemp->setTemplate('html/pager.phtml');

        $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
        $resultJson->setData($pager);
        return $resultJson;
    }

public function getmodelCollection()
    {
        $id = $this->getRequest()->getParam('id', false);
        if($this->getRequest()->getParam('p', false)){
            $q = $this->getRequest()->getParam('p', false);
        }else{
            $q = 1;
        }
        $limit = 2;

        $Collection = $this->modelFactory->create();
        $Collection->addFieldToFilter('category', $id);
        $Collection->setPageSize($limit)
                      ->setCurPage($q);
        return $Collection;
    }


texts:
I have created a configurable product in my store following the Magento official tutorial.
After creating the product, on the website, on the product page the following info appears:

What can I do to make disappear the "+65,50 RON" value next to the quantity of the product?
The Ambalaj attribute is referring to quantity and RON is the currency in my country.
Thank you!


texts: Free Shipping AND Discout on a Product? - Magento2

texts:
Yesterday I did setup a cart price rule where you get free shipping on subtotal which is over 100$.
That works so far.

Now I wanted to make a coupon where I get 5$ discout on a specific product + free shipping.
If I apply the couponcode, the discoumt works fine, but there still are shipping costs.
Its also strange that when I have an order over 100$ with free shipping and I add the coupon code, I get the 5$ discount BUT also shipping costs, even tho the  order is over 100$ anyway..

Thanks everyone!


texts: can 2 configerable products use the same simple products

texts:
Is it possible to do the following:

I have 2 categories, day collection and summer wraps.

I have a product 'monty scarf' which comes in 3 colours and wish to appear in both of the above categories.

BUT I want the images to be different in the product page. So day collection/monty scarf would have day shots of the scarf and summer wraps/monty scarf would have beach scene shots.

If I make 2 sets of the same configurable and simple products using different images I would ended up with a inventory problem as it essential the same stock just a different set of product images.

can I have 2 configurable products, using the different images as above but associate the same simple products so the inventory would be accurate

I am using magento 1.9.1


texts: Magento 2 location of content in getChildHtml()

texts:
I want to know the file location of

customer.form.register.newsletter`' in `$block->getChildHtml('customer.form.register.newsletter');

I find it difficult to find out the location or files related to it.


texts: Magento 2.3.1 Change store view in controller_action_predispatch event

texts:
In my extension, the default storeview is English and I want to set Arabic storeview, only one time when the customer comes first time on my website. I'm using controller_action_predispatch event to check customer comes the first time or not, if not, customer can move to English storeview as well. Following is my piece of code:

  Namespace\Modulename\etc\frontend\events.xml

<event name="controller_action_predispatch">
    <observer name="switch_store" instance="Namespace\Modulename\Observer\SwitchStore" shared="false" />
</event>

  Namespace\Modulename\Observer\SwitchStore.php

protected $storeManager;

public function __construct(
    \Magento\Store\Model\StoreManagerInterface $storeManager
) {
    $this->storeManager = $storeManager;
}

public function execute(\Magento\Framework\Event\Observer $observer) {
    if ($this->firstVisit()) { // Customer's first visit logic inside firstVisit() function
        $storeId = $this->storeManager->getStore($target_store)->getId();
        $this->storeManager->setCurrentStore($storeId);
    }
    return $this;
}

This code is working fine for the first time, but when the user tries to switch English storeview, he/she would be redirected to the same storeview, that is Arabic. I debugged so many times, but in logs, I'm getting perfect output and not reflecting the change on the frontend. I think this is a cache issue, but not sure. Please let me know if anyone has a solution for this.

Thanks in anticipate.


texts: Installation failed, reverting ./composer.json to its original content. Authentication always fail even though the credential are correct in magento 2

texts:
I am alwaays getting the below error when running composer require like that.
I am currently giving the authentication keys but still it displays error. Please help
Installation failed, reverting ./composer.json to its original content.

  [Composer\Downloader\TransportException]
  Invalid credentials for 'http://repo.packagist.org/p/facebook/webdriver%24155308e10882efda6fe26ab952b4612ffe5058672
  9c4cfe08166806e1a94fff8.json', aborting.


texts: expired sale price retained in customer cart

texts:
I'm new to Magento, and setting up a cart using Magento 2.4.1, CE 2.4.1 (on Debian 10).
Problem:

customer logs in and puts sale item in cart, then goes away without
checking out
sale expires
customer logs in after sale has expired, item in cart still has sale
price

This is not good, I do not want the now-expired sale price reflected in the cart.
Can someone tell me how to fix this?
Thanks,
Evelyn


texts: Magento 2 Installation Issue with file permission and missing resources

texts:
So far my experience with magento 2 hasn't been great. I've been trying to configure magento on a hosting for 3 long days. Previously after installation, it only loads one time and then keep giving me a broken screen with missing resources. I've tried every solution god google blessed me with, but no success. I've tried removing content from pub/static/. I've tried changing app/etc/di.xml as many have suggested, still the problem persist. I've even changed permissions to directories, nothing helped. After all the hard work i've changed permissions of var/ and pub/static to 777 and it FINALLY worked.

Now, even i can load my site properly, there still are some missing resources on front end and backend as well.
See, frontend:
http://screencast.com/t/hhqu1SEyu

On backend, problem is even worse:
http://screencast.com/t/DqVzxnMhqOw

I can't even change store configuration, it just keeps loading.

Can someone possibly help me out with what could be the possible issue causing this?

Thanks!


texts: How to Run Magento 1.9 Api from Javascript

texts:
I want to run Magento Apis using JavaScript and person certain functions such: get all orders, get specific order, create shipment etc,

Now I have seen other tutorials and i can run Magento Apis through PHP. but i haven't found a much things on running Apis through JS or other languages other than PHP. is there any way.

Kindly help


texts:
My system.log generates 6 Million lines in 2 weeks with only the date and this error:

DEBUG (7): cpid:

Why?How can I solve this problem?
Thanks


texts: I have enabled Google Tag Manager from admin panel and in checkout page when I refresh the page new address disappears. If I disable GTM checkout page works properly. Anybody faced the same issue? Any solution for this ?


texts: Notice: Undefined index: magento_eav_attribute_set in/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

texts:
bin/magento setup:upgrade

Notice: Undefined index: magento_eav_attribute_set in /vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

If I understand correctly this is about missing a table in database, but how to check if we have some application that can use it, because honestly I don't know how to look for it or how this table should look like.

Oh yes, we did setup:di:compile and reindex, nothing helps

Update: we create a table with this name and got a new error

SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint 'EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID' to system tables, query was: ALTER TABLE `eav_attribute_set` ADD CONSTRAINT `EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`)  ON DELETE CASCADE


texts:
I have a strange problem on my test system. I'm quite new to magento and think this problem might exist, because it is a test system.

I have some products with related products. If I try to add a product to the shopping cart with it's related product(s). The related product(s) do not get added to the cart.

My first guess was a broken javascript but everything seems to be ok there. My next step was to get myself temper data for firefox. I have verified, that the PostData contains:

product         = $id_of_product
related_product = $id_of_related_product
qty             = $qty_of_product

Still the related product does not get added to the cart. Could this be a problem with the setup of the test system? Changing the quantities works fine for the normal product. Changing the id of the related_product to the id of another product does not add anything to the cart, too.

Thanks in advance

EDIT

Ok, as others might have the same problem I leave the original question and describe here how to debug this.

The first thing to do is to deactivate all modules in local and community. The easiest way is to temporarily rename the folders app/code/local and app/code/community and test if it works afterwards. If it does not work you have to search further.

If the error still persists check the post message sent to the server. An easy way to do this is to get the Tamper Data addon for firefox. If the post message does not look like the message in the picture:

The error is probably inside the JavaScript of your app/design/frontend/base/default/template/catalog/product/list/related.phtml file. Change the path to the theme you are using.

The POSTDATA field should contain related_product=Comma_Separated_Ids_Of_Selected_Related_Products

If everything looks good so far, the mistake is somewhere in the code of magento. How magento adds products to the cart is described in a blog post here: http://www.ecomdev.org/2012/12/12/magento-checkout-shopping-cart-flow.html

The POSTDATA is computed in app/code/core/Magento/Checkout/controllers/CartController.php at the lines below

        193  $cart->addProduct($product, $params);
        194  if (!empty($related)) {
        195      $cart->addProductsByIds(explode(',', $related));
        196  }

Make sure the $related variable contains the ids of your related products.

If this is the case this will lead you to app/code/core/Mage/Checkout/Model/Cart.php where in my case the error was.


texts: Magento 2: Page template is coming blank

texts:
I created a theme in magento 2 and in that theme i created a new page layout.

I can see the page layout in my magento admin dashboard.

So i assigned the page layout to my homepage.

But now my home page is coming blank.

My theme Code

Registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Magento/DrugTheme',
    __DIR__
);

Theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>Magestore Simple Theme</title> <!-- your theme's name -->
     <parent>Magento/luma</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
     <media>
         <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
     </media>
 </theme>

layouts.xml

<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd" layout="1column">
    <layout id="test">
        <label translate="true">Full Layout</label>
    </layout>
</page_layouts>

And finally my
test.xml (My page layout file)

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
   <update handle="2columns-left"/>
   <referenceContainer name="page.wrapper">
       <referenceBlock name="breadcrumbs" remove="true"/>
   </referenceContainer>
   <referenceContainer name="columns">
       <referenceContainer name="div.sidebar.main" remove="true"/>
   </referenceContainer>
</layout>


texts: How to read product options values in cart on catalog_product_load_after event

texts:
I need to read the product options values just after a product is added to cart. I then have an observer on catalog_product_load_after (I use this event as trigger as my method is also called for product page which run the same event)

I tried to do :

$_product = $observer->getEvent()->getProduct();
$options = $_product->getOptions();

But it does not work…

Thank you for your help,

Alex


texts: How to get email address by order id in Magento 2?

texts:
I have a controller that load order like this:

$order = $this->_objectManager->create('\Magento\Sales\Model\Order')->load($id);

Is there a way to get a customer e-mail address by load order by id like this?


texts: How to solve session_generate_id exception in magento2?

texts:
Getting error

  1 exception(s):
  Exception #0 (Exception): Warning: session_regenerate_id(): Session object destruction failed.  ID: user (path: D:\Projects\xampp\tmp) in \vendor\magento\framework\Session\SessionManager.php on line 504


texts: Filter to the magento admin grid column with renderer value

texts:
I got stuck into the magento admin grid. I need to put the filter on the grid column. which has value YES and NO.

But YES and NO are decided from the many conditions. I have one renderer file for delivering the value for column and in that file there are lots of conditions. By passing through lots of conditions I have decided that particular row should have YES/No or BLANK.

And I don't know how to put a filter above the column. I cant put the same logic to the filter callback as there are already around 200 lines conditions have been put to the renderer files.

Please suggest a way to achieve this.

Thank you.

Here is my code
Grid.php

$this->addColumn('mailSent', array(
        'header'            => Mage::helper('vendor')->__('Other Updates'),
        'renderer'          => 'Namesapce_Modulename_Block_Adminhtml_Vendor_Order_Renderer_Mailsent',
        'option'            => $this->getVendorIds(),
        'type'              => 'options',
        'options'           => Mage::getModel('vendor/vendor')->getOptionArray(),
        'column_css_class'  => 'mailsent-td',
        'width'             => '4px'
));


texts: How to show all products on category pages in Magento 2

texts: How to list all products on my category pages as default?


texts: Single user account per email domain-name

texts:
Recently I came along a simple idea to prevent multiple users of the same company. A lot of our customers use their company email address when they try to create an account. Almost none of them use Gmail or Hotmail. So to prevent multiple accounts per domain, I would like to build a check which queries the database for " LIKE %domeinname.com% " (or something like that).

I've been searching on the interwebs for some information but couldn’t find any which can help me realize this feature. I'm a PHP developer with not much know-how of Magento. This is the reason why I would like to receive basic information on how to build or start with this extra check inside the registration process.


texts: Bundle or Group Product for Digital and physical products

texts:
I am having issues trying to allocate a digital product as well as a physical product to be sold in a bundle or group. I have read comments above but it does not help with Shipping costs? If I add the mp3 for downloading the shipping disappears and if I change to physical I cannot attach the downloadable content.
Is there a way to get downloadable as well as physical sold together and have a shipping option?


texts: filter product follow condition magento 2

texts:
public function getLoadedProductCollection()
    {
            $this->_limit = (int) $this->getWidgetCfg('limit');
            $type = $this->getTypeFilter();
            $fn = 'get' . ucfirst($type) . 'Products';
            $collection = $this->{$fn}();

            echo "<pre>";
            $condition = $this->getWidgetCfg('parameters');
            var_dump($condition);

            if ($this->_stockConfig->isShowOutOfStock() != 1) {
                $this->_stockFilter->addInStockFilterToCollection($collection);
            }
            $this->_eventManager->dispatch(
                'catalog_block_product_list_collection',
                ['collection' => $collection]
            );

        return $collection;
    }

how to use condition do a filter product list in Magento 2.please give me your answer.

this is a product list I want to filter and condition(var_dump)


texts: Image upload auto selection as base, small and thumb

texts:
I was just wondering if there is a way the image radio button auto select as base, small, thumb so I don't have to select manually every time when uploaded.
Screenshot

Thanks


texts: How to make grouped products table show in its own row above the details tab and below the images/short description?

texts:
If it's a grouped product then how do I show the products table above the details tab in the Luma theme?

See this image to for a better explanation:

Basically, I want it to work as follows:
If the product type is 'grouped' then display grouped product in its own row that is full-width.


texts:
Frontend show message "Merge for content type" when Upgrade magento 2.1.8 to version 2.2.2 :

  1 exception(s):
  Exception #0 (InvalidArgumentException): Merge for content type '' is not
  supported.

  Exception #0 (InvalidArgumentException): Merge for content type '' is not
  supported.

#0 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/View/Page/Config/Renderer.php(254): Magento\Framework\View\Asset\MergeService->getMergedAssets(Array, '')
#1 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/View/Page/Config/Renderer.php(342): Magento\Framework\View\Page\Config\Renderer->processMerge(Array, Object(Magento\Framework\View\Asset\PropertyGroup))
#2 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/View/Page/Config/Renderer.php(239): Magento\Framework\View\Page\Config\Renderer->renderAssetHtml(Object(Magento\Framework\View\Asset\PropertyGroup))
#3 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/View/Page/Config/Renderer.php(226): Magento\Framework\View\Page\Config\Renderer->renderAssetGroup(Object(Magento\Framework\View\Asset\PropertyGroup))
#4 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/View/Page/Config/Renderer.php(99): Magento\Framework\View\Page\Config\Renderer->renderAssets(Array)
#5 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/View/Result/Page.php(249): Magento\Framework\View\Page\Config\Renderer->renderHeadContent()
#6 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#7 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#8 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#9 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#10 /home/prabhsim/public_html/grittyearth.com/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(39): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#11 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#12 /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#13 /home/prabhsim/public_html/grittyearth.com/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#14 {main}

Could you please help me?


texts:
Clean the cache in magento

 Mage::app()->getCacheInstance()->clean();

1 . How the above code will work ? it will remove all the cache or any particular instance or page.
     suppose I will add this code on any block initialization code like below.

class Fishpig_Wordpress_Block_Sidebar_Widget_Menu
{
    /**
     * Generate the Menu HTML
     *
     * @return $this
     */
    public function _beforeToHtml()
    {
        parent::_beforeToHtml();

        Mage::app()->getCacheInstance()->clean();
        $menuBlock = $this->getLayout()->createBlock('wordpress/menu')
            ->setMenuId($this->getNavMenu())
            ->includeWrapper(true);

        $this->setMenuBlock($menuBlock)
            ->setMenuHtml($menuBlock->toHtml())
            ->setTitle($menuBlock->getTitle());

        return $this;
    }
}


texts: can we use fedex shipping method for india store by inbuilt magento fedex functionality?

texts: We need Fedex shipping method for our India store. I tried to configure it through admin panel by putting all settings but it is producing default Fedex shipping method error. Can anyone let me know that Fedex shipping method can be used for India specific store? It would definitely worked for US and Canada but for other countries don't know. Can any one let me out from this issues?


texts: Magento 2 : on Entering city show shipping method, till then hide shipping method in checkout page

texts:
I need to hide shipping method till user enter city name.

when the user enter the city name the shipping method to be shown and work as it was working naturally on checkout page


texts: How we can add custom attribute in attribute form using observer?

texts:
I want to add the new custom attribute on attribute form to select attribute set when creating an attribute.

I've checked an event in Magento 'adminhtml_catalog_product_attribute_edit_frontend_prepare_form' but how we can use it in observer means addField code and what we will return on that?


texts: Importing CMS pages from Homestead to Magento 2.0

texts: We are using Magento 2.0. Our previous website was on Homestead CMS. We want to bring all the pages from homestead to Magento 2.0. Please help


texts: Multi-Domain Stores, One Secure Domain for Checkout, good practise?

texts:
So this is my lay-out:

Multi-stores on different domains:

domain.com
domain.fr
domain.es
domain.pt

My hosting doesn't have multidomain SSL licence so I can only use the SSL on one domain.

since the base domain is always the same and only the extension changes, I was thinking of using secure.domain.com for secure checkout.

From what I have ready this is easily done on magento, but I have some questions:

Is it a good practise to do this?
The user won't see "warnings" like "You are changing website be careful", etc?
I only want to use secure domain on check-out, no need to do it on login/account, can this be done?
Will it work even if the domain.com store doesn't have the same products has the other stores?

Thank you!

Tiago


texts:
I need get first subcategory name in current category how in admin panel. How it possible.

Update:

<?php
    $layer = Mage::getSingleton('catalog/layer');
    $_category = $layer->getCurrentCategory();
    $currentCategoryId= $_category->getId();
    $children = Mage::getModel('catalog/category')->getCategories($currentCategoryId);
    foreach ($children as $category)
    {
          echo $category->getName();
    }
    ?>

with this code i can get all subcategory name in current category, but i need get only first subcategory name - not all list subcategory name


texts: How can we stop a Magento site clone from redirecting back to live site?

texts:
We're using Magento Community edition version 1.7.0.2
When we clone, the cloned site always redirects from the clone back to the live site.

We've tried the following two cloning methods:
- using the Clone button in cPanel's Installation to produce a clone on the same server
- porting the entire site to another server
We encountered the same redirect problem with both methods.

How can we stop it from redirecting back to the live site?


texts: Magento 2.3.1 - Update Cart Quantity Empties Cart when pressing ENTER

texts: I have just updated to Magento 2.3.1 and noticed that whenever a customer goes to his cart and changes the quantity of an item and press ENTER, then the whole cart gets empty instead to updating the new quantity. Is there a way to change this?


texts: Magento 2 Email not receiving after order

texts: Magento order emails not receiving, is that any particular setting in default magento 2?


texts: how can I append custom block to head in adminhtml controller action

texts:
I was trying to add a block to the head in magento backend for a specific controller action.

public function updateAction(){

    $block = $this->getLayout()->createBlock(
        'Mage_Core_Block_Template',
        'namespace_update_form_head_data',
        array(
            'template' => 'namespace/update/head/data.phtml'
        )
    );

    /**
     * @var Mage_Adminhtml_Block_Page_Head
     */
    $head =$this->getLayout()->getBlock('head');
    $head->append($block);
}

However nothing is output in the head

If I use getBlock('content') or getBlock('js') instead of getBlock('head') for example it works fine but outputs the text at the content area as expected or at the end of body.

If I try $head->addCss() or $head->addJs() they both work fine too and I can add specific js or css files but I can't append a block template.

Could anyone explain to me why it's not loading the block and how to properly load it if possible?

Thanks in advance


texts: M2.2.5. Editing the checkout page successfully but the page doesn't look the same

texts:
I wanted to change the order of a few fields on the checkout page, and I was able to do it by copying the checkout_index_index.xml in app/design/frontend/Vendor/theme/Magento_Checkout/layout/ and making changes.

My code looks like this :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root" template="Magento_Checkout::onepage.phtml">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shippingAddress" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <!-- The name of the form the field belongs to -->
                                                        <item name="shipping-address-fieldset" xsi:type="array">
                                                            <item name="children" xsi:type="array">

                                                                <item name="region_id" xsi:type="array">
                                                                    <item name="sortOrder" xsi:type="string">70</item>
                                                                </item>

                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

And it works

Now, my page (prior to the changes) looks like this:

And after the changes look like this:

As you see the page doesn't render how it should be rendering. Is it because of css? Maybe I am not referencing the file correctly?

For reference here is the original checkout_index_index.xml  pastebin-link

But even though in the beginning I used the whole file as is in the app/design/... and I had the same problem. Maybe the file doesn't see the CSS/JS files?

I am open to any ideas!


texts: Customer address attributes of type datetime and decimal cannot be cleared from the admin

texts:
I have added custom datetime and decimal attributes to the customer address entity using update scripts such that they can be edited via the admin. Although it is possible to add or update the attribute values, it is not possible to clear them.

When adding similar attributes to the customer entity, it is possible to clear those attributes.

I am wondering what could the cause of this issue. Looks like a Magento bug to me.


texts:
Is there any way to add video url in magento2 bulk import.

if that is not possible how can i add product video programmatically in magento2


texts: why checkout and cart page not showing in magento 2

texts:
my site not showing checkout and cart page
why this happening ??
Checkout page

Cart page

can anyone find the solution


texts:
I have a couple of extensions which are not compatible with SUPEE-6788. I wish to disable them until the vendors have updated them but the question is would they still be a security risk?

I presume it wouldn't be as the extensions would be disabled but I thought it might be good to get confirmation


texts: Magento subscription at checkout extension attribute not saving

texts:
I am using a free extension to add the subscribe checkbox on checkout, the field is visible there but when I submitting shipping information the extension attribute is not included in the post.
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\Checkout\Model\ShippingInformationManagement">
        <plugin name="save-newsletter-subscribe-in-quote"
            type="Ulmod\CheckoutNewsletterSubscription\Model\Plugin\Checkout\ShippingInformationManagement" sortOrder="10"/>
    </type>
    <type name="Magento\Checkout\Api\ShippingInformationManagementInterface">
        <plugin name="save-newsletter-subscribe-in-quote"
            type="Ulmod\CheckoutNewsletterSubscription\Model\Plugin\Checkout\ShippingInformationManagement" sortOrder="20"/>
    </type>
    <type name="Ulmod\CheckoutNewsletterSubscription\Observer\OnSalesModelServiceQuoteSubmitSuccess">
        <arguments>
            <argument name="subscriber" xsi:type="object">UlmodCheckoutNewsletterSubscriptionModelSubscriber</argument>
        </arguments>
    </type>
</config>

ShippingInformationManagement.php
<?php
/**
 * Copyright © Ulmod. All rights reserved.
 * See LICENSE.txt for license details.
 */

namespace Ulmod\CheckoutNewsletterSubscription\Model\Plugin\Checkout;

use Magento\Quote\Model\QuoteRepository;
use Magento\Checkout\Model\ShippingInformationManagement as ShippingManagement;
use Ulmod\CheckoutNewsletterSubscription\Block\CheckoutSubscription;
use Ulmod\CheckoutNewsletterSubscription\Model\Config\Source\CheckoutSubscribe;
use Magento\Checkout\Api\Data\ShippingInformationInterface;

class ShippingInformationManagement
{
    /**
     * @var CheckoutSubscription
     */
    protected $checkoutSubscription;

    /**
     * @var QuoteRepository
     */
    protected $_quoteRepository;

    /**
     * @param QuoteRepository $quoteRepository
     * @param CheckoutSubscription $checkoutSubscription
     */
    public function __construct(
        QuoteRepository $quoteRepository,
        CheckoutSubscription $checkoutSubscription
    ) {
        $this->_quoteRepository = $quoteRepository;
        $this->checkoutSubscription = $checkoutSubscription;
    }

    /**
     * @param ShippingManagement $subject
     * @param $cartId
     * @param ShippingInformationInterface $addressInformation
     */
    public function beforeSaveAddressInformation(
        ShippingManagement $subject,
        $cartId,
        ShippingInformationInterface $addressInformation
    ) {
        $extensionEnabled = $this->checkoutSubscription->getConfigModule('enabled');
        if ($extensionEnabled) {
            $newsletterSubscribe = 0;

            if (in_array(
                $this->checkoutSubscription->getConfigModule('checkout_subscribe'),
                [CheckoutSubscribe::FORCE_INVISIBLE, CheckoutSubscribe::FORCE]
            )) {
                $newsletterSubscribe = 1;
            } elseif (($extAttributes = $addressInformation->getExtensionAttributes())
                && $extAttributes->getNewsletterSubscribe()
            ) {
                $newsletterSubscribe = 1;
            }

            $quote = $this->_quoteRepository->getActive($cartId);

            $quote->setNewsletterSubscribe($newsletterSubscribe);
        }
    }
}

I have checked this code
$addressInformation->getExtensionAttributes());
$extAttributes->getNewsletterSubscribe();

It's returning nothing.
Any solution to resolve this


texts: Cache files being set by magento to 0600

texts:
I'm running magento 1.5 and in logs I see a lot of errors:

  var/cache/mage--5/mage---internal-metadatas---080_CONFIG_GLOBAL_CRONTAB):
  failed to open stream: Permission denied

the permissions for files in cache/mage--0/mage-- are 0600. Which I think is wrong and should be 0644. But when I reset them after an hour they get back to  0600. I think the magento cron user is wrong or something in that direction but cannot progress any further.

Any ideas where to look?

I think the issue started when I applied the 7405 v.1.1 supee patch, but not 100% sure.

Tried resetting permissions, deleting cache, varnish etc.


texts: Undefined Index error when attempting to setup:static-content:deploy. How to fix?

texts:
What am I attempting to do here?:
In the console I kept getting a message that says 404: unable to find styles-m.css.
It finds styles-l.css and print.css but not mobile, no matter what I do.

Google searches told me that I need to do deploy static content to get this working properly (I don't get why but ok). So upon doing this, I get the following messages shown in the image.

So essentially, I don't care much for the deploy static content part, I just want to fix the styles-m so that I don't get the error message. However, if this error message I just got about the index will come to bite me later on, I'd like to fix this as well.

Any and all help is greatly appreciated.


texts: How do I correctly access WSDL for SOAP connection?

texts:
When running this, I only get an "HTTP ERROR 500" page. As I've seen in other solutions I've added the 'index.php' before the /api section. I've also enabled WSI-Compliance mode as I've seen suggested.

<?php
    $proxy = new SoapClient('http://stagingsite.club/index.php/api/v2_soap/?wsdl');
    $sessionId = $proxy->login('inventory', 'password');

    $result = $proxy->catalogCategoryTree($sessionId);
    var_dump($result);
?>

This is how Magento documentation lists the path

$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

I'd like to point out that on my web server, I do not have a similar path. I'm confused in that I don't completely understand the concept of WSDL. Is the WSDL file created, or is it an actual file that I need to find in my directory? I've ensured that SOAP is enabled.


texts: Customer Attributes in custom tab in admin

texts:
I'm trying to create a new attribute on customer but in backend, the attribute is getting saved under Account Information tab and I want it to be under a Custom Tab that I created (or create a new tab with attribute code id?). Here's what I have in my installer script

$installer = $this;

$installer->startSetup();

$entityTypeId = Mage::getModel('customer/customer')
    ->getResource()
    ->getTypeId(); //customer entity type

$attributeSet = Mage::getModel('eav/entity_attribute_set')
    ->setEntityTypeId($entityTypeId)
    ->setAttributeSetName("Marketing");

$attributeSet->validate();
$attributeSet->save();

$model =Mage::getModel('eav/entity_attribute_set')
    ->getCollection()
    ->setEntityTypeFilter($entityTypeId)
    ->addFieldToFilter('attribute_set_name',"Marketing")
    ->getFirstItem();

$modelGroup = Mage::getModel('eav/entity_attribute_group');
$modelGroup->setAttributeGroupName('Marketing Attributes');
$modelGroup->setAttributeSetId($model->getAttributeSetId());
$model->setGroups(array($modelGroup));
$model->save();

$installer->addAttribute("customer", "my_new_attr", array(
    "type"     => "int",
    "backend"  => "",
    "label"    => "Dealer Info Updated",
    "input"    => "select",
    "source"   => "eav/entity_attribute_source_boolean",
    "visible"  => true,
    "required" => false,
    "default"  => "No",
    "frontend" => "",
    "unique"   => false,
    'user_defined' => true,
    "note"     => "To determine whether this Dealer's Info is updated"
));

$attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "my_new_attr");

$attributeSetId = $installer->getAttributeSetId($entityTypeId, 'Marketing');
$attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttributeToSet($entityTypeId, $attributeSetId, 'Marketing', 'my_new_attr', 10);
$installer->addAttributeToGroup(
    $entityTypeId, $attributeSetId, $attributeGroupId, 'my_new_attr', '101'  //sort_order
);

$used_in_forms = array();

$used_in_forms[] = "adminhtml_customer";
$used_in_forms[] = "customer_account_create";
$used_in_forms[] = "customer_account_edit";

$attribute->setData("used_in_forms", $used_in_forms)
    ->setData("is_used_for_customer_segment", true)
    ->setData("is_system", 0)
    //->setData("is_user_defined", 1)
    ->setData("is_visible", 0)
    //->setData("sort_order", 101)
;

// Save Attribute
$attribute->save();

$installer->endSetup();

Is there a way to create this customer attribute under a custom tab?

== UPDATE ==
Here is a screenshot for better understanding of what I want to achieve... the custom attributes created from installer on customer, to be moved or installed in the custom tab:


texts:
Here is my setup: 1 website, 4 stores and 1 storeview by store

I would like to collect the list of my stores.

I created my block named "storenav." In "layout/page.xml" to the desired location, I added:

<block type="page/html" name="storenav" as="storenav" template="page/html/storenav.phtml"/>

For the contents of the block, I created a phtml in which I put the following code:

    <?php foreach ($this->getGroups() as $_group): ?>
        <a href="<?php echo $_group->getHomeUrl() ?>"> <?php echo $this->escapeHtml($_group->getName()) ?>

    <?php endforeach; ?>

I thought it would retrieve the list of my "store", but nothing appears to share a point for the list.

There's something missing in my code? Is it necessary and does it put something else? My approach is not it good?

I'm completely stuck, help me, please

Thank you in advance


texts: Facing this issue, It contains 1 abstract method and must therefore be declared abstract or implement the remaining method

texts:
Facing fatal error given as below.

Fatal error: Class Sugarcode\Test\Model\Total\Fee contains 1 abstract
method and must therefore be declared abstract or implement the
remaining methods
(Magento\Framework\DataObject\IdentityInterface::getIdentities) in
/home/dukaania/public_html/testing2/app/code/Sugarcode/Test/Model/Total/Fee.php
on line 7

Here is my code
    <?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Sugarcode\Test\Model\Total;
class Fee extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\DataObject\IdentityInterface {

     const CACHE_TAG = 'mr_dukaaniatest';
    protected $_cacheTag = 'mr_dukaaniatest';
    protected $_eventPrefix = 'mr_dukaaniatest';

    protected function _construct()
    {
        $this->_init('Sugarcode\Test\Model\ResourceModel\Fee.php');
    }

    /**
     * Collect grand total address amount
     *
     * @param \Magento\Quote\Model\Quote $quote
     * @param \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment
     * @param \Magento\Quote\Model\Quote\Address\Total $total
     * @return $this
     */

   protected $_feeFactory;

    public function __construct(
            \Sugarcode\Test\Model\Total\FeeFactory $feeFactory
            ) {
                  parent::__construct($context);

        $this->_feeFactory = $feeFactory;

    }

    public function collect(

    ) {
        parent::collect($quote, $shippingAssignment, $total);
    }

public function getIdentities();

 public function fetch() {

        $fee = $this->_feeFactory->create();
        $collection = $fee->getCollection();
        foreach($collection as $item){
            \Zend_Debug::dump($item->getData());
        }
        exit();
    }

      public function execute()
    {
        $fee = $this->_feeFactory->create();
        $collection = $fee->getCollection();
        foreach($collection as $item){
            \Zend_Debug::dump($item->getData());
        }
        exit();
    }

    /**
     * Get Subtotal label
     *
     * @return \Magento\Framework\Phrase
     */
    public function getLabel() {
        return __('Fee');
    }

}


texts: Getting ajaxcart.js to load on the cart page

texts:
I have added this bit of code which loads a button onto my cart page which when clicked it opens a pop up window where the customer can select a quantity of the products. The only problems is that the pop up works using the ajaxcart javascript and this isnt being loaded on my cart page.

So my question is how can i get the ajaxcart.js script to load when the cart page is loaded?

If you need more information or i am not being clear please let me know.

Thank you


texts: Disable product url without category path (SEO)

texts:
When I set the option Use Categories Path for Product URLs to Yes, the product-URL changes to the one with categories path. Thats what I need.

But in that case the product is also availible trough domain.com/producturl.

How can I disable that?

This so that a product only got 1 URL, the URL with categories path.


texts: I'm importing a CSV file with 112059 rows with 3 columns each.  That's 336177 entries.  I'm not a genius but I think this'll take longer than 30 seconds to process and upload this many entries to our DB.  How can I expand this timer by about... 10 times?


texts: Use join table to display data in admin grid column

texts:
How can I use join table to display second table data in admin grid? Admin grid is created using layout & block in proper manner.

I used this link (how to create a grid without using ui component in magento 2) as reference.

Using below code I display data

<block class="Magento\Backend\Block\Widget\Grid\Column" name="recipient_email">
                    <arguments>
                        <argument name="header" xsi:type="string" translate="true">Recipient Email</argument>
                        <argument name="index" xsi:type="string">recipient_email</argument>
                        <argument name="renderer" xsi:type="string">Comapny\Module\Block\Adminhtml\Widget\Grid\Column\Renderer\Recipientemail</argument>

                </block>

But issue while searching & sorting

I am using this for overriding the default module of enterprise (gift card account)

Code of

  Company/Module/Block/Adminhtml/Widget/Grid/Column/Renderer/Recipientemail.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Company\Module\Block\Adminhtml\Widget\Grid\Column\Renderer;

class Recipientemail extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{
    protected $_storeManager;

    public function __construct(
        \Magento\Backend\Block\Context $context,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Sales\Model\Order\Item $orderItem,
        array $data = []
    ) {
        parent::__construct($context, $data);
        $this->_storeManager = $storeManager;
        $this->orderitem =  $orderItem;
    }

    public function render(\Magento\Framework\DataObject $row)
    {

        $code = $row->getCode();
        $result = array();
        $salesorderitem =  $this->orderitem->getCollection()
                          ->addFieldToFilter('product_options', array('like' => '%'.$code.'%'));

        if(!empty($salesorderitem))
        {
            foreach($salesorderitem as $orderdata){
                $productOptions = $orderdata->getProductOptions();
                $recipientemail = $productOptions['giftcard_recipient_email'];
                if(!empty($recipientemail)){
                return $recipientemail;
                }else{
                    return '-';
                }
            }
        }else{
               return '-';
        }

    }
    public function getContents($str, $startDelimiter, $endDelimiter) {
        $contents = array();
        $startDelimiterLength = strlen($startDelimiter);
        $endDelimiterLength = strlen($endDelimiter);
        $startFrom = $contentStart = $contentEnd = 0;
        while (false !== ($contentStart = strpos($str, $startDelimiter, $startFrom))) {
          $contentStart += $startDelimiterLength;
          $contentEnd = strpos($str, $endDelimiter, $contentStart);
          if (false === $contentEnd) {
            break;
          }
          $contents[] = substr($str, $contentStart, $contentEnd - $contentStart);
          $startFrom = $contentEnd + $endDelimiterLength;
        }

        return $contents;
      }

}

Code for Adminhtml\Grid\Filter\Recipientemail.php

<?php

namespace Comapny\Module\Block\Adminhtml\Grid\Filter;

class Recipientemail extends \Magento\Backend\Block\Widget\Grid\Column\Filter\Text
{

public function getCondition()
{
    if ($this->getValue() === null) {
        return null;
    }

    return null;
}

}


texts:
Sometimes in module.xml the attribute active="true" is used but I could not find out what difference it makes to use it or not.

<module name="xxxx" schema_version="0.0.1" active="true"/>


texts: Magento2 is not loading di:compile generated files

texts:
I am trying to load Magento\Customer\Api\Data\CustomerExtensionFactory in a plugin using the ObjectManager injected in the Plugin constructor. The file var\generation\Magento\Customer\Api\Data\CustomerExtensionFactory.php does exist. When I run $this->customerExtensionFactory = $objectManager->get(self::CUSTOMER_EXTENSION_FACTORY_PATH); in my Plugin it throws an error: "Notice: Undefined index: instance in \/vagrant\/data\/magento2\/lib\/internal\/Magento\/Framework\/ObjectManager\/Factory\/AbstractFactory.php on line 222"

My Plugin code is this:

<?php

namespace My\Module\Model\Plugin\Card;

use Magento\Customer\Api\Data\CustomerExtensionFactory;
use Magento\Customer\Model\Customer;
use Magento\Framework\ObjectManager\ObjectManager;

class MyPlugin
{
    const CUSTOMER_EXTENSION_FACTORY_PATH = 'Magento\Customer\Api\Data\CustomerExtensionFactory';
    /**
     * @var \Magento\Customer\Api\Data\CustomerExtensionFactory
     */
    protected $customerExtensionFactory;

    public function __construct(ObjectManager $objectManager)
    {
        /**
         * @var \Magento\Customer\Api\Data\CustomerExtensionFactory
         */
        $this->customerExtensionFactory = $objectManager->get(self::CUSTOMER_EXTENSION_FACTORY_PATH);
    }

    public function afterGetDataModel(Customer $customer, $customerDataObject)
    {
        $extension = $this->customerExtensionFactory->create()->setOpenpayCard('aaa-123');
        $customerDataObject->setExtensionAttributes($extension);

        return $customerDataObject;
    }
}

Any ideas on what that may be?


texts: Why registry and setter values are cleared in toolbar block?

texts:
My task is to show sort by panel on top and list pager at the bottom.

I tried that in the file app/design/frontend/project/default/template/catalog/product/list/toolbar.phtml

echo '

';
var_dump($this->getToolBarValue());
$this->setToolBarValue('test');
var_dump($this->getToolBarValue());

It returns this result:

false
true
false // why flase is here?
true

I also tried using the registry. I had the same result.
Any ideas why?


texts: How to make your magento website load faster?

texts:
I need to know how to make My magento website faster because my website is very slow. I have good hosting also but I don't know why it is so slow.
My website doesn't shows the www at the url

please tell me first how can we fix it?


texts: Product import successfully done no errors but no products imported in Magento 2

texts:
I have manually added 400 products in Magento 2.1.7 CE via the backend. There are configurable products involved, their associated simple products, and normal simple products (not associated with configurable products).

I am exporting all products via System->Export and start examining the csv file.
First thing is that in configurable_variations column, not all attributes used for skus associated with each configurable product are in the exported file.
I add those manually. i.e. only color was listed for some products-skus with color and size: I added size as well and vise versa.

Second I need to add these products into 2 different store views (languages -el - en) already created in the backend. Categories, attribute sets etc. are already created too. All exported fields are involved in the import.
Simple products come first in the file, second are simple products associated with configurable and configurable products are last for both store views (800 entries).

I am trying to update products (Add/Update mode), no luck. I manually delete all products and try to import: "Import successfully done", but no products imported. No errors, no logs. I've tried to completely remove description and short description fields, in case improper characters are involved, no luck.

I am convinced I miss something and it's me learning. But is it a typo? how to identify what is wrong in this csv file which is large - not just 2 test products? I have gone through this carefully: https://goo.gl/erH7aQ and have made many updates. I am not sure what is wrong anymore.

Update

Thanks Rajkumar .E. ..basic knowledge: Started with one simple product then a few more, etc and found some problems mainly in Categories. Importing Configurable products is not the most straight forward thing at first, but import works. Last import attempt was still giving "errors" (maybe on something not very important) but also "import successfully done" and data imported. I set "Stop on Error" and Allowed Errors Count to 410

Update

In my case, there was 49 products only and Import was successfully done but, no products were added even after clearing cache and doing re-index. I have recently updated our magento version to 2.2.5 (Community Edition).

I have also tried with removing special character from the CSV but still no success. Let me know if I have to re-post this issue or is there any solution for this.


texts: Magento2 checkout/onepage/success redirects to cart

texts:
When I use PayPal Plus(PayPal, credit cards) ,the checkout success page is not shown. Instead is redirected to checkout/cart/.

The redirection happens in this file:

  Magento\Checkout\Controller\Onepage\Success

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Checkout\Model\Session;

/**
 * Test if checkout session valid for success action
 *
 * @api
 */
class SuccessValidator
{
    /**
     * @var \Magento\Checkout\Model\Session
     */
    protected $checkoutSession;

    /**
     * @param \Magento\Checkout\Model\Session $checkoutSession
     * @codeCoverageIgnore
     */
    public function __construct(
        \Magento\Checkout\Model\Session $checkoutSession
    ) {
        $this->checkoutSession = $checkoutSession;
    }

    /**
     * @return bool
     */
    public function isValid()
    {

        if (!$this->checkoutSession->getLastSuccessQuoteId()) {
            return false;
        }

        if (!$this->checkoutSession->getLastQuoteId() || !$this->checkoutSession->getLastOrderId()) {
            return false;
        }
        return true;
    }
}

I found out that all three :

$this->checkoutSession->getLastSuccessQuoteId()
$this->checkoutSession->getLastQuoteId()
this->checkoutSession->getLastOrderId()

return null.
Obviously there is something to do with the session but this is the furthest I could go.
The orders are completed and successful.Its just the order confirmation page that is not shown.


texts:
Follow the examples of magento, normal text translates correctly, but this links does not translate.

Csv

"Click here and register for free.","Clique aqui e cadastre-se grátis."

Samples that tested

Mage::helper('mymodule')->__('Click here and register for free.', $url);

Mage::helper('core')->__('Click here and register for free.', $url);

$this->__('Click here and register for free.', $url);


texts: "Add and checkout" button with "Add to cart" button - Magento 2

texts:
I need two buttons on product page:

"Add to cart" - adding product to cart and staying on page
"Buy and checkout" - adding product to cart and redirect to checkout page

I know about back-end option "After Adding a Product Redirect to Shopping Cart", but if it's turned on, redirect to checkout will be after click by any of those buttons.


texts:
Hi I'm trying to include an external css/js in Magento. From what I found one suggestion is to put this under

  <module>/view/frontend/layout/default.xml

which is what I did and was able to achieve this. But the issue with this approach is that it's application wide meaning all website, store and other view will have this CSS and JS.

But what I would want is that it should only be applied on a per website level. So let say I have :

**website id = 1** which include **123.css** and **123.js**

**website id = 2** will include **234.css** and **234.js**

But I have no idea on how to achieve this. I'm willing to change my current approach as long as this is achieve. Right now the application is reading from default.xml which all website will include also.

Is there a way to make it so that website 1 will include default1.xml and website 2 will include default2.xml or something? and Magento will include this xml file depending on the website requesting this.

Any suggestion would be much appreaciated. Below is the content of my default.xml

<?xml version="1.0"?>
<page xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <head>
        <!-- Add js using link tag-->
        <link src="js/external_js_include.js"/>
        <css src="css/external_css_include.css" />

   </head>
</page>


texts:
I have a question related with file app/etc/config.php.

This file described here and defined:

  Magento base dir/app/etc/config.php, which contains the list of installed modules, themes, and language packages.

Is like app/etc/modules/* in Magento 1 (Normally I have these files in VCS).

But in Magento 2 is recommended not share in VCS (Official .gitignore).

I have some question or uses cases for share in VCS but I want Understand because is not recommend add in VCS

Production Enviroment (With Deploy System Capistrano/Deployer, etc)

You make a new deployment... and you need enable new/s module/s php bin/magento module:enable VendorName_NewModule before setup:upgrade

How you manage this situation?

You make a new deployment and you need disable (for any situation) new/s module/s php bin/magento module:disable VendorName_NewModule before setup:upgrade

How you manage this situation?

Local Enviroment

If you do not want your team to have a particular module/s enabled/disabled

How you manage this situation?

Staging Enviroment

How can you achieve a same configuration of production enabled/disabled modules if you don't share app/etc/config.php

How you manage this situation? You need make manually?

What is your point of view or how you manage these situations?

Thanks

* VCS : Version Control System, e.g: git, svn, etc


texts: magento load product by id with limit thing

texts:
i wrote a code to get product list by id below is my code :

$category_id = $_GET['category_id'];
$catagory_model = Mage::getModel('catalog/category')->load($category_id);
$collection = Mage::getResourceModel('catalog/product_collection');
$collection->addCategoryFilter($catagory_model); //category filter
$collection->addAttributeToFilter('status',1); //only enabled product
$collection->addAttributeToSelect(array('id','name','url','small_image','price')); //add product attribute to be fetched

$collection->addStoreFilter();

if(!empty($collection)){
    foreach ($collection as $_product){
        $categoryapi['id']=$_product->getId();
        $categoryapi['name']=$_product->getName();
        $categoryapi['price']=$_product->getPrice();
        $categoryapi['image']=(string)Mage::helper('catalog/image')->init($_product, 'small_image')->resize(250, 250);
        $mcat[] = $categoryapi;
    }
}
echo $output = json_encode(array('data' => $mcat));

my code works fine but i want to add limit so it loads products in count of 10 like for first request 1,10 and then 11,20 and then 21,30 and so on .

how can it be done please guide way to do it


texts: Magento server under maintenance after install the extension

texts:
I have installed the extension through Magento connect manager. After installing extension, my site is under maintenance. I have tried these things:

Clear Cache and Session
I will change the index.php file

I did not see the maintenance.flag file in var folder.

Anyone help me.


texts: How to show sold out tag image on out of stock product in magento2

texts:
I want to show the sold out tag image on out of stock product on category page
can any one help me ?
thanks in advance


texts: Products always in stock - even when out of stock?

texts:
So, after trawling through the internet for days and trying hundreds of fixes - i really can't understand why this is happening...

My store configuration is set to show out of stock items and i've enabled it so customers can sign up for updates, however when a product is out of stock it still shows Availability: In Stock on the frontend.

My default.phtml

<?php /* @var $this Mage_Catalog_Block_Product_View_Abstract */?>
<?php $_product = $this->getProduct() ?>
<?php echo $this->getPriceHtml($_product) ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?>
<?php if ($_product->isAvailable()): ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('In stock') ?>

<?php else: ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('Out of stock') ?>

<?php endif; ?>

This only started happening recently (believe it was after an update (recently updated to 1.9.2.1

Any ideas?

Thannks


texts: Input Select File should not allows to override the previous one. is it possible?

texts: Drag and Drop file allows you to override the previous one - should this happen or should it say there's already a file in place? when select next new file.Is there any way to validate previous one file should not overridden.using jquery OR any other way.


texts: switch currency on billing country selection

texts:
My site is setup with USD as the base currency. I am using different payment methods based on countries however I need to have the currency for the transaction processed in CAD (Canadian Dollars) if the users billing address is in Canada.

The best I can tell, I need to add a custom event observer to accomplish this but that's a little more advanced than I'm prepared for. Can anybody provide some direction or alternative solutions? The modules I've seen out there that can accomplish this seem to use GeoIP instead of being based off of a billing address field and this isn't sufficient for our use case.

Thank you,


texts: Magento 2 Main Configurable Products Duplicated in Order Info When Configurations are Ordered

texts:
In our Magento 2.2.7 store we have a number of Configurable Items, they are one Main item with a number of individual items as configurations.

When a customer orders them, they strangely appear as additional items in the order info with a price of £0.00 An example is below.

This is making the invoice of any order with a configurable product a bit difficult to understand.


texts: Why does the create account button not appear on guest checkout success page

texts:
I have a Magento 2.2 site that I have been building, however for some reason the "create account" button does not appear on the checkout success page. There is however an error in the dev tools console.

customer-data.js:85 Uncaught TypeError: Cannot read property
'sectionLoadUrl' of undefined
at Object.getFromServer (customer-data.js:85)
at Object.reload (customer-data.js:299)
at (index):610
at Object.execCb (require.js:1650)
at Module.check (require.js:866)
at Module.<anonymous> (require.js:1113)
at require.js:132
at require.js:1156
at each (require.js:57)
at Module.emit (require.js:1155)


texts: Multi website - how to use media url in phtml file

texts:
i have setup multi website in magento 2.3.4 on single Domain with setting - Add Store Code to Urls

my website URLs are like below now
1: example.com/in
2: example.com/us
i want to call images from media folder , earlier i use below code that is not working after multi store
Earlier code : getBaseUrl(); ?>media/abc.png
Issue : after muti store setup my image URL becomes like example.com/us/media/abc.png and this causes issue with images ,
Please help way to fix it


texts: How to implement dynamic product price calculation on weight basis in magento 1.9?

texts:
I'm developing an eCommerce website in Magento for Silver business. the price of the product is should be in weight basis.

For example today I've added a 1000 rupees silver necklace of 10 grams to my website with the silver rate 40 rupees per gram, by next day silver rate maybe fluctuates and the price of the product needs to be change.

The final product price in the product/list page and cart page = ( today's silver rate x number of grams (1, 2, 3...etc) + making charges ).

Here Silver rate will be fluctuates depending on market rate. I'm new to magento, please guide me with valuable codes.


texts: magento 2 Uncaught TypeError: Cannot read property 'data' of undefined

texts:
Magento 2.3.5 getting error on the product detail page of configurable product -
Getting this error -
Uncaught TypeError: Cannot read property 'data' of undefined
    at Object.returnCurrentImages (eval at require.load (VM605 static.js:340), <anonymous>:508:46)
    at $.<computed>.<computed>._onGalleryLoaded (eval at require.load (VM605 static.js:340), <anonymous>:706:62)
    at $.<computed>.<computed>.eval [as _onGalleryLoaded] (eval at require.load (VM605 static.js:340), <anonymous>:102:41)
    at HTMLDivElement.dispatch (eval at require.load (VM605 static.js:340), <anonymous>:5234:27)
    at HTMLDivElement.elemData.handle (eval at require.load (VM605 static.js:340), <anonymous>:4886:29)
    at Object.trigger (eval at require.load (VM605 static.js:340), <anonymous>:5138:13)
    at Object.jQuery.event.trigger (eval at require.load (VM605 static.js:340), <anonymous>:635:22)
    at HTMLDivElement.eval (eval at require.load (VM605 static.js:340), <anonymous>:5868:18)
    at Function.each (eval at require.load (VM605 static.js:340), <anonymous>:378:20)
    at jQuery.fn.init.each (eval at require.load (VM605 static.js:340), <anonymous>:144:18)

Why we are getting this error and how can we solve this ?


texts: Magento 2 : Button Onclick Method Executed Before Button is Clicked

texts:
I got following code:

<?php
namespace UV\PrintBestellschein\Block\Adminhtml;
use Magento\Framework\App\Filesystem\DirectoryList;
class PrintBestellscheinButton extends \Magento\Backend\Block\Widget\Container
{

    protected $coreRegistry = null;
    public function __construct(
        \Magento\Backend\Block\Widget\Context $context,
        \Magento\Framework\Registry $registry,
        \UV\Bestellung\Model\Order\Pdf\Shipment $pdfGenerator,
        array $data = []
    ) {
        $this->pdfGenerator = $pdfGenerator;
        $this->coreRegistry = $registry;
        parent::__construct($context, $data);
    }

    protected function _construct()
    {
        $this->addButton(
            'uv_printbestellschein',
            [
                'label'   => 'Bestellschein drucken',
                'class'   => 'print',
                'onclick' => 'setLocation(\'' . $this->startDownload() . '\')'
            ]
        );

        parent::_construct();
    }

    public function startDownload() {

        $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
        $order = $objectManager->create('Magento\Sales\Model\Order')->load($this->getOrderId());

        if($order->hasShipments()) {
            #Sendungen vorhanden
            $shipments = $order->getShipmentsCollection();
            $content = $this->pdfGenerator->getPdf($shipments);
            $fileFactory = $objectManager->get('\Magento\Framework\App\Response\Http\FileFactory');
            $fileFactory->create('packing-slip.pdf', $content->render(), DirectoryList::VAR_DIR , 'application/octet-stream');

        } else {
            #Keine Sendungen vorhanden
        }
    }

    public function getOrderId()
    {
       return $this->coreRegistry->registry('sales_order')->getId();
    }
}

The button is successfully added to

  sales_order_grid

When I click on an order it starts download, which only should start when I press the button.

Why is that happening? Thanks!


texts: Multiple knockout uiComponents should not share the same data / seperate view instances

texts:
I am initializing the same uiElement multiple times on the same page (on checkout_cart_index / one per cart item)

        <div class="configuration-check" data-mage-init=
        '
                { "Magento_Ui/js/core/app":
                    {"components":
                        { "configurationCheck" :
                            {
                                "component": "configurationCheck",
                                "template" : "Example_Upload/configuration-check",
                                "config" : <?php echo $itemInfo->asJson() ?>
                            }
                        }
                     }
                  }
            '
             data-bind="scope:'configurationCheck'"
        >
            <!-- ko template: getTemplate() --><!-- /ko -->
        </div>

configuration-check.js looks like this:

define([
    'uiComponent'
], function (Component) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'Example_Upload/configuration-check'
        },
        /** @inheritdoc */
        initialize: function () {
            this._super();
            return this;
        },

        getInfo: function (field) {
            return this[field];
        }
    });
});

In the template I use getInfo() to get the config data which was given in the initialization.

Now the effect is, that both cart items show the same data, even they are different.

Can this easily be fixed or am I doing a completely wrong approach?

EDIT: I found how to create multiple instances of a view - but how can this be done during Magento's initialization of the components?

EDIT2: I think I need a different component name for each instance. Maybe it can work with a different name or namespace setting in the JSON passed to data-mage-init - but I did not yet find the right combination to make it work.


texts:
After updating a Magento shop from 1.9.2.* to 1.9.3.7 and migrating it to a new server, everything works good so far. However, opening Customers -> Manage Customers in the Admin panel just shows no list. Please see the picture:

There is no exception.log. But checking the system.log it shows the following Warning:

2018-04-08T06:13:47+00:00 ERR (3): Warning: include(Customer.php): failed to open stream: No such file or directory  in /var/www/.../htdocs/lib/Varien/Autoload.php on line 94
2018-04-08T06:13:47+00:00 ERR (3): Warning: include(Customer.php): failed to open stream: No such file or directory  in /var/www/.../htdocs/lib/Varien/Autoload.php on line 94
2018-04-08T06:13:47+00:00 ERR (3): Warning: include(): Failed opening 'Customer.php' for inclusion (include_path='...')  in /var/www/.../htdocs/lib/Varien/Autoload.php on line 94

Unfortunately the warning does not contain a path. And Customer.php is pretty general. Doing a file search for Customer.php on the server returns multiple results in different directories.

What is the cause of the problem here? Thank you.


texts: How to set template in custom block in Magento2?

texts:
I want to set template in Block custom.php. how can i do it?
I tried following:

protected function _prepareLayout() {
        $this->getLayout()->createBlock('Xyaddons\Productzoom\Block\Product\View')->setTemplate('product/image.phtml')->toHtml();

        return parent::_prepareLayout();
    }

it's not running successfully.

Add new quetion

I want create funcion in custom block use to set template. it same

public function setCustomTemplate(){
    if($isActive ==="1"){
       return $this->getLayout()->getBlock('.....')->setTemplate('custom/view.phtml');
      }
}

how do it? any thank help :)