texts: Set product in stock and change the status to Enabled if qty is equals or greater than 1

texts:
I'm trying to do this for a while, but there's something isn't right about this, I've tried to put it in stock and enable it but nothing is working for me, can someone give me a hint or pinpoint me to the issue?

<?xml version="1.0"?>
<config>
  <modules>
    <Mr_StockEnhancements>
      <version>1.0.0</version>
    </Mr_StockEnhancements>
  </modules>
  <global>
    <models>
      <mr_stockenhancements>
        <class>Mr_StockEnhancements_Model</class>
      </mr_stockenhancements>
    </models>
    <events>
      <catalog_product_prepare_save>
        <observers>
          <Mr_StockEnhancements_Model_Observer>
            <type>singleton</type>
            <class>Mr_StockEnhancements_Model_Observer</class>
            <method>stockEnhancements</method>
          </Mr_StockEnhancements_Model_Observer>
        </observers>
      </catalog_product_prepare_save>
    </events>
  </global>

</config>

And here's the observer:

class Mr_StockEnhancements_Model_Observer {

public function stockEnhancements(Varien_Event_Observer $observer) {

        $product   = $observer->getProduct();
        $stockData = $product->getStockData();

        //make sure stock qty is greater than zero.
        if (isset($stockData['qty']) && $stockData['qty'] >= 1) {

            $product->setStockData['is_in_stock'] = 1; //update to instock
            Mage::getSingleton('catalog/product_action')
            ->updateAttributes(array($product->getId()), array('status' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED), $storeId);

            print_r($stockData['qty'], $product->StockData['is_in_stock']);
            exit;

        } else {
            Mage::getModel('catalog/product_status')->updateProductStatus($product->getProductId(), $storeId, Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
        }
    }
 }


texts: Random product links replaced with Hashtag links

texts:
I'm fairly new with Magento having just started at a new company and have adopted the previous web managers broken database/website.

Background: One of the main issues we've been having is that the Dedicated server crashed every time we try run the Catalog Search Index when requested to "Rebuild Catalog product fulltext search index".

Issue: But more to the point, the product links from around the site (new and old) are randomly resetting from their product pages to the root url with a hashtag link.

i.e: www.iwarehouse.co.za/electronics/gaming/gaming-consoles/xbox-360-console-fifa15-bundle/ changes to www.iwarehouse.co.za/#

Its also important to mention that we're running Magento 1.7, our DB is about 40GB in size with about 30k products so far.


texts: Javascript files adding root path to links

texts:
I have created an instance on AWS and installed a LAMP stack on it as per their tutorials and installed an existing magento site on to it.

I pointed my local hosts file at the new server, cleared the var folder (including the cache) and the site loaded. Great!

But none of my Javascript files were loading. Not a single one, so I looked at the URLs they were trying to load from and it's done something very strange.

It has added the path to the root directory after the domain like so:

https://example.com/{pathtoroot}/media/js/myfiles.js

Causing the 403 forbidden error on every js file. CSS files and images which use the same root URL as per the magento config are loading perfectly.

URL rewrites are working fine, and if I try to access the correct link directly, it loads the file. I've tried messing about with the root urls but found nothing works and the site works on another (cPanel) server.

I'm sure I'm missing a server setting somewhere, but I've been playing around for ages and found nothing.

Thanks in advance for any help :)


texts:
Just as the title says I want to remove shipping cost from the cart total.  I don't even understand how it can assume that cost?

For my test customer I have 3 options:

The checkout page however comes after the cart?  So how can the cart even make an assumption that the customer is going to pick that one?

Here is the Cart Checkout:

I don't want the shipping settings ever saved or even for that matter displayed in the cart.  Because in the Checkout for Shipping Methods they will always have multiple options so I don't want the website remembering the last shipping method they chose.


texts: Upgrading to 2.2.4 and getting Call to a member function setFinalPrice()

texts:
When doing an upgrade from Magento 2.2.2 to Magento 2.2.4 I get the following when running php bin/magento setup:upgrade

Cache cleared successfully
File system cleanup:
.....
....
...
Module 'Magefan_Community':
Module 'Magento_Sales':
Upgrading data.. PHP Fatal error:  Uncaught Error: Call to a member function setFinalPrice() on null in /Sites/example/vendor/magento/module-quote/Model/Quote/Item/AbstractItem.php:155
Stack trace:
#0 /Sites/example/vendor/magento/module-catalog-inventory/Model/Quote/Item/QuantityValidator.php(130): Magento\Quote\Model\Quote\Item\AbstractItem->getProduct()
#1 /Sites/example/vendor/magento/module-catalog-inventory/Observer/QuantityValidatorObserver.php(34): Magento\CatalogInventory\Model\Quote\Item\QuantityValidator->validate(Object(Magento\Framework\Event\Observer))
#2 /Sites/example/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Magento\CatalogInventory\Observer\QuantityValidatorObserver->execute(Object(Magento\Framework\Event\Observer))
#3 /Sites/example/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\CatalogInventory\Observer in /Sites/example/vendor/magento/module-quote/Model/Quote/Item/AbstractItem.php on line 155

I am guessing this is an issue with data within the database as I have upgraded other sites before and not had this issue however not sure where to start debugging or how to fix the issue. Could anyone advise

Update
If I truncate quote, quote_address, quote_address_item, quote_item, quote_item_option tables then php bin/magento setup:upgrade works though I lose all my data :-(


texts: Magento 2 generate product data based on cron job

texts:
I am developing an admin module which has the functionality to generate product csv in format XML, CSV and txt. I am inserting a row for each format in the database. So when we click on generate button(which is in admin header) it fetches the details(filename,type,cronschedule...) from the database for particular id.Now I want to schedule automatically generate the files(xml,csv,txt) and each row has settings of cron job(which are stored in a custom table).

I have no idea how to set the cron job of each row so that it generates data automatically based on cron settings in rows.

If anyone has an idea. Please let me know with all steps.


texts:
Hi guys i need a to create a tool but before  i need to know if there is something similar available on the web. I have many supliers that send me products in formatos like csv and xls. Each client send the strcture csv in there own  way, i need to relate with my store and of course Keep updating it daily, Is there a script available out there?

I cant find anything relevante that meets my requirwments


texts: I am getting 'Unable to unserialize value' while editing a customer in magento 2.2

texts:
I did data migration from Magento 1.9 to Magento 2.2 and now I am unable to edit a customer.
I am getting this on customer edit page in admin side.

I tried this but it didn't work for me.

I added magento_umask in Magento root directory with number 002 but it didn't work either


texts: access script variable in js file from phtml

texts:
i defined variable in phtml file under script

<script type="text/javascript">
var test = 'hello World';
</script>

I created one Js file test.js under skin js folder now i want to access that variable value in js file how to do it


texts:
After shifting the website to another server. Products are showing out of stock

I found the error while uploading the database file.

 CREATE ALGORITHM=UNDEFINED DEFINER=`user`@`localhost` SQL SECURITY INVOKER VIEW `inventory_stock_1`  AS  select distinct `legacy_stock_status`.`product_id` AS `product_id`,`legacy_stock_status`.`website_id` AS `website_id`,`legacy_stock_status`.`stock_id` AS `stock_id`,`legacy_stock_status`.`qty` AS `quantity`,`legacy_stock_status`.`stock_status` AS `is_salable`,`product`.`sku` AS `sku` from (`cataloginventory_stock_status` `legacy_stock_status` join `catalog_product_entity` `product` on((`legacy_stock_status`.`product_id` = `product`.`entity_id`)))

1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation for


texts: How to reduce use of Mage::getModel('catalog/category')

texts:
I'M NEW TO MAGENTO.

IN FILE 1.

$_category = Mage::getModel('catalog/category')->load($_category->getId())

$categories = Mage::getModel('catalog/category')
                    ->getCollection()
                    ->addAttributeToSelect(array('name', 'url'))
                    ->addFieldToFilter('is_topcategory', 1)
                    ->setPage(1, 5);

IN FILE 2.

$subcats = $category->getChildren();
$CatCustomFilter = array();

if ($subcats) {
    foreach (explode(',', $subcats) as $subCatid) {
        $subcatergory = Mage::getModel('catalog/category')->load($subCatid);
        $subsubcats = $subcatergory->getChildren();
        if ($subsubcats) {
            foreach (explode(',', $subsubcats) as $subsubCatid) {
                $_subCategory = Mage::getModel('catalog/category')->load($subsubCatid);
                $CatCustomFilter[$subsubCatid] = $_subCategory->getCustomFilters();
            }
        } else {
            $CatCustomFilter[$subCatid] = $subcatergory->getCustomFilters();
        }
    }
}

As you can see in FILE 1 Mage::getModel('catalog/category') is called twice.
And in FILE 2 Mage::getModel('catalog/category') called in foreach loop.

So is there anyway to reduce this code? Because I think it's totally bad practice to load the Mage::getModel('catalog/category') like above.

Also please provide me some guidance on how to work with Mage::getModel() properly so that we can't call it again and again.


texts: How long do you have between an order being placed to fulfill the order and capture the funds?  I understand that the auth will expire, if that happens with the extension just attempt a new authcapture?


texts: Remove Parameter From Product url Magento 2

texts:
I am trying to remove parameter(#857=) from the product url:
https://tpm2.redsignal.net/reina-modal-trv-steel-radiator-towel-rail-valve-anthracite.html#857=

These parameter are of configuration values but i want to remove it from my products url.
Please help me i can't find any solution.


texts:
I want to add a class to theme, how can i fined the file path ? or is there another way to add class ?
here is the class
class="slide-home alo-magicslider"
i want to add continer to this class
class="slide-home alo-magicslider container"


texts: How to add customer details for guest user using Magento rest API - create order

texts:
I am creating an order for a guest user using Magento rest API.

Approach:

Create a quote
Add items to the cart
Prepare checkout - Adding billing and shipping information for the order
Create an order - Adding payment information while creating order

I am following the above steps to create order, When I do the final step its showing error customer email is missing.

URL:
/rest/V1/carts/10/order
Payload: {

"paymentMethod": {
"method": "checkmo"
}
}

Response:
{
    "message": "The customer email is missing. Enter and try again."
}

How to add customer details in guest user order?

Please do need full for this scenario


texts: Submenu showing while mouse not on target for hover effect

texts:
I am trying to create a mega menu for Magento 2 just with pure CSS. To stretch the main categories over the full width (max: 1280px) i used flex and justify-content: space-between. As you can see in the screenshot, the submenu still appears when you leave the hover area, while the second level submenu disappears. This occurs only if you move the mouse to the right side. I checked if I missed any hidden paddings, however, the li for "Fahrrad" is only as wide as it appears in the screenshot.
I found out, that every time li.level0 is being hovered, the class UI-state-focus are still active when the cursor is moved to the right, while they disappear when the cursor is moved to the left or top.
When you move from the top inside the are, where you can see the cursor now, the submenu is not showing, only, when you first hover the li "Fahrrad"

Hopefully, someone has a solution for my problem or any idea, why this occurs.

Best regards,
Wottin


texts: Magento 2 : Change Position of CMS BLOCK

texts:
I have a banner block and a new product widget.

On store front, the banner block is displayed after new product widget. I want to banner block is displayed before new product widget. Please give me a solution.

Many thanks


texts: Vimeo video cannot insert in product page

texts:
I am trying to add Vimeo video on product page, but having error that saying video not found.
I did check the video setting, it is fine and open to public. Anyone know why?


texts: Magento 2: Error during VAT Number verification

texts:
I'm trying to set VAT code for my shop in Store>Configuration and then General>General>Store Information.

I've set country, region, city, zip, street and, of course, VAT number (without country code) all correctly but when I click on "Validate VAT Number" it gives me "Error during VAT Number verification." and I can't work out why it says so.


texts: How to assign role to admin user Programmatically?

texts:
I need to assign a user role to admin user programmatically. How can I? I tried some methods like,

try {
$user->setRoleIds(array(<role_id>))
    ->setRoleUserId($user->getUserId())
    ->saveRelations();

} catch (Exception $e) {
    echo $e->getMessage();
    exit;
}

But when we apply the above code, the database get corrupted and gets an Error - "Parent Role id 'G5' does not exist".

This is because, when I apply the above code, the admin user with parent role Id is get deleted and I cant access the database If I recreate it again!

Can anyone point out a solution?


texts: Magento 2 - Modify default Admin Logo (login and backend menu) with Custom Theme

texts:
After creating my custom storefront theme, I am now trying to modify the default magento admin logo with custom theme(the logo in the login admin portal and the Magento icon at the top left of the admin menu). Below are the steps followed.

Custom Theme Logo uploaded at

app/design/adminhtml/[VendorName]/[Themename]/web/images/logo.png

app/design/adminhtml/[VendorName]/[Themename]/registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'adminhtml/[VendorName]/[Themename]',
    __DIR__
);

app/design/adminhtml/[VendorName]/[Themename]/theme.xml

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

app/design/adminhtml/[VendorName]/[Themename]/Magento_Backend/layout/admin_login.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="styles" />
    <body>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_image_src" xsi:type="string">images/logo.png</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

app/design/adminhtml/[VendorName]/[Themename]/Magento_Backend/layout/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="header">
            <referenceBlock name="logo">
                <arguments>
                    <argument name="logo_image_src" xsi:type="string">images/logo.png</argument>
                    <argument name="logo_img_width" xsi:type="string">auto</argument>
                    <argument name="logo_img_height" xsi:type="string">auto</argument>
                    <argument name="show_part" xsi:type="string">logo</argument>
                    <argument name="edition" translate="true" xsi:type="string">Community Edition</argument>
                </arguments>
            </referenceBlock>
        </referenceContainer>
    </body>
</page>

  Create new custom module to apply Admin Theme

app/code/[VendorName]/[ModuleName]/registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    '[VendorName]_[ModuleName]',
    __DIR__
);

app/code/[VendorName]/[ModuleName]/etc/module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="[VendorName]_[ModuleName]" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Theme"/>
        </sequence>
    </module>
</config>

app/code/[VendorName]/[ModuleName]/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Theme\Model\View\Design">
        <arguments>
            <argument name="themes" xsi:type="array">
                <item name="adminhtml" xsi:type="string">[VendorName]/[Themename]</item>
            </argument>
        </arguments>
    </type>
</config>

CLI Commands executed

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush

New DB entry for backend theme and custom module is also seen in theme and setup_module table respectively.

How do I reflect admin theme changes ? Magento ver - 2.2.2


texts:
I Need a custom form validation in a textbox

The value should be like this 3-5, so <number>-<number>

Please suggest me some ideas


texts: Magento 2 How to restrict specfic ip address to access magento site in admin panel

texts:
I need to add specific IPs to access my magento website.
How can I do that


texts: Magento 2.1 Category : custom layout update

texts:
I have a magento store with multiple categories. The default number of products shown on each category is 12. For a particular category I want that all its products be shown.
What are the different ways of achieving it.
Can I do it using custom layout update "Layout Update XML" - if yes what would be the xml?


texts: How to receive ajax response in admin grid?

texts: I've used ui component to create an admin grid. This admin grid is editable and when I save an item in the grid I want to do something with the json response that comes back. Perhaps someone can please point me in the right direction? I'm sending data back in the response, I just don't know how to access it so I can do something with it.


texts: Change Price based on Select Option for Configurable products

texts:
I have a product and three variations.  So, when I change the options for the Size,  I want to change the price dynamically for that option. For.eg.  we have Standanrd,  Large and X Large.  And price is 15, 30 and 46 Resp.  When Selecting Large, the price change to 30 and so on.

I read a lot in the Stackexchange or internet but could not find a right solution.  The sample link to the page is http://bibliografi.co.uk/index.php/catalog/product/view/id/8262/s/COP090709009/

in View.phtml I have this

var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);

and to display the price

            Price:

            <?php echo $this->getPriceHtml($_product, false) ?>
            <?php echo $this->getTierPriceHtml() ?>

any help please


texts: Why display Price zero some items, but others are ok

texts: I'm new for magento. I'm in trouble with product prices and categories.See snapshot i post. some item's price shown zero. Why so that? Can anybody guess?what are the configs I have missed.


texts: add purchase order number to sales order grid Magento 2

texts: How to check/add Purchase Order Number set or not in Purchase Order payment method magento 2.4


texts: If condition satisfies Not to apply any coupon (No coupon)

texts:
We have a customization like a quote edit and approve functionality.

  Ex: Original product price is 350 where customer write a note "I need this product for 200" admin can approve the request at this
  scenario if the quote has edited and approved I don't want to apply a
  coupon (No Coupon) because already we have reduced the product price.

Can any one suggest me the best way to fix this?


texts:
I'm having a problem where Magmi isn't saving the selected import option when clicking Save Profile. When clicking Save Profile, the page looks like it just refreshes, and the checkmarks don't show on the next page load. Everything works fine on stage/prod, just not in my dev/local environment on my Mac. I have updated the conf and ini files to match the Mac filesystem.

I wondered if anyone else has come across this situation and if they found a possible fix.

Thanks,
Mark


texts:
I have a jay.css file in directory /public_html/skin/frontend/neighborhood/default/css but Magento is not recognizing the file changes.

I have cloudflare and cleared the cache but it still doesn't load the updated jay.css

I deleted the jay.css file, went to the url and it still loaded the jay.css so it must be stored somewhere in cache but don't know where.

I went to var/cache and deleted all the folders, i've flushed Magento Cache and also flushed cached storage.

I added a jay1.css file to the same directory to see if it would load and when I type in the url it didn't load it.

I've also restarted my apache server and nothing seems to work. My jay.css doesn't up.


texts:
I have 2 classes A and B.

A is overridden from Magentos core class say M1 and it is defined in di.xml as:

<preference for="Magento\..\M1" type="Namespace\Module\..\A" />

Now Class B is my custom class and it is not overriding any core class.

Do i have to define B in di.xml?
If so, how?

My B class __construct() is as:

public function __construct(
\Custom\Helper $myHelper,
array $data = []
)
{
  $this->helper=$myHelper;
 }

I dont have any Bactory or Proxy in my signature.


texts:
For Magento ver. 1.9.1.0

Never used PHP before, the website I'm working with wants all products deleted. There are about 6000. I believe you make a php file with the code that deletes the products, through ftp? Then, run the example example.com/delete.php and it should work?

Sorry for the beginner question. What is the code for deleting all products and making sure the images are removed from the server as well?


texts: Magento2 - Creating custom EAV entity with Use Default Value

texts:
I followed this tutorial to create a new custom EAV entity:
https://www.rohanhapani.com/create-eav-module-in-magento-2/
However when using the ui-component edit form, it does not include the checkbox for "use default" when scope is set to store view.
Anyone know how to add this?


texts: Varnish Cache and Apache with SSL in Multi Store Envronment

texts:
I want to install and configure varnish with Magento 2 on my server running apache as incredibly impressed with the  performance gains. Just wanted to know a bit about configuring SSL with this as have not done this in my dev environment.

I have also however been told by my hosting provider that to have varnish work on my site i can only have one site on my server. Is this correct? My testing shows multiple sites seemingly working fine so wondering what this could be about?


texts: Keep cart item when registers and confirm account using different browsers?

texts: I'm using magento 2.3.4, before register i add some items to the cart, after i registered then confirm the account link using the same browser the cart items before i registered will shows up, but when i confirm the account link using different browser, the cart item is gone


texts: Robots.txt for Magento 2.1+ - where did it go?

texts:
Where is the actual robots.txt file like Magento 1.9.x if it exists?

  My site URL /robots.txt does not work.

The official dev docs for this http://docs.magento.com/m2/ce/user_guide/marketing/search-engine-robots.html have an image with a note below it stating

  This will be included in before head closing tag in page HTML.

When I inspect the homepage in the  tag of the HTML I do not see a reference to the robots.txt or any directives like "INDEX, NOINDEX, FOLLOW, NOFOLLOW".  I was searching for more information on this, and think others here probably have as well.

Can someone explain how robots.txt functions in Magento2?


texts: How to get product collection in controller in Magento2

texts:
I am creating a new module in magento2 and in controller file, I try to get product collection in controller index.php file so how can I get product collection in Magento 2. so give me suggestion to sort it fast.
Thank you.


texts: productCollectionFactory load function gives data in query but not in object

texts:
I have created a collection factory

$collection = $this->_productCollectionFactory->create()
            ->addAttributeToFilter('status', '1')
            ->addAttributeToFilter('featured', '1')
            ->addAttributeToFilter('type_id',["neq"=>"configurable"]);

and after this i calling load() function

$collection->addAttributeToSelect('*')->load();

and after that applying JOIN's

$collection->getSelect()->join(
                ['cp' => $collection->getTable('custom_product')], 'e.entity_id = cp.marketplace_product_id'
        );

some other JOIN's

$collection->getSelect()->orderRand()->limit(8);

  In collection query i am getting perfect query with JOIN table's data.

foreach ($collection as $key => $data){
    $responce[$key]['custom_price'] = $data->getCustomSpecialPrice();
}

I am getting all custom_special_price and other JOIN fields DATA IN Query
But not in foreach.

But when i don't use load() function it gives me data using get method ,But when i do use load() function it doesn't.

So my question is why Magento loads data in Query ? But not in Object.


texts: How to resolve this error "Database server does not support the InnoDB storage engine." when i install magento?

texts:
I try to install magento in windows 8 64bits with wamp server but when i am in configuration step i have this error "Database server does not support the InnoDB storage engine."
How can i resolve this problem.


texts: setup script remove atribute group from attribute set

texts:
I have setup script which create a new attribute set. And i need remove attribute groups  "Gift Options" and  "Recurring Profile" from created attribute set. How can I do this?

<?php
$installer=$this;
$installer->startSetup();

$inheritBase  = $installer->getDefaultAttributeSetId('catalog_product');

$attributeSetName = 'Custom Name';
$ignoreAttributes = array(
    'news_from_date'  => 'news_from_date',
    'news_to_date' => 'news_to_date',
    'weight'  => 'weight',
    'country_of_manufacture' => 'country_of_manufacture',
    'manufacturer' => 'manufacturer',
    'featured'  => 'featured',
    'color' => 'color',
    'delivery_time'  => 'delivery_time',
    'shipping_charges' => 'shipping_charges',
    'marketplace_state'  => 'marketplace_state',
    'generate_meta' => 'generate_meta',
    'percent_donat'  => 'percent_donat',
    'organization_charity' => 'organization_charity',
    'gift_message_available' => 'gift_message_available',
    'recurring_profile' => 'recurring_profile',
    'is_recurring' => 'is_recurring'
);
$installer->addAttributeSet('catalog_product', $attributeSetName);

$groups = Mage::getModel('eav/entity_attribute_group')
    ->getResourceCollection()
    ->setAttributeSetFilter($inheritBase)
    ->load();

$currentSet = Mage::getModel('eav/entity_attribute_group')
    ->getResourceCollection()
    ->setAttributeSetFilter($installer->getAttributeSetId('catalog_product', $attributeSetName))
    ->load();

$aCurrentGroups = array();
foreach($currentSet AS $group)
{
    $aCurrentGroups[$group->attribute_group_name] = array("id" => $group->getId(), "sort_order" => $group->sort_order);
}

foreach ($groups as $group) {
    $groupId = 0;
    $sort_order = 0;

    if(!isset($aCurrentGroups[$group->attribute_group_name])) {
        $installer->addAttributeGroup('catalog_product', $attributeSetName, $group->attribute_group_name, $group->sort_order);
        $newGroup = $installer->getAttributeGroup('catalog_product', $attributeSetName, $group->attribute_group_name);
        $groupId = $newGroup['attribute_group_id'];
        $sort_order = $newGroup['sort_order'];
    } else {
        $groupId = $aCurrentGroups[$group->attribute_group_name]["id"];
        $sort_order = $aCurrentGroups[$group->attribute_group_name]["sort_order"];
    }

    $groupAttributesCollection = Mage::getModel('eav/entity_attribute')
        ->getResourceCollection()
        ->setAttributeGroupFilter($group->getId())
        ->load();

    foreach ($groupAttributesCollection as $attribute) {
        if(!isset($ignoreAttributes[$attribute->getAttributeCode()])) {
            $installer->addAttributeToGroup('catalog_product', $attributeSetName, $groupId, $attribute->getId(), $attribute->sort_order);
        }
    }
}

$installer->endSetup();


texts: after installing my theme i still getting custom magento theme

texts:
I have installed theme mapple and others whose folder structure are like this

C:\xampp\htdocs\magento\app\design\frontend\default
blank
default
iphone
mapple


texts:
I was working on a extension for our Magento website, but i found out that my cronjob is not working correctly.

Config: \app\code\local\Questcontrol\CustomExstention\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Questcontrol_CustomExstention>
            <version>0.1.0</version>
        </Questcontrol_CustomExstention>
    </modules>
    <global>
        <models>
            <CustomExstention>
                <class>Questcontrol_CustomExstention_Model</class>
            </CustomExstention>
        </models>
    </global>
    <crontab>
        <jobs>
            <CustomExstention>
                <schedule>
                    <cron_expr>* * * * *</cron_expr>
                </schedule>
                <run>
                    <model>CustomExstention/Observer::test</model>
                </run>
            </CustomExstention>
        </jobs>
    </crontab>
    <frontend>
        <routers>
            <CustomExstention>
                <use>standard</use>
                <args>
                    <module>Questcontrol_CustomExstention</module>
                    <frontName>CustomExstention</frontName>
                </args>
            </CustomExstention>
        </routers>
    </frontend>
</config>

Object: \app\code\local\Questcontrol\CustomExstention\Model\Observer.php

<?php
class Questcontrol_CustomExstention_Model_Observer {

    public function test(){
        Mage::log("TEST success");
    }
}
?>

What am i doing wrong at this point?

Thanks in advanced!


texts: Magento pro-grammatically save telephone number

texts:
I have inserted the customer data in Magento(1.9) pro-grammatically,in my custom table.But the telephone number is not get inserted

My data:
Array
(
    [firstname] => Marc L
    [lastname] => Kruger
    [email] => mkruger@morrisonfenske.com
    [street] => 5125 County Road 101, Suite 102
    [city] => Minnetonka
    [state] => MN
    [country] => US
    [telephone] => 952-975-0050
)
$csv = Mage::getModel('flsearch/csv');
$csv->setData($customer)->save()


texts: Magento 2: How to wrapper link in new div?

texts:
I need wrapper into a new div the block help create in the header.panel. I wrapped the block header-links in the new div and work, but the link custom doesn't wrapper in other div.

This is the code of my default.xml

    <referenceContainer name="header.panel">

        <block class="Magento\Framework\View\Element\Html\Link\Current" name="help" before="div.login.menu">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">help</argument>
                <argument name="path" xsi:type="string">help</argument>
            </arguments>
        </block>

        <block class="Magento\Framework\View\Element\Html\Link\Current" name="navbar.brand">
            <arguments>
                <argument name="label" xsi:type="string" translate="true">HOME</argument>
                <argument name="path" xsi:type="string"></argument>
            </arguments>
        </block>

        <container name="div.login.menu" htmlTag="div" htmlClass="login-menu" after="-">
            <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
            </block>
        </container>

        <container name="div.navbar.brand" htmlTag="div" htmlClass="navbar-brand" after="">
            <block class="Magento\Framework\View\Element\Html\Current" name="navbar.brand">
            </block>
        </container>

    </referenceContainer>

I need wrapper the block help and the block navbar.brand in.

The result of my default.xml is this

help

HOME

Account

The wrapper of the header.links work, but the wrapper of the navbar.brand doesn't work.

Please, help me.


texts: Customer session undefined setData function at observer

texts:
i tried to save total order at customer session for not logged in and logged in customer in sales_order_save_after observer like this:

namespace Test\Custom\Observer;

use \Psr\Log\LoggerInterface;
use Magento\Framework\Event\ObserverInterface;
class SalesOrderAfter implements ObserverInterface
{
    protected $_checkoutSession;
    protected $_customerRepositoryInterface;
    protected $_addressInterface;

  public function __construct(
  \Magento\GoogleAdwords\Helper\Data $helper,
  \Magento\Sales\Model\ResourceModel\Order\Collection $collection,
    LoggerInterface $loggerInterface,
    \Magento\Framework\App\RequestInterface $request,
    \Magento\Framework\Registry $registry,
    \Magento\Sales\Model\OrderFactory $orderFactory,
  \Magento\Customer\Model\Session $session
    )
  {
      $this->_helper = $helper;
      $this->_collection = $collection;
      $this->_logger = $loggerInterface;
            $this->orderFactory = $orderFactory;
            $this->_request = $request;
            $this->registry = $registry;
      $this->session = $session;
  }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
    $order = $observer->getEvent()->getOrder();
    $order_id = $order->getIncrementId();

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $order = $objectManager->create('Magento\Sales\Model\Order')->load($order_id);
    $this->session->getCustomersSession()->setData('total_last_order', $order->getGrandTotal());
    return $this;
  }
}

but i always got an error like this:

  Fatal Error: 'Uncaught Error: Call to a member function setData() on
  null


texts: How to remove custom attribute of category using object manager in magento 2

texts:
I created 4 custom attributes for category. Now I want to remove it. I want to use object manager for delete attributes and its values.

See this image. Created attributes are display in this manner.

Now I created one file delete_attribute.php in magento root folder.

<?php
ini_set('display_errors', 1);
//ini_set('memory_limit','-1');
error_reporting(E_ALL);

use Magento\Framework\App\Bootstrap;

require __DIR__ . '/app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$storeManager = $obj->get('\Magento\Store\Model\StoreManagerInterface');
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$state = $objectManager->get('Magento\Framework\App\State');
//$state->setAreaCode('frontend');
$state->setAreaCode('adminhtml');

// 165
// attribute_code1
// \Magento\Catalog\Model\Category

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('attribute_code1'); //Get Current Category
$PCategory = $objectManager->get('Magento\Catalog\Model\CategoryFactory')->create()->load(165);

echo $PCategory->getIsCollectionPageListing();
print_r($PCategory);
?>

Does anyone know how to delete these 4 attributes using object manager ?

Thanks in advance.


texts: Edit default page title for category programatically

texts: I am using magento1.7 and added page title(added from backend)for some categories and some have no page titles. i want to edit the default page title for only those who have no page titles.But i can't understand, from where did get the default meta title for categories(not added page title from backend).please help me to find the file and code


texts:
I installed the MagePlaza language Italian pack on Magento 2.2.3 and it works well, but some voice on the pdf invoice are not translated.

I need to change the vat voice to partita iva.

I created a i18n in my theme folder and a it_IT csv but it doen't work.


texts: Magento 2.2.5 stop overlapping products description and reviews content

texts:
I have just finished setting up a new website over 1900 products. But i found an error on Firefox product description overlap with review tabs content, on chrome works fine.

Not sure how to get a fix. Either move review below description and remove the review tab. Its some settings in magento java scripts


texts: Magento 2: How to additonalClasses for Tab in form ui component?

texts:
i try this code but it not working with tab in form ui component:

<item name="additionalClasses" xsi:type="array">
    <item name="my-custom-class" xsi:type="boolean">true</item>
</item>


texts: Magento2 How can I remove My account functionality from entire site

texts:
I need to remove My Account functionality from the entire site. I need only guest user.

How can I achieve this?


texts: I have generated a private key on my Magento account. But composer will only let me enter the username (public key) and won't allow me enter the password (private key). Why is this?


texts:
I've updated the default breadcrumbs.phtml which now displays the company logo within the breadcrumb section, however I do not need the logo to show on category pages.

I have tried to update my catalog_category_view.xml to pass an argument to the block:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
            <arguments>
                <argument name="show_logo" xsi:type="boolean">false</argument>
            </arguments>
        </block>
    </body>
</page>

and within my breadcrumbs.phtml I am trying to get the value of the show_logo by:

echo $this->getData('show_logo');

Unfortunately, this isn't working?

Can anyone please help me to understand why this isn't working and how I can get this to work so that I can check the argument so I can check whether to show the logo or not?

Thanks


texts:
I have a trouble with adding new attribute. So, it's my config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <attributes_new>
            <version>0.1.0</version>
        </attributes_new>
    </modules>
    <resources>
        <attributes_new_setup>
            <setup>
                <module>attributes_new</module>
            </setup>
        </attributes_new_setup>
    </resources>
</config>

my folder location:

And my code, where I add my attributes.

<?php
/**
 * Created by PhpStorm.
 * User: p.kushnerevich
 * Date: 19.12.17
 * Time: 14.30
 */
$installer = $this;

$productAttributesSetup = new Mage_Eav_Model_Entity_Setup('core_setup');

$installer->startSetup();

$setId=1;

$productAttributesSetup->addAttributeSet('catalog_product', 'NewAttributeSet');

$groups = Mage::getModel('eav/entity_attribute_group')
    ->getResourceCollection()
    ->addAttributeToFilter('attribute_group_name','Clothing')
    ->setSortOrder()
    ->load();

$attributeCodes = array();
$numberGroupOnPage=0;

foreach ($groups as $group) {
    $groupName          = $group->getAttributeGroupName();
    $groupId            = $group->getAttributeGroupId();
    $productAttributesSetup->addAttributeGroup('catalog_product', 'NewAttributeSet',$groupName,$numberGroupOnPage++);
    $attributes = Mage::getResourceModel('catalog/product_attribute_collection')
        ->setAttributeGroupFilter($group->getId())
        ->addVisibleFilter()
        ->checkConfigurableProducts()
        ->load();
    $numberAttributeOnPage=0;
    if ($attributes->getSize() > 0) {
        foreach ($attributes->getItems() as $attribute) {
            $attributeName=$attribute->getAttributeCode();;
            $productAttributesSetup->addAttributeToGroup('catalog_product','NewAttributeSet',$groupName,$attributeName,$numberAttributeOnPage++);
        }
    }

}
$installer->endSetup();

I think, that my error in config.xml.


texts: Do I need an SSL certificate with Magento 2.1.0?

texts:
We never had the new generation of Magento until now. And on all the previous versions (1.x.x) we ALWAYS needed to buy and have an SSL certificate installed (otherwise browsers would throw these scary messages at customers who were placing orders saying that placing the order is unsafe and they should get out of there)

We now have Magento 2.1.0 with Paypal and NO SSL certificate installed. There seem to be no Errors or scary messages anywhere and things seem to work just fine. Do I have to buy an SSL and have it installed or are we fine without it?

clarification: This is a brand NEW domain which never had an SSL installed on it. There hasn't been any actual customer orders placed just yet (even-though it's live) - just a test order by us.


texts:
I am trying to create my own navigation bars by creating the link in a static block then inserting the block into the left sidebar.
You can see one of my pages here: http://hi-schoolworld.com/pharmacy
The problem seems to be with the code in my local.xml file.
If I have this tag:
then nothing shows up but if I comment it out then the block displays twice...
I can't think of anywhere else I would have referenced the block.
I've uploaded a screenshot of what I'm talking about here: http://hi-schoolworld.com/example.jpg

Thank you in advance for your help!


texts: Load customer Quote Error in magento 2.1 EE

texts:
Once the customer is logged in or creating account, Load Customer Quote Error is getting.

Can you please help me solve this ?

Thank you


texts: Add configurable swatches inside Related Product block in magento2 product view page

texts:
I have added below code inside the following path:

/app/design/frontend/magento/theme/Magento_Catalog/layout/catalog_product_view.xml

//code inside related product block

<block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" template="Magento_Catalog::product/list/related.phtml">
 <block class="Magento\Framework\View\Element\RendererList" name="related.product.type.details.renderers" as="details.renderers">
    <block class="Magento\Framework\View\Element\Template" as="default"/>
    <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable" template="Magento_Swatches::product/listing/renderer.phtml" />
</block>
</block>

To get swatches inside related block i update code in below path:

/app/design/frontend/magento/theme/Magento_Catalog/templates/product/list/related.phtml

add below code to show a configurable option but can not get this.

<div class="product details product-item-details">
  ....
<?php echo $block->getProductDetailsHtml($_item); ?>


texts: Getting the image to change for my Configurable Products

texts: I have around 1000 configurable products on my site. They can be changed by options of colour or size. I have the images of the configurable products in all the different colours available. What would be the best approach to making these images appear when you change the the colour option on the site?


texts: Magento 2.1.1 Checkout page is blank after login

texts: I tried to run Magento(CE) 2.1.1 in my server but it seems that my checkout page isn't displaying anything, just header and footer.


texts: Magento 2 - Foreign Key Constraint does not delete record

texts:
I am using the extension Amasty Product Attachments.
If I add an attachment to a product and then delete that attachment from Amasty -> Product Attachments -> Attachments Management, then I can't open the product in the backend anymore. It just loads forever and I get this error logged into the console:
dynamic-rows.js:660 Uncaught TypeError: dataRecord.slice is not a function
    at UiClass.getChildItems (dynamic-rows.js:660)
    at UiClass.initChildren (dynamic-rows-grid.js:85)
    at UiClass.initialize (dynamic-rows.js:191)
    at UiClass.initialize (wrapper.js:109)
    at UiClass._super (wrapper.js:106)
    at UiClass.initialize (dynamic-rows-grid.js:42)
    at UiClass.initialize (wrapper.js:109)
    at new UiClass (class.js:49)
    at Object.initComponent (layout.js:137)
    at fire (jquery.js:3238)

This is the state if I create a new attachment and assign it to a product:
Table amasty_file:

Table amasty_file_store_product

If I delete the attachment from Amasty -> Product Attachments -> Attachments Management then the record should get removed in both tables, but it is only getting removed in amasty_file:
Table amasty_file:

Table amasty_file_store_product

So the product still thinks that it has the attachment, but can't find it since it was deleted, so the error is getting caused.
Normally the file should get deleted in both because of the foreign key constraint, but the constraint does not work as it seems, even though it exists.
Foreign Key Setup in table amasty_file_store_product:

If I test it on a fresh magento 2, then it works!
So I disabled all third party modules in my not working environment and changed to the Luma default theme, but it still fails.
I am running on Magento 2.4.2 on both. Tested with PHP 7.4 and PHP 7.3.
The code of the extension in the fresh magento 2 is exactly the same as in my environment.
I hope someone has an idea


texts: Allow dynamic IP to access a site in maintenance mode

texts:
How to access a site in maintenance mode with a dynamic IP while others keep seeing the maintenance mode?

I can add my IP address to var/maintenance.ip and get access the admin / frontend.

But my IP changes every 24 hours and I have to add the new one again.

Is there a way to do this without me adding my new IP every time?


texts: admin form add value of id parameter to field

texts:
Using admin forms I would like to add a facility which will allow a user to upload an image and link it to some data held within other tables. My database is set up and my form is set up as required, unfortunately I have been unsuccessful in working out how to pass the id value from the url to the field on my form

How do I pass the id value from the url to the field on my form?

I have this

protected function _prepareForm()
{
    ....Other code here....

    $fieldset->addField('shop_id', 'hidden', array(
        'value'     => //unable to work out what command needs to be added,
        'name'      => 'shop_id',
    ));
}


texts: Need to control multiple magento config from single admin panel

texts:
I am planning to create 3 Magento instances with load balancing. Is there any way to control all the Magento instance config from one single instance (like a single Magento admin panel for all instance)?
and I would like to run the cron job in the same master instance instead of live Magento instances. Let me if any additional info required.


texts: How can I get at all the cart data from the form_key

texts:
I have added a form onto the bottom of the cart page, and changed the cart page to redirect to my own custom page.

This custom page currently just outputs the submitted data from the previous page, like so: print_r($_POST);

This produces the following output:

Array
(
    [form_key] => 2AJOmd7GhFVICntG
    [cart] => Array
        (
            [20] => Array
                (
                    [qty] => 1
                )
        )
)

So my question is, how can I get at all the cart data from the form_key.

A solution in pure PHP would be preferable.


texts: Magento2: Insert brand name above product name in product page

texts:
I would like to insert brand name above product name in product page in a Magento 2.2.1. I managed to do it with regards to product list. I modified file list.phtml in app/design/frontend/../../Magento_Catalog/templates/product.

However, I don't know how to display it on product page. Can you help me?
Thank you in advance


texts: Magento 2.1.6 - How to setup email templates header and footer

texts:
I am new in Magento 2x. I just want to setup email header and footer globally.

I can't locate either header.html / footer.html files in my Magento file systems as well.

Also in "Marketing/Email Templates/Add New Template/" I select 'header' template from there and try to preview or save the new template the page reloads and shows this error message "404 error: Page not found." with this URL path

"/admin/admin/email_template/preview/key/198e5851939baf4c460d1b202e2ac643d1e26084bfd75982e1eb4553cedd3012/".

I will really appreciate if some one guides me to how to configure header/footer email templates and also help me to solve this 404 issue.

Thanks.


texts: How do I "access" shipping options from a custom module's controller?

texts:
I've created a module to programmatically create orders on Magento CE 1.9.2.2. Everything works perfectly fine in a workbench testing script but when I attempt to execute the same code from a custom controller, it breaks when trying to set shipping method (i.e. freeshipping). The free shipping option is enabled in Magento but I feel like I should be doing something differently.

Here is my controller's class & indexAction:

<?php

class MyCompany_Api_OrderController extends Mage_Core_Controller_Front_Action
{

  public function indexAction()
  {
      $storeId = 1;

  $quote = Mage::getModel('sales/quote')
  ->setStoreId($storeId);

  $quote->setCustomerEmail('thecustomer@example.com');

  // add product(s)
  $product_sku = 'SKU1234'; // use your own sku number
  echo "Product SKU: " . $product_sku . "\n";
  $product_id = Mage::getModel("catalog/product")->getIdBySku( $product_sku );
  echo "Product ID: " . $product_id . "\n";
  $product = Mage::getModel('catalog/product')->load($product_id);

  $params = array();

  $params['qty'] = 1;
  $request = new Varien_Object();
  $request->setData($params);

  $price = "19";
  $quoteItem = $quote->addProduct($product, $request);
  $quoteItem->setCustomPrice($price);
  $quoteItem->setOriginalCustomPrice($price);

  $addressData = array(
    'firstname' => 'John',
    'lastname' => 'Doe',
    'street' => 'Sample Street 10',
    'city' => 'Somewhere',
    'postcode' => '123456',
    'telephone' => '123456',
    'country_id' => 'US',
    'region_id' => 12, // id from directory_country_region table
  );

  $billingAddress = $quote->getBillingAddress()->addData($addressData);
  $shippingAddress = $quote->getShippingAddress()->addData($addressData);

  $shippingAddress->setFreeShipping( true )
  ->setCollectShippingRates(true)->collectShippingRates()
  ->setShippingMethod('freeshipping')
  ->setPaymentMethod('checkmo');

  $quote->getPayment()->importData(array('method' => 'checkmo'));

  $quote->collectTotals()->save();
  $service = Mage::getModel('sales/service_quote', $quote);
  $service->submitAll();
  $order = $service->getOrder();
  printf("Created order %s\n", $order->getIncrementId());
  }
}

The only difference between this and my workbench script is that I've removed the necessary 2 lines for workbenching:

include 'app/Mage.php';
Mage::app();

I believe I need to use Mage::getSingleton('shipping/config')->getAllCarriers somewhere before I attempt to call shipping methods but not certain. Any ideas? Thanks in advance.


texts: Add Ajax Quantity Increment and Decrement Button on mini cart in Magento 2

texts: I  want to implement Ajax Quantity Increment and Decrement Button functionality on cart items on Minicart. I didn't find any article or any module to achieve this. as qty increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update.Could anyone help me with it?


texts:
I am trying to implement the following:

The idea is to be able to filter products by the conditions which allow only product attributes. (I do not want the additional columns in the grid instead). When I click "All" or "TRUE" or green "+" nothing happens. I know this feature involves a lot of deep Magento knowledge which I don't yet posses. For now I am trying to make the code work the dirty way (I am amending core files) for testing purposes. Ideally I need to have an observer or the layout file.
The core file I amend to implement the feature is called Tabs.php and is located under app/code/Core/Mage/Adminhtml/Block/Catalog/Category directory.
The particular function is called _prepareLayout() I am trying to inject the created form to the Category Products tab which is represented by the class extending the grid. Since I am adding a new form to the tab alongside the original grid I concluded to amend the Tabs.php file instead of the Grid.php one. Here is the content:

    $model = Mage::getModel('salesrule/rule')->getCollection()->getFirstItem();
    $renderer = Mage::getBlockSingleton('adminhtml/widget_form_renderer_fieldset');
    $text = 'Apply the rule only to cart items matching the following conditions (leave blank for all items)';
    $config = array('legend' => Mage::helper('salesrule')->__($text));
    $fieldset = $form->addFieldset('actions_fieldset', $config)->setRenderer($renderer);
    $fieldset->addField('actions', 'text', array(
        'name' => 'actions',
        'label' => Mage::helper('salesrule')->__('Apply To'),
        'title' => Mage::helper('salesrule')->__('Apply To'),
        'required' => true,
    ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/actions'));
    $form->setValues($model->getData());
    $this->addTab('products', array(
        'label'     => Mage::helper('catalog')->__('Category Products'),
        'content'   => $form->toHtml() . $this->getLayout()->createBlock(
            'adminhtml/catalog_category_tab_product',
            'category.product.grid'
        )->toHtml(),
    ));

The original "Shopping Cart Price Rules" is implemented in (there are tons of files really, but the main one is probably in) the Actions.php file located under app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab directory. The function is called _prepareForm().

Can you help me by giving a hint on how can I implement that rule block please? Huge thank you in advance!


texts:
i'd like to put some comment on order confirmation mail.
it's not for customer but for me(sales person)
I want to write some comment on magento admin and want it to be shown in
order confirmation mail.

Is there anyway to do that? or is there any good extension for it?

Thank you


texts: Is there any specific order of invoking observer functions?

texts:
I'll explain my question through an example.

Assume I have written two custom modules as A and B.
And both the modules are having observer functions which fires once click on the 'Place Order button in checkout flow. (Assume both observer functions fires at same event)

Assume each module's observer functions are 'a' and 'b'

So my question is how can I know which observer function will get invoked first ('a' or 'b')?

Is there any specific order? Or is there any possibility to inform Magento  that we want to invoke method 'b' first and method 'a' next likewise?


texts: reindex catalog_category_product issues after migration from M1 to M2


texts: Magmi not displaying back to configuration

texts:
Currently I am facing very weird problem in Magmi in which i am importing the  820  product .It successfully import all the product but does not display back to configuration link while after cancel it display link.

it is continuously posting :

POST http://xxx.com/magmi/web/magmi_progress.php 200 OK 324ms prototype.js (line 1731)

I have also tried with new magmi but same problem.


texts: Call to a member function getQuote() Error

texts:
Out of no where I am receiving this error within my one page checkout. When I went check the PHP file this file was not in the folder. I uploaded a new file and I am still getting this error. Does anyone one what this error can be?

Fatal error: Call to a member function getQuote() on a non-object in /home/sitename/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php on line 195


texts: Custom Customer Attributes not showing in user account - Magento 2

texts:
I have created 3 custom customer attributes. So far I have them saving and displaying correctly in the account creation page and for the admin in the backend.

In the users account on the frontend they just appear as empty boxes. I can, however, save the attributes from here.

Here is my customer_account_edit.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">

        <referenceContainer name="content">
         <referenceContainer name="form.additional.info">
            <block class="Magento\Framework\View\Element\Template"  template="Ubr_CustomAttributes::additionalinfocustomer.phtml"/>
         </referenceContainer>

        </referenceContainer>

</page>

Here is my additionalinfocustomer.phtml

    <fieldset class="fieldset create account" data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>">
    <legend class="legend"><?php /* @escapeNotVerified */ echo __('Additional Information') ?></legend>

        <?php /* @escapeNotVerified */ echo __('Your Interest in U Build Rods?') ?>

            <input type="text" name="ubr_interest" id="ubr_interest" title="<?php /* @escapeNotVerified */ echo __('Your Interest in U Build Rods') ?>" class="input-text" data-validate="{required:false}" autocomplete="off">

        <?php /* @escapeNotVerified */ echo __('Company or Organisation') ?>

            <input type="text" name="ubr_company" id="ubr_company" title="<?php /* @escapeNotVerified */ echo __('Company or Organisation') ?>" class="input-text" data-validate="{required:false}" autocomplete="off">

        <?php /* @escapeNotVerified */ echo __('Telephone') ?>

            <input type="text" name="ubr_telephone" id="ubr_telephone" title="<?php /* @escapeNotVerified */ echo __('Telephone') ?>" class="input-text" data-validate="{required:false}" autocomplete="off">

</fieldset>

They should obviously be displaying their content on the frontend ready to be edited.

Thanks


texts: In Magento2, how to get the product description from Sales order table

texts: I want to display the order id, item description, sku and price of products from the sales order and sales order item tables. For some reason, the description columns in my sales order item table is null. So I want to retrieve the description  from the catalog product table by joining it to the sales order or sales order item table. Anyone know the query for that ?


texts: Call to undefined method Mage_Catalog_Model_Product_Type_Simple::getUsedProducts() in app\...\.Configurable\Attribute\Collection.php on line 160

texts:
I Try to make a link in my custom module where I can show my all product with some information. But It show a error.
There just install magento with sample data. my output

337-Aviator Sunglasses(ace000)
338-Jackie O Round Sunglasses(ace001)

.....

.....

.....

399-Madison 8GB Digital Media Player(hde012)

400-Compact mp3 Player(hde013)

Fatal error: Call to undefined method Mage_Catalog_Model_Product_Type_Simple::getUsedProducts() in \app\code\core\Mage\Catalog\Model\Resource\Product\Type\Configurable\Attribute\Collection.php on line 160

My code

config.xml

<config>
    <modules>
        <Abdus_Allproduct>
            <version>1.0.0</version>
        </Abdus_Allproduct>
    </modules>
    <frontend>
        <routers>
            <allproduct>
                <use>standard</use>
                <args>
                    <module>Abdus_Allproduct</module>
                    <frontName>allproduct</frontName>
                </args>
            </allproduct>
        </routers>
    </frontend>
</config>

IndexController.php

<?php
  class Abdus_Allproduct_IndexController extends Mage_Core_Controller_Front_Action{
      public function indexAction(){
          $collection = Mage::getModel('catalog/product');
            $col=$collection->getCollection()->addAttributeToFilter('visibility',array('in'=>array(2,3,4)));
            foreach($col as $c){
                $collection->load($c->getId());
                echo $collection->getId().'-'.$collection->getName().'('.$collection->getSku().')<br>';
            }
      }
  }


texts:
I've this error when I access to any pages of my website

  Fatal error: Class 'IBP_SocialLinks_Helper_Data' not found in
  /Applications/MAMP/htdocs/ibp/app/Mage.php on line 547

I searched on many stack post but I not found the solution, can you help me please ?

So, this appears by the creation of a new system/general menu in my IBP/SocialLinks/etc/system.xml :

<?xml version="1.0"?>
<config>
    <sections>
        <ibp_sociallinks_config translate="label" module="ibp_sociallinks">
            <label>Social links</label>
            <tab>general</tab>
            <sort_order>1000</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>0</show_in_website>
            <show_in_store>0</show_in_store>
        </ibp_sociallinks_config>
    </sections>
</config>

So here is my IBP/SocialLinks/etc/config.xml :

<?xml version="1.0"?>
<config>
    <!-- ... -->
    <global>
         <!-- ... -->
        <helpers>
            <ibp_sociallinks>
                <class>IBP_SocialLinks_Helper</class>
            </ibp_sociallinks>
        </helpers>
    </global>
</config>

And here is the code of my IBP/SocialLinks/Helper/IBP_SocialLinks_Helper_Data.php

<?php
class IBP_SocialLinks_Helper_Data extends Mage_Core_Helper_Abstract
{
}

PS :

This command : php -f shell/compiler.php -- state gives me

Compiler Status:          Disabled
Compilation State:        Not Compiled
Collected Files Count:    0
Compiled Scopes Count:    0


texts: Firstname error while creating new account in Magento 2

texts:
When I try to create a new account, the system returns this error:

  "Firstname" is a required value. "Firstname" length must be equal or greater than 1 characters.

The POST however does contain all required fields:

Request URL: http://domain.com/customer/account/createpost/
form_key: vSYF9fBkMNJ5BoXc
success_url:
error_url:
firstname: John
lastname: Doe
email: email@gmail.com
password: ABC_123456
password_confirmation: ABC_123456

I checked the data in the isValid() function in /vendor/magento/module-eav/Model/Validator/Attribute/Data.php and I noticed the firstname value is empty, unlike other values like lastname. So it seems that the firstname value got lost somewhere during the processing between the POST and the isValid method.

I found out that firstname is missing in the customer-attributes in /vendor/magento/module-customer/Model/Metadata/Form.php (it contains created_at , prefix, middlename, lastname, suffix, email, dob, taxvat, gender), so I guess there must be a problem in the customer configuration.

What could be the cause of this issue?


texts: Composer installing my magento 1 extension to /vendor but not copying to /app

texts:
I have built a Magento 1 extension which is available as a repo here:

https://github.com/BenGrant123/Duel_Emails/

Following this guide (http://magebase.com/magento-tutorials/how-to-make-magento-extensions-work-with-composer/) I have been trying to make the extension installable with composer. At the moment, I am able to get, or remove the extension by running composer require duel/emails or php composer.phar require duel/emails, but the extension is only installed to magento-root/vendor/duel - the code, design, locale and etc files are not copied to the desired destinations in magento-root/app.

In my composer.json I have created mappings like the below:

"extra": {
    "map":[
      ["app/etc/modules/Duel_Emails.xml", "app/etc/modules/Duel_Emails.xml"], ["app/design/frontend/base/default/layout/duel/duelgallery.xml",
"app/design/frontend/base/default/layout/duel/duelgallery.xml"],
    ]
}

which I believed should cause these files to be copied to the /app folder upon installation, but it doesn't seem to work as nothing appears in magento-root/app/etc, magento-root/app/design, or any of the other desired folders after installation of the extension.

Any help on this would be massively appreciated as it is the only thing stopping me getting the extension finished!

Thanks,

Ben.


texts: Magento 1.9 backend having SSL issue after moving from centos 6 to Debian 8

texts:
On the former server, I have an SSL certificate installed, i think that's the problem, I copied the certificate to the new server.
I can access the front end with all functionalities, but the admin login page cannot log css and js files resulting in an ugly page.
however after loggedin anyway, I cannot save settings.
In google chrome I allowed the loading of unsecure scripts,I was able to figure out that the secure url was set. But viewing the source of the page, all js and css urls are non SSL, although in core_config_data, the secure version has https.

thank you for your help


texts: How to create mass credit memos magento 2?

texts:
Total noob in magento here.

What I want is to select a bunch of orders, and create credit memos for them if their status is completed, and after the creditmemo is created, I want to set their statuses to Refunded/Cancelled, based on the payment method used.

Any tips on how I should go about the whole process?

Thanks!

EDIT:

I have created an action in the sales_order_grid.xml as follows:

<action name="masscreditmemos_order">
        <settings>
                <url path="sales/order/masscreditmemos"/>
                <type>masscreditmemos_order</type>
                <label translate="true">Generate Credit Memos</label>
        </settings>
</action>

Then created a file named "masscreditmemos.php" in

  module_sales/Controller/Adminhtml/Order/

with the following content:

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Sales\Controller\Adminhtml\Order;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;

class masscreditmemos extends \Magento\Sales\Controller\Adminhtml\Order\AbstractMassAction
{
    /**
     * Authorization level of a basic admin session
     */
    const ADMIN_RESOURCE = 'Magento_Sales::creditmemo';

    /**
     * @param Context $context
     * @param Filter $filter
     * @param CollectionFactory $collectionFactory
     */

public function __construct(
    \Magento\Sales\Model\Order $order,
    \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory,
    \Magento\Sales\Model\Order\Invoice $invoice,
    CollectionFactory $collectionFactory,
    \Magento\Sales\Model\Service\CreditmemoService $creditmemoService,
    array $data = []
    ) {
        parent::__construct($data);
        $this->order = $order;
        $this->creditmemoFactory = $creditmemoFactory;
        $this->collectionFactory = $collectionFactory;
        $this->creditmemoService = $creditmemoService;
        $this->invoice = $invoice;
    }

public function massAction(AbstractCollection $collection)
{
    $order = $this->order;
    $order->load(10);

    $invoices = $order->getInvoiceCollection();
    foreach ($invoices as $invoice) {
        $invoiceincrementid = $invoice->getIncrementId();
    }

    $invoiceobj = $this->invoice->loadByIncrementId($invoiceincrementid);
    $creditmemo = $this->creditmemoFactory->createByOrder($order);

    // Don't set invoice if you want to do offline refund
    $creditmemo->setInvoice($invoiceobj);

    $this->creditmemoService->refund($creditmemo);
}
}

But when I click the on the "generate credit memo" action, it shows me a 500 error. The error is as follows:

What am I doing wrong?

Also. I know I am supposed to override the vendor modules, I will do that once this runs.


texts:
It seems that by default it is not possible to change the order status after creating an invoice and status has changed to "Complete".

Is there some way to change the status any way?


texts: How to create complex search filters while doing a GET on sales orders through Magento 2 REST API?

texts:
I have 12 sales orders which have "store_id" = 1.
Out of which 3 orders have "status" = "pending"

I get all the 12 orders when I make a GET request to http://mystore/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][1][field]=store_id&searchCriteria[filter_groups][0][filters][1][value]=1

I want to make a OR search,
I want all the orders for which "store_id" = 1 OR "status" = "pending"
Ideally I should get all the 12 orders, but my following request gets back only 3 orders in response:
http://mystore/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][1][field]=store_id&searchCriteria[filter_groups][0][filters][1][value]=1&searchCriteria[filter_groups][0][filters][1][field]=status&searchCriteria[filter_groups][0][filters][1][value]=pending

I had the knowledge that different filters inside a filter group are merged the OR way. And the filter groups are merged the AND way.

But this is not working.

Even the following request gets 3 orders:
searchCriteria[filter_groups][0][filters][0][field]=store_id&searchCriteria[filter_groups][0][filters][0][value]=1&searchCriteria[filter_groups][1][filters][0][field]=status&searchCriteria[filter_groups][1][filters][0][value]=pending

Both filter_groups and filters are being merged the AND way.

Please help.

Assumptions: There are no syntax mistakes in making the request.


texts: Create Dropdown attribute , if dropdown value is "yes" than image(any image) will display in products page and if dropdown value is "no" than image will not display.


texts: Magento 2 - Moving site - 'No such entity'

texts:
After I moved a site from staging.site.nl to site.nl I received a weird error. If I try to reindex the site I get this error: No such entity.

If I try to login I get this message:

a:4:{i:0;s:15:"No such entity.";i:1;s:5964:"#0 /home/site/public_html/vendor/magento/module-store/Model/Store.php(542): Magento\Store\Model\WebsiteRepository->getById('0')

I copied all files, moved the database and did replace the URL values in core_config_data.


texts: How to disable Mage cataloginventory observer

texts:
I'm using Magento 1.9.x, and I try to disable the original Mage cataloginventory observer.

So I edit my own extension config.xml like this:

<sales_quote_item_qty_set_after>
    <observers>
          <inventory>
                <type>disabled</type>
          </inventory>
    </observers>
</sales_quote_item_qty_set_after>

But the original Mage observer is still active. How can I disable or maybe overwrite the app\code\core\Mage\CatalogInventory\Model\Observer.php with my own extension?


texts: Magento 2: Can we delete 'setup' directory after successful magento 2 installation?

texts:
Can we delete 'setup' directory after successful magento 2 installation ?

What are the directories/files we can delete after magento 2 successful installation, especially E:\xampp\htdocs\magento2.1\setup\src\Magento\Setup\Test directory ?


texts: Magento 1 -> 2 Migration: do I "just" need a DB copy or the full code for the magento migration tool?

texts:
we will use the default Magento migration script/tool supplied for migration from M1 to M2.

Question: do I "just" need a DB copy or the full code for the migration scripts to work?

Ie do I need a full production clone. Or is a Mysql copy enough? (for the data of course, images is logical data on disk - if so set in config)

thanks


texts: magento2 custom product attribute acl permission how to?

texts:
protected function _isAllowed()
    {
        return $this->_authorization->isAllowed('Mageants_AdvancedPermissions::catalog_attributes_attributes');
    }


texts: How to edit price range in my magento catalog?

texts:
I am working with magento 1.7.0.2 and I could change price range via admin : System > Configuration > Catalog (under Catalog) > Layered Navigation.

For example : range = 100, I have this :

100,00$ - 199,00$
200,00$ - 299,00$
300,00$ - 399,00$
400,00$ - 499,00$

I wish for example when I exceed the 500,00$ the range changed to 250 for example.

500,00$ - 749,00$
750,00$ - 999,00$

I searched how to do that and I found that I should edit this file : app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php in getPriceRange() function but how to do that with different range like my example.

Thanks


texts: Magento 2 - How to assign custom theme to specific store programatically

texts:
Hi I have created 3 to 4 stores programatically

Now i want to assign my custom theme to specific store using programatically.

I have store id of each store which i have created.

Below code i have tried , but it assign theme to all the stores including default as well.

/**
     * Assign Theme
     *
     * @return void
     */
    protected function assignTheme($group_id)
    {
        $themes = $this->collectionFactory->create()->loadRegisteredThemes();
        /**
         * @var \Magento\Theme\Model\Theme $theme
         */
        foreach ($themes as $theme) {
            if ($theme->getCode() == self::THEME_NAME) {
                $this->config->assignToStore(
                    $theme,
                    [Store::DEFAULT_STORE_ID],
                    ScopeConfigInterface::SCOPE_TYPE_DEFAULT
                );
            }
        }
    }

How can i pass store id to this code , or any alternate way to do this  ?


texts: Display .phtml content into static block

texts:
I would like to add the content of a phtml file into a static block on Magento 1.9.2.2.

phtml file is in:

/app/design/frontend/base/default/template/PBS_Freeship/soglia.phtml

with a very basic code I will edit later:

hello

static block's ID is freeshipcart, with the following content:

text

{{block type="freeshipcart/soglia" name="soglia" template="Pbs_Freeship/soglia.phtml"}}

"freeshipcart/soglia" is allowed in Blocks Permission.

Can't figure it out why this static block shows all but "hello" from the phtml file. Am I missing something?


texts: layout - call left column block within main column (in the 1column.phtml template)

texts:
I have a category list page which uses the 1column.phtml template. However, when the user navigates to a category where there are no subcategories - and only its products are displayed - I would like to call the left column.
The problem is that it is that I am still using the 1column template for this situation.

How can I call the left column?


texts: why this error is showing "We can't add this item to your shopping cart right now." during add bundle product in cart in Magento 2.1?

texts:
I will change price of simple product in cart through observer,it will change successfully.This product is also part of bundle product.When we add this product in cart it display error We can't add this item to your shopping cart right now.below is my observer code.Please tell me how to solve it in magento 2.1?

public function execute(Observer $observer)
 {
    /** @var $item \Magento\Quote\Model\Quote\Item */
    $item = $observer->getEvent()->getQuoteItem();
    if ($item->getProduct()->getTypeId() != Type::TYPE_BUNDLE  ) {
        foreach ($item->getQuote()->getAllItems() as $bundleitems) {
            /** @var $bundleitems\Magento\Quote\Model\Quote\Item */
            //Skip the bundle product
            if ($bundleitems->getProduct()->getCategoryId() =='6') {
                continue;
            }
        }

        $customprice=$bundleitems->getProduct()->getData('twopiece');
            //$customprice=$customprice+300;
            $bundleitems->setCustomPrice($customprice);
            $bundleitems->setOriginalCustomPrice($customprice);
        $item->getProduct()->setIsSuperMode(true);
    }
    return $this;
 }


texts:
When I Logged in Magento error not display but as I refresh or nevigate to other pages it shows error on every page till three or four navigations then error hide automatically. I access all pages but I wants to know why this error come and how t o solve this.
I have tried below commands but it not works for me

    find ./ -type f | xargs chmod 644
    find ./ -type d | xargs chmod 755
    chmod -Rf 777 var
    chmod -Rf 777 media


texts: Magento : Hide checkout steps based on selection of checkbox

texts:
I have a facility in admin, where admin can change the product visibility for the particular user group now.
Update the 'Edit User Group' page to enable the administrator to determine which parts of the checkout process apply to the selected user group.
Add the section called 'Checkout Options' as circled in red in Figure 1 below. The user can select the ;'Checkout Process' they desire for the user group they are editing. There are two options that should appear in the drop down menu;

Default
Custom

Figure 1

If the user selects 'Custom', then 'Checkout Configuration' check-boxes should appear as circled in red, in Figure 2 below. The checkboxes represent the 5 step checkout process. All check-boxes should be 'checked' by default.
Figure 2

LOGIC
If administrator un-check any checkbox, then particuler step remove from the checkout process on front end for that customer group.
For example, if

Billing Information

Shipping Information
are unticked,
the the checkout process because a 3 step process as follows;

Shipping Method

Payment Information

Order Review

I stuck in the logic and don't know how to do it


texts: How to exclude a system attribute (SKU, Description..) from a search?

texts:
As the title, I would like to exclude a system attribute (SKU, Description..) from a search.
I've tried setting to 'NO' the 'Use in Quick Search' and the 'Use in Advanced Search' fields in the 'Frontend Properties' but it seems it doesn't work.

Any suggestions?


texts:
May I know how to fix Magento 2.4.0 url install not loading?
I don't receive the steps to continue installation.
http://prntscr.com/vxavks


texts: Magento2: issue with MGS_Brand (product slider)

texts:
I use free version MGS_Brand:
https://www.magesolution.com/magento2-shop-by-brand.html
I see I have any issue with style slider for shop by brand. For related products working correct. How to get in shop by  brand the same products slider as related products?


texts:
I have a magento version 2.1.1 but I have a few bugs in this version. I hope that upgrading to magento 2.2 will fix these problems.

Can anyone help me how I can update so that I do not lose my data?


texts: I implemented custom shipping method where I set shipping amount on the basis of cart items weight. But this is what happened to me, I am unable to select shipping method. Why is it so?


texts: magento-2 cart page mini cart not update with custom option

texts:
I am using a custom extension for adding additional option in magento2
and its showing on cart page checkout page and in admin order.
but not update mini-cart
error is :

  [2018-08-22 06:39:29] main.INFO: Broken reference: the
  'page.top_schedule_block0' element cannot be added as child to
  'page.top', because the latter doesn't exist [] []


texts: Magento 2: Adding Custom SKU for simple products in Configurable Product

texts:
I am looking for a way to add custom SKU to the simple products which magento automatically creates when you create "configuartions" for a configurable product.

As pictured in the attachement, there's currently no way to add "custom" SKUs for the sub products.

Screenshot:


texts: In the create account form the Gender Select box options are empty


texts: Retrieve Custom Attributes from Order Item

texts:
I've added some 'on-the-fly' custom attributes to the quote item, as explained in this post.

What I'm trying to do is grab the value of these custom attributes in an observer triggering on checkout_onepage_controller_success_action

I've got the order item objects via the following method:

$orderIds = $observer->getEvent()->getOrderIds();
foreach($orderIds as $eachOrderId) {
    $order = Mage::getModel('sales/order')->load($eachOrderId);
    $items = $order->getAllVisibleItems();
    foreach($items as $item)
    {
        //Here are the methods I've used to get the custom attributes below

        //The below works to get an array of product options, but it gets output like this**
        //The custom attributes are in there somewhere though, so I know the information
        //is available, just how to get it?
        $item['product_options']

        //The below doesn't work, $options is a non-object
        $helper = Mage::helper('catalog/product_configuration');
        $options = $helper->getCustomOptions($item);
        if ($options) {
            foreach ($options as $key => $value)
            {
            }
        }

        //The below doesn't work, $options is a non-object
        $optionsArr = $item->getProductOptions();
        if(count($optionsArr['options']) > 0)
        { }
    }
}

**
a:6:{
    s:15:"info_buyRequest";
    a:5:{
        s:4:"uenc";
        s:88:"aHR0cDovL3RhbGtpbmd0b20ubWVyRTHSDF546747J7887HG0UG64X3Byb2R1Y3Qvdmlldy9pZC8yOS8,";
        s:7:"product";
        s:2:"29";
        s:7:"options";
        a:2:{
            s:4:"Logo";
            s:8:"img1.jpg";
            s:5:"Quote";
            s:8:"img2.jpg";
        }
        s:15:"super_attribute";
        a:2:{
            i:141;
            s:1:"9";
            i:152;
            s:2:"18";
        }
        s:3:"qty";
        i:1;
    }
    s:15:"attributes_info";
    a:2:{
        i:0;
        a:2:{
            s:5:"label";
            s:4:"Size";
            s:5:"value";
            s:5:"Large";
        }
        i:1;
        a:2:{
            s:5:"label";
            s:6:"Colour";
            s:5:"value";
            s:3:"Red";
        }
    }
    s:11:"simple_name";
    s:22:"Flower Red Large";
    s:10:"simple_sku";
    s:7:"4t5454t";
    s:20:"product_calculations";
    i:1;
    s:13:"shipment_type";
    i:0;
}

Attributes I'm after here are:

s:4:"Logo";
s:8:"img1.jpg";
s:5:"Quote";
s:8:"img2.jpg";


texts: How to change a template file the right way?

texts:
I want to add an additional CSS class to my template which is located here:

app/design/frontend/default/ves_fashion/template/persistent/checkout/onepage/login.phtml

I am asking myself now what is the correct way in Magento?

Should I change the login.phtml in that directory above or should I create a duplicate of that login.phtml and add it to my own extension at:    app/code/local/MyExtension/ShippingMethodExtension/Block/Checkout/Onepage/login.phtml

How can I then tell Magento that it should use the login.phtml of my extension and not the one from the persistent folder?

Would be great if someone can help me. Thanks!


texts: Integrate Venia PWA Studio components into existing React app

texts:
I have a running React application based on create-react-app and I want to use some components from Venia such as Gallery, Checkout,... I tried to add Venia's webpack plugins into my existing app's webpack but it happened to stuck at Waiting for development server and nothing happens next.
Is there any example or repo I could use for research.


texts: Troubleshooting Service Temporarily Unavailable Error

texts:
My credit cards authorizations suddenly started failing, which I thought might be the result of me not upgrading - I had version 1.6.1. On upgrading to the latest stable version my admin backend is not accessible, all the site shows is Service Temporarily Unavailable.

I have a backup of the complete site so I can start over, and I do have ssh access now. I'd like to know the best place to start troubleshooting this type of error on upgrade. Any other answers on how to fix my problem appreciated.


texts: Magento 2.3 migration issue, configurable products causing 503 error

texts:
I'm facing those issues after data migration from Magento 1.9.4 to Magento 2.3 :

configurable products are causing 503 server error on front-end.
categories with configurable products are causing 503 server error.
searching for a configurable product is causing 503 server error.
PHP LOGS

[21-Mar-2019 03:16:01] WARNING: [pool example.com] child 57516 exited on signal 11 (SIGSEGV) after 1.659686 seconds from start
[21-Mar-2019 03:16:01] NOTICE: [pool example.com] child 57576 started

DOMAIN LOGS:

AH01067: Failed to read FastCGI header, referer: https://example.com/
(104)Connection reset by peer: AH01075: Error dispatching request to: , referer: https://example.com/
Magento 2.3 fresh install and default theme
The products have unique URL's
I managed to have them all working by opening and saving one single random product. Reindexing will make them crash again.

• Magento LOGS :

main.ERROR: Warning: SessionHandler::read(): open(/var/lib/php/sessions/sess_ub6spo4jcfmsh0itec4jahoik8, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/Session/SaveHandler/Native.php on line 22

main.INFO: Consumer "async.operations.all" skipped as required connection "amqp" is not configured. Unknown connection name amqp

Environment :
Ubuntu 18.04.2 LTS
Plesk Onyx - Version 17.8.11 Update #45
PHP 7.2.16 - FPM Application Served by Apache
Nginx : Proxy mode + Smart static files processing

PHP Settings :
max_input_vars = 10000
max_input_nesting_level = 800
precision = 14
output_buffering = 44096
memory_limit : 10GO
max_execution_time : 180000
max_input_time : 180000


texts: addAttributeOption intger value not add in database using code

texts:
I have try to addAttributeOption() integer value add in database using my code.

But i have facing on error message when i have add integer value in CSV

(1) Not Working CSV:-
70024,70014,70010,70624,70040,70017,70014,70010

(2) Working CSV:-
A550-24,B55014,C55010,D94624,E75040,F75017,G75014,H75010,I55334

Error message is
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

My part of code is

foreach
($attribute_arr as $key=>$value)
{

        $option['value'][$value][0]=$value;

        foreach($allStores as $skey =>$svalue){

            $option['value'][$value][$skey] = $value;

        }

    }

$eavSetup = $this->_eavSetupFactory->create();

$eavSetup->addAttributeOption($option);


texts: Magento multiple address checkout confirmation page blank

texts:
As i checkout my shopping cart, the Multiple Address Checkout Confirmation isn't working properly

when hit 'place order' button, it shown blank page and the url redirect to :

http://local.mydomain.com/checkout/multishipping/overview/ --> http://local.mydomain.com/checkout/multishipping/overviewPost/

instead

http://local.mydomain.com/checkout/multishipping/overview/ --> http://local.mydomain.com/checkout/multishipping/success

did anyone had experienced this issue, also have solve the problem,

thanks


texts: Struggling with Observer rewrite (not conflicts that I can find)

texts:
I am trying to rewrite an observer in the extensions Xtento_GridActions. The observer is established this way:

        <core_block_abstract_prepare_layout_after>
            <observers>
                <addMassactionsToGrid>
                    <type>model</type>
                    <class>Xtento_GridActions_Model_Observer</class>
                    <method>core_block_abstract_prepare_layout_after</method>
                </addMassactionsToGrid>
            </observers>
        </core_block_abstract_prepare_layout_after>

I have created my rewrite class at app/code/local/Mymod/Orders/Model/Xtentorewrite/Observer.php and it looks like this:

class Mymod_Orders_Model_Xtentorewrite_Observer extends Xtento_GridActions_Model_Observer {

    /*
     * Get controller names where the module is supposed to modify the block
     */
    public function getControllerNames()
    {
        die('here');
        $originalArray=array('order', 'sales_order', 'adminhtml_sales_order', 'admin_sales_order', 'orderspro_order');
        $newOrdersController="orders";
        $modifiedArray=$originalArray;
        $modifiedArray[]=$newOrdersController;
        return $modifiedArray;
    }
}

My config.xml looks like this

 <?xml version="1.0"?>
 <config>
<modules>
    <Mymod_Orders>
        <version>0.1.5</version>
    </Mymod_Orders>
</modules>
<global>
    <models>
        <mymodorders>
            <class>Mymod_Orders_Model</class>
        </mymodorders>
        <xtento_gridactions>
            <rewrite>
                <observer>Mymod_Orders_Model_Xtentorewrite_Observer</observer>
            </rewrite>
        </xtento_gridactions>
    </models>
    <blocks>
        <orders>
            <class>Mymod_Orders_Block</class>
        </orders>
    </blocks>
</global>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Mymod_Orders before="Mage_Adminhtml">Mymod_Orders</Mymod_Orders>
                </modules>
            </args>
        </adminhtml>
    </routers>

</admin>
<crontab>
    <jobs>
        <Mymod_Fetch_Unpaid_Orders_Report>
            <schedule>
                <cron_expr>0 5 * * 1,2,3,4,5</cron_expr>
                <!-- Run on weekdays (1-5) at 5 am -->
            </schedule>
            <run>
                <model>mymodorders/fetchorderinfo::mailReport</model>
            </run>
        </Mymod_Fetch_Unpaid_Orders_Report>
    </jobs>
</crontab>


texts: Custom plugin files updated code is not showing in admin panel though cache is cleared

texts:
I have created a custom module. Controller files are working fine. I am trying to update my module MySQL version and adding new fields to the module in block folder files but they are not applying in the Magento panel. I've cleared cache and refreshed the index. Still not working.
magento version-1.9
Can anyone help?


texts: Sometimes products are missing category ID's, which they had before

texts:
I have a problem with Magento Community 1.7.0.2. Sometimes we find out that products don't have a category ID anymore (but they had before). We have seen this multiple times now (3rd time in 1 year or so), but we can't find out what's the problem.

Example: Customer calls that some products are missing in the category X. I do an export with Magento Dataflow to see that some category ID's are empty, but some are still there for category X. For example, 800 products normally in that category, 100 still OK, and 700 defined without category ID. We have also some products with multiple categories, like X, Y. Y is still there, but category X is gone in the CSV.

Also, all the 3 times that this problem occurred, it was the same category. I watched the system and error logs, but can't find anything that looks like this problem.

Do you understand the problem and have an idea what this problem could be? If you have any questions, let me know!

Thank you!

(P.S. I didn't know there was a Magento Stackexchange. Cool! :))


texts: How to remove tabs in product page in magento 1.7.0.2?

texts:
I want to remove the review tab and tags tab from the product page in magento 1.7.0.2. But I am not able to find a correct solution.

Thanks.


texts: Update/overwrite Third party module which is installed in vendor folder

texts:
I have two extensions installed via composer and that is in vendor folder. I have done some customisation on those modules ie: updating the files in the vendor/mymodule/ folder. Now after a Magento upgrade (2.3.2 to 2.3.5) all my changes are gone.

Any help to update/overwrite these files with creating my own module in app folder?

The files I have updated in the  folder are

vendor/module/view/frontent/layout/checkout_osc.xml
vendor/module/view/frontent/web/css/osc.css
vendor/module/view/frontent/web/template/view/shipping-address/address-render/osc.html
vendor/module/view/frontent/web/template/view/comment.html


texts: How to Unset the shipping method from quote in magento 2?

texts:
I need to unset the shipping method if it was selected by the customer based on some condition. I tried

  $('#shipping_method').prop('checked', false);

unchecking the radio button of that particular shipping method but the shipping method is set and shipping charges is applied to the cart.

How to unset the shipping method?


texts:
I have tried searching for this one but haven't had much luck. I have over 15k products in my Magento store. At some point we set some of the product's weight to 999. Now I need to generate a list of all of the products that have that set for the weight. I have been trying to find which table in the mysql database that has this information but I can't seem to find it.

In the end I am trying to make a SQL statement that gives me all the product ids for products whose weight is set to 999.

Thank you in advance to anyone who can help.


texts: How to add image on customer/account/login/ page in Magento

texts:
I'm using theme default customer log in page.
Which basically looks like this

So I'm wondering is that possible I could add a image on the left column, under those texts (By creating an account ******in your account and more.)


texts: What is replacement of this function for converting order item to quote item

texts:
As magento/module-checkout/Model/Cart class is deprecated

/**
 * Shopping cart model
 *
 * @api
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 * @deprecated 100.1.0 Use \Magento\Quote\Model\Quote instead
 * @see \Magento\Quote\Api\Data\CartInterface
 * @since 100.0.2
 */
class Cart extends DataObject implements CartInterface

But i dont see any equivalent function to add order item with qty to quote in Magento\Quote\Model\Quote to this function in cart class

/**
     * Convert order item to quote item
     *
     * @param \Magento\Sales\Model\Order\Item $orderItem
     * @param true|null $qtyFlag if is null set product qty like in order
     * @return $this
     */
    public function addOrderItem($orderItem, $qtyFlag = null)

Please suggest an alternative approach to add old order item to quote .


texts: Show additional attributes in related products

texts:
I'm trying to show additional attributes for products that are showing up in the "Related Products" section of an individual product listing. I have some items that have Artist/Author attributes and if they do I would like to show them.

Here is part of my code in: template/catalog/product/list/related.phtml

<?php foreach($this->getItems() as $_item): ?>

      <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_item->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(280) ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />

<a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?>

        <?php if ($_item->getAuthorArtist()): ?>
          By: <?php echo $_item->getAuthorArtist() ?>
        <?php endif; ?>

<?php endforeach ?>

For some reason the author/artist never show up. I can verify that the author/artist is correctly configured because I'm using very similar syntax (changing $_item) on the main product page and it's working fine.

I found this question: show attributes in description.phtml but when I tried editing it like this <?php echo $_product->getAttributeText('AuthorArtist'); ?> it makes Magento blow up.

Somehow I'm must not be targeting the item object correctly...


texts: Composer issue on updating Magento 2.2.2 to 2.2.3

texts:
Today we tried to update Magento 2.2.2 to 2.2.3 just by requiring the new version with:

$ composer require magento/product-community-edition 2.2.3 --no-update
$ composer update

But after that running these commands, the following error is shown.

Package "magento/product-community-edition:2.2.3" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package magento/product-community-edition (locked at 2.2.2, required as 2.2.3) is satisfiable by magento/product-community-edition[2.2.2] but these conflict with your requirements or minimum-stability.

Problem 2
        - Can only install one of: tubalmartin/cssmin[v4.1.1, v4.1.0].
        - Can only install one of: tubalmartin/cssmin[v4.1.1, v4.1.0].
        - Can only install one of: tubalmartin/cssmin[v4.1.0, v4.1.1].
        - magento/product-community-edition 2.2.3 requires tubalmartin/cssmin 4.1.1 -> satisfiable by tubalmartin/cssmin[v4.1.1].
        - Installation request for magento/product-community-edition 2.2.3 -> satisfiable by magento/product-community-edition[2.2.3].
        - Installation request for tubalmartin/cssmin (locked at v4.1.0) -> satisfiable by tubalmartin/cssmin[v4.1.0].

I tried to solve this by requiring the latest version of tubalmartin/cssmin[v4.1.1], but that doesn't solve the problem unfortunately.


texts: Assign category to the configurable product or simple products?

texts:
First I have added the simple products and then a configurable product using the simple products.

Is it necessary to add both simple product and configurable product to the category where the product should be shown?


texts: Magento 1 - MTF How to run functional test ?

texts:
Magento 1 ships with a /tests/ folder containing functional test based on PHPUnit and Selenium
( note: you shouldn't deploy this folder to live site :)

I'm looking for some information in order to run those tests and implement my own.


texts: How to modify a variable {{var order.increment_id}} from transactional email

texts:
Does someone know where the value of {{var order.increment_id}} comes from?

The variable is in the “credit memo” template in the transactional email section.

Can someone help? Because I need to create a function and variable to apply in the transactional email but don’t where to create it.

Thank you very much.