texts: What's the workflow of the Magento's orders?

texts:
How Magento process the orders?

I'd like to know the step-by-step.

Thanks


texts: Magento customer account edit form remove password

texts:
I want to change the edit form in the customer account, template /app/design/frontend/theme/theme/template/customer/form/edit.phtml

The current password is required to change the emailaddress and gender for example.
I want to remove this restriction, so that these details can be changed without the current password.

How can I remove this?


texts:
I am using the below code in my block to fetch all orders ,

public function getOrders()
    {
        if (!($customerId = ObjectManager::getInstance()
                ->create('Magento\Customer\Model\SessionFactory')->create()
                ->getCustomer()->getId())) {
            return false;
        }
        if (!$this->orders) {
            $this->orders = $this->getOrderCollectionFactory()->create($customerId)->addFieldToSelect(
                '*'
            )->addFieldToFilter(
                'status',
                ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
            )->setOrder(
                'created_at',
                'desc'
            );
        }
        return $this->orders;
    }

How can I add a filter to it to fetch all orders by a payment method?

I have tried using

  addFieldToFilter('method','ccsave');

But it doesn't seem to work.


texts: Magento 2: How to get type columns of table in sql?

texts: I want get type columns of table in sql ?


texts:
I need an add to cart and buy now button. It is working fine but when I click buy now button, nothing is happening and after a couple of seconds the page is redirecting to the cart page. I need to redirect the page once I click buy now button

Here is the code I am using in addtocart.phtml

 <button type="button" title="<?php echo $this->__('Check out') ?>" class="button btn-cart" onclick="setcheckoutLocation('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo Mage::getUrl('checkout/cart/') ?>')"><?php echo $this->__('Buy Now') ?></button>


texts: Same model rewrite in two modules causes conflict?

texts:
I have two extensions(Comment and Date) created by following this tutorial. They add a new field to one page checkout. Everything went fine unless I tried to put the values from both fields into one 'order confirmation' email template.
The problem is that one extension echoes its value and the other not - but only in emails. On admin or frontend pages they both echo their values respectively.
To print the values in email templates I use:
{{depend order.hasCommentField()}}
{{var order.getCommentFieldHtml()}}

and:
{{depend order.hasDateField()}}
{{var order.getDateFieldHtml()}}

Comment's config.xml where models rewrite is defined:
<global>
 <models>
  <sales>
   <rewrite>
    <order>Beph_Comment_Model_Sales_Order</order>
   </rewrite>
  </sales>
(...)

Date's config.xml where models rewrite is defined:
<global>
 <models>
  <sales>
   <rewrite>
    <order>Beph_Date_Model_Sales_Order</order>
   </rewrite>
  </sales>
(...)

Comment's Beph/Comment/Model/Sales/Order.php:
<?php
class Beph_Comment_Model_Sales_Order extends Mage_Sales_Model_Order{
 public function hasCommentField(){
    $var = $this->getComment();
    if($var && !empty($var)){
        return true;
    }else{
        return false;
    }
 }
 public function getCommentFieldHtml(){
    $var = $this->getComment();
    return $var;
 }
}

Date's Beph/Date/Model/Sales/Order.php:
<?php
class Beph_Date_Model_Sales_Order extends Mage_Sales_Model_Order{
 public function hasDateField(){
    $var = $this->getDate();
    if($var && !empty($var)){
        return true;
    }else{
        return false;
    }
 }
 public function getDateFieldHtml(){
    $var = $this->getDate();
    return $var;
 }
}

I tried renaming 'sales' in one module(with class names and folders) but to no avail.
Is it possible that these two modules are in conflict(since they rewrite same model)? If so how would I fix it?
Thanks.


texts: How to add custom shipping address by customer-group wise address in magento 2

texts:
How can add the custom address in customer group section on admin-side in customer group wise,
store address and fronted checkout page wise default selected this address and also shipping to this
customer group wise shipping address store,
so, how to achieve this functionality if any one have idea about that then suggest me,
Thanks in advance,


texts: Magento 2.1 Admin Category Page Shows Blank (500 Internal Server Error)

texts:
Its quite strange error. I have been working around with Magento 2 since a while now, and I am not sure what went wrong here. Navigating to the following tab on admin:

Product -> Categories

Return a plain empty page. When checked on Network Tab, it shows Internal Server Error with status 500. All the other admin pages are working perfectly fine.

Any help would really be appreciated.


texts: Mod_Pagespeed? Configuration OK but report not

texts:
Here is my configurations;

Here is my configuration for http://181.224.129.45/

ModPagespeed On
ModPagespeedEnableFilters extend_cache
ModPagespeedProgressiveJpegMinBytes 2048
ModPagespeedJpegRecompressionQualityForSmallScreens 70
ModPagespeedEnableFilters resize_rendered_image_dimensions
ModPagespeedEnableFilters recompress_jpeg
ModPagespeedEnableFilters recompress_webp
ModPagespeedEnableFilters recompress_png
ModPagespeedEnableFilters convert_jpeg_to_webp
ModPagespeedEnableFilters resize_images
ModPagespeedEnableFilters jpeg_subsampling
ModPagespeedEnableFilters strip_image_meta_data
ModPagespeedEnableFilters strip_image_color_profile
ModPagespeedEnableFilters convert_gif_to_png
ModPagespeedEnableFilters recompress_images
ModPagespeedEnableFilters inline_images
ModPagespeedEnableFilters rewrite_style_attributes
ModPagespeedEnableFilters local_storage_cache
ModPagespeedEnableFilters rewrite_domains
ModPagespeedEnableFilters inline_google_font_css
ModPagespeedEnableFilters convert_meta_tags
ModPagespeedEnableFilters add_head
ModPagespeedEnableFilters rewrite_css,sprite_images
ModPagespeedEnableFilters lazyload_images
ModPagespeedEnableFilters inline_preview_images
ModPagespeedEnableFilters defer_javascript
ModPagespeedEnableFilters convert_meta_tags
ModPagespeedEnableFilters elide_attributes
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters move_css_above_scripts
ModPagespeedEnableFilters insert_dns_prefetch
ModPagespeedEnableFilters canonicalize_javascript_libraries
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters rewrite_css,rewrite_javascript
ModPagespeedEnableFilters inline_css,inline_javascript
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters remove_quotes
ModPagespeedFileCacheSizeKb 102400
ModPagespeedFileCacheCleanIntervalMs 3600000
ModPagespeedLRUCacheKbPerProcess 1024
ModPagespeedLRUCacheByteLimit 16384
ModPagespeedCssInlineMaxBytes 2048
ModPagespeedImageInlineMaxBytes 2048
ModPagespeedCssImageInlineMaxBytes 2048
ModPagespeedJsInlineMaxBytes 2048
ModPagespeedCssOutlineMinBytes 3000
ModPagespeedJsOutlineMinBytes 3000

This configuration does not breaks anything. When i want to use insert_image_dimensionssite breaks and images are shrinking. Kinda funny though,
Whatever my point is 41 for that ip. It will be raise when i activate cloudflare for sure but i have a customer that insisting pagespeed results must be great. I think im gonna kill him.


texts: How to display total from product listing page based on qty in magento 2.4.2

texts:
Display total base on qty.
Please below image:


texts:
is it possible with Magento (1.9) to create a custom, 10-digit, voucher code for a user/order after the order was placed and paid?
I also need to output it in the PDF or in the user backend.

I need those codes to identify the user at certain events.

Is this possible?

Thank you!


texts: how to get all products from a category which have this attribute?

texts:
I have spent two days in this problem: I can´t find the right solution for getting all products which are related to a specified category and which have the searched attribute.

In my special case: We got a selector for printer colors in three steps:
1. Choose the printer brand
2. Choose the device type (laser printer, inject printer, etc.)
3. Choose the modell type

The related printer colors should be shown now. So I need to find out which they are.

I tried like this:

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$category = Mage::getModel('catalog/category')->load(1274);
$prodCollection = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category);
$prodCollection->addAttributeToSelect('printercolor');
$prodCollection->addAttributeToFilter('printercolor', array('eq' => $currentPrinterDescription);

In the two days I have many alternative solutions for doing this, but none of them worked as accepted.

Hope you guys can help me.

Edit: I solved it myself. My code looks now like this:

$category = Mage::getModel('catalog/category')->load($categoryId);
$prodCollection = $category->getProductCollection()->addAttributeToSelect('my_attribute');
foreach ($prodCollection as $prodAttr)
{
    $var = explode(',', $prodAttr->getData('my_attribute'));
    if ($attr = $prodAttr->getResource()->getAttribute('my_attribute'))
    {
          $af = $attr->getFrontend();
          $selectedOptions = $af->getSelectOptions();
                  foreach ($selectedOptions as $s)
                  {
                        $products[] = trim($s['label']);
                        // ...
                  }
    }
}
// ...


texts: How to replace default Magento editor by Editor based on tinyMCE 4?

texts:
The default Magento Editor has become less effective, no HTML5 support with weak image upload and management, so i need to upgrade editor!

I'm looking for an Editor providing strong enhancements with a sleek and totally fresh new look, yet still keep full compatibility with Magento

Please advise me


texts:
I need some help for url redirection in Magento 2. I want to show my own url in the address bar but the page should be from another url.

For example, if the link is www.xyz.com/blog/post/post.html, then I want it changed to www.xyz.com/post.html in the address bar. How can I achieve this?


texts: Custom Layout Update on product not working for description and short description

texts:
We're using Magento 2.2.6. If we create a custom layout update for the description and short description of a product nothing happens in frontend. Still the old fields are outputted.

How can we change the attribute which is used for the values which are presented in the frontend?

<referenceBlock name="product.info.overview">
    <arguments>
        <argument name="at_call" xsi:type="string">getInternalShortDescription</argument>
        <argument name="at_code" xsi:type="string">internal_short_description</argument>
    </arguments>
</referenceBlock>
<referenceBlock name="product.info.description">
    <arguments>
        <argument name="at_call" xsi:type="string">getInternalDescription</argument>
        <argument name="at_code" xsi:type="string">internal_description</argument>
    </arguments>
</referenceBlock>


texts:
In my magento, I have the following category tree structure like this (note: only a few categories has been expanded):

I would like to generate an array that looks like this:
$categories = [
    'Default Category' => [
        'HAIR' => [
            'Hair Colouring' => [
                'Permanent Hair Colour',
                // ...etc
            ],
            'Styling' => [
                'Gel / Wax / Paste / Po',
                // ...etc
            ]
        ],
        // ... etc
    ]
];

Is this possible? It would be a bonus if I can get the product count in each category node; just like in magento admin backend; for example: Hair colouring (1840)
I have been searching online and I found this code (my starting point):
http://magentotutorial.in/how-to-create-categories-tree-structure-in-magento-programmatically/
But it doesn't quite work, this is what I get back:

Update
After doing some further searching, I had some luck loading the category tree data (linearly) like this:
<?php

require_once 'app/Mage.php';
$app = Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$categoriesArray = Mage::getModel('catalog/category')
        ->getCollection()
        ->addAttributeToSelect('name')
        ->addAttributeToSort('path', 'asc')
        ->load()
        ->toArray();
$categories = array();
foreach ($categoriesArray as $categoryId => $category) {
    if (isset($category['name']) && isset($category['level'])) {
        $categories[] = array(
            'level'  => $category['level'],
            'label' => $category['name']
        );
    }
}

print_r($categories);

This produces the following output:
Array
(
    [0] => Array
        (
            [level] => 0
            [label] => Root Catalog
        )
    [1] => Array
        (
            [level] => 1
            [label] => Default Category
        )
    [2] => Array
        (
            [level] => 2
            [label] => HAIR
        )
    [3] => Array
        (
            [level] => 3
            [label] => Hair Colouring
        )
    [4] => Array
        (
            [level] => 4
            [label] => Permanent Hair Colour
        )
// etc...

I am just now trying to figure out how to parse this output in the structure I want (as shown above).


texts: magento-2-banner-slider block not showing data in magento 2

texts:
I want to show an image slider in my Magento e-commerce home page. I am using magento-2-banner-slider for the job. I have configured the module as given in the documentation. I have added banner and slider.

I have added the following block code into the home page.

{{ block class="Mageplaza\BetterSlider\Block\Slider" template="Mageplaza_BetterSlider::slider.phtml" banner_id="1" }}

In my case slider id is 1 so I have not changed the banner_id

But the home page is just showing the block code as simple text.

I am absolutely new to Magento. Please bear with me if I am making a simple mistake.


texts:
Can anyone please mention how the Magento EE's order archiving feature works. Does it require the default magento CRON enabled(Currently we run it disabled). And how do we know that orders are archived after we enable the setting. also how it will look e.g sales order admin page after the archive.

Thanks


texts:
In my script, I'm retrieving categories like this

$category = $this->_categoryFactory->create();
$storeCategories = $category->getCategories(1, $recursionLevel = 1, false, false, true);

$this->_storeCategories[$cacheKey] = $storeCategories;

$resultArray = [];
foreach($storeCategories as $category) {
    $arr = [];
    $arr['label'] = $category->getName();
    $arr['value'] = $category->getId();
    array_push($resultArray, $arr );
}

Then

$category->getName();

&

$category->getId();

work fine for getting category name and ID, but,

$category->getUrl();

does not work for retrieving category URL, I want to know is it a valid method call or what is the correct method get URL of the category?


texts: Discount code - Order total amount does not match the Barclaycard ePDQ gross total amount

texts:
Magento 1.7.2
I have setup 10% discount code for some products.

If someone use the 10% discount code at the checkout I have been receiving an error from my bank:

"Order total amount does not match the Barclaycard ePDQ gross total amount"

No discount code = no problem.

Could you please advise?


texts: I have slow mySQL queries causing very slow backend when we do changes or editing

texts:
this can be confirmed from the following snippet, showing slow queries that are taking almost 3 seconds to run:
| 1105858 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 3 | Creating sort index | SELECT DISTINCT `main_table`.* FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (' |
| 1105860 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 2 | Creating sort index | SELECT DISTINCT `main_table`.* FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (' |
| 1105861 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 1 | Creating sort index | SELECT DISTINCT `main_table`.* FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (' |
| 1105862 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 1 | Creating sort index | SELECT DISTINCT `main_table`.* FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (' |
| 1105863 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 1 | Creating sort index | SELECT DISTINCT `main_table`.* FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (' |
| 1105864 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 3 | Sending data | SELECT DISTINCT COUNT(*) FROM `search_query` AS `main_table` WHERE (main_table.store_id IN ('1')) A |
| 1105865 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 2 | Sending data | SELECT DISTINCT COUNT(*) FROM `search_query` AS `main_table` WHERE (main_table.store_id IN (1)) AND |
| 1105866 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 1 | Sending data | SELECT DISTINCT COUNT(*) FROM `search_query` AS `main_table` WHERE (main_tabl


texts: Show Specific Categories On Magento Home Page

texts:
Hope someone can help me with this. I need to show 3 specific categories on my Magento home page. I have created a "list-homepage.phtml" file and have the following code in this file

<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
?>

        <a href="<?php echo $this->getCategoryUrl($_category)?>">
        <img src="<?php echo $immagine ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>" class="img-responsive" />

<?php endif; ?>
<?php endforeach; ?>

And I have added this block to my home page in the back-end

{{block type="catalog/navigation" name="catalog.category" template="catalog/category/list-homepage.phtml"}}

The problem with this is that it displays all the categories I have, I just want to display 3, what do I have to do in order to achieve this?

Many Thanks for your help


texts: How to show all store view values on admin grid?

texts: I have an admin grid that have different names across different store views. By default shows only default store view value. Per client request, they want to show the values across all different store views. How can I do so?


texts: How to save value of the new column in the "sales_flat_quote_item"?

texts:
I created in the  installer a new column in "sales_flat_quote_item" named "comment". I set the value and it works but I can't save it in DB.

My piece of code:

$quote_item = Mage::getModel("sales/quote_item")->load(47);
$quote_item->setComment('test'); //field is set correctly.
$quote_item->save(); //but save don't work and my change gone.

Any idea how to save this value?


texts: add animation button addtocart to top cart

texts:
you can add, when you click on the button "add to cart" an animation that brings the button or the photo product to the top cart.

You must try to directly hand or there is something to be activated, even modules?


texts:
I used the Grid to create a report which shows at most 5 rows so I'd like to hide the Paging altogether.  Does anyone know how to hide it?

Thank you for any help!

Tim


texts: Change Selection Price Value Programmatically

texts: How to change selections price programmatically in bundle option - admin.


texts: Magento 2: How to add date filter to new product widget

texts:
I am using new product widget in my custom phtml template. It is showing the newly products.  but i want to add the date filter to this products. How can i do it. Any help appreciated.

template file code:

<?php echo $this->getLayout()->createBlock("Magento\Catalog\Block\Product\Widget\NewWidget")->setDisplayType("new_products")->setProductsCount("20")->setTemplate("product/widget/new/content/new_grid.phtml")->toHtml(); ?>

I have added from and To date fields in product/widget/new/content/new_grid.phtml template but I don't know how to pass this dates to function and get filtered results. Thanks in advance. Any help appreciated.


texts: How to Auto Select Color Option for Products with Only One Color (configurable product)?

texts:
I have some configurable products with a custom color swatches attribute. Lot of them have just one color options, so i 'd like to mark the option as selected in the product page. I added a custom js script to the product page but it works just in chrome console, not in the website.
(Jquery is inthe required function, i don't know why stack's editor does not read it as code)

  var number = $('.swatch-attribute .color').length;
  if(number==1){
    $('.swatch-attribute .color').click();
  }

It does not work and the color option it is still not selected, how can i fix it?


texts:
How I can put the Google AdWords Remarketing in my code?
Is there an extension for magento ?


texts:
I have to make a shop on which products' prices are specific per customer.

I must call an external service which returns me a product price depending of a customer and an ordered quantity.

First, do you think it's possible ?

I don't know where to start. I think I need to programmatically apply a custom shopping cart price rules defined by a custom extension but I don't know how to do this.

Where to start ?
How/Where to deal with price value which depend of ordered quantity ?

Thanks.


texts: Magento redirecting page.html?utm_campaign to page.html

texts:
My magento installation is stripping out URL variables by 301'ing to itself.

E.g:

www.mysite.co.uk/page.html?umm_campaign=123...

to

www.mysite.co.uk.page.html

This means my GA is not tracking properley amongst other problems.

Is there a setting to disable this functionality?


texts: Magento2 Update product description page on extension/plugin/module installation

texts:
How can I update the product description page catalog_product_view.xml on a plugin installation.

I've to develop a plugin which should add an additional button on the product description page.

Is there any hooks or do I have to use interceptors? I haven't tried any code so I can't share it here as I can't figure out how to update the product description page.

Please share necessary information and if possible a sample code to do the same.


texts: Magento 1.9 UK Mail Shipping Issue (Weight Vs Destination)

texts:
I am working on a Magento project and stuck at a point, I have to create a shipping based on weight based like up to 10 KG £ 5 and over 10 KG add £ 2 per KG. I have found an extension i.e Owebia Shipping which is working fine. But the web store owner is using UK MAIL SHIPPING for product delivery and UK MAIL charge shipping amount as shown in the image below :

Now the problem is they charge different price for different zone according to the Post Codes lies between respective zone. Magento does not have such location by default.

Can anyone help me to sort out this or how do I achieve this functionality in magento?

Thank You.


texts: How to add pop up in backend above grid button

texts:
I have successfully added button "Send notification" using following code in m grid.php file:

 public function getMainButtonsHtml()
    {

        $html = parent::getMainButtonsHtml();//get the parent class buttons
        $addButton = $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')
            ->setData(array(
            'label'     => 'Send Notification',
            'onclick'   => "setLocation('#')",
            'class'   => 'task'
        ))->toHtml();
        return $addButton.$html;
    }

How to add pop up on the click of this button?


texts:
what's the difference between:

Mage::getModel('customer/customer')->getCollection()

And

Mage::getResourceModel('customer/customer_collection')

Or with product and product_collection (I think the difference will be the same, no?)


texts: Magneto 2: How to remove duplicate sku with images in each rows of CSV

texts: I am using magento2x. I need to create custom script for removing duplicate sku's with images  with multiple entries of sku's in each rows of csv.if anyone know reply me.


texts:
i want to move the Logo inside a new Div Container with my custom default.xml.
But how can i do this? My default.xml look like this:

<referenceContainer name="header.container">
        <referenceContainer name="header-wrapper">
            <container name="logo-wrapper" label="Page logo" as="logo-wrapper" htmlTag="div" htmlClass="logo content">
                <referenceBlock name="logo">
                    <arguments>
                        <argument name="logo_img_width" xsi:type="number">148</argument>
                        <argument name="logo_img_height" xsi:type="number">43</argument>
                    </arguments>
                </referenceBlock>
            </container>
        </referenceContainer>
</referenceContainer>

Thanks


texts: Severe Slowdown when extension is installed

texts:
I have an extension built that programatically creates an order based on a REST API.  It is working fine on a number of sites, but on 2 it recently has started showing a new behavior.

After about 3 to 5 days the site slows to a crawl (from maximum 3 seconds to load a page to as much as 12) and the site begins to run well again as soon as the extension is uninstalled.  Nothing else is changed in the backend except installing/uninstalling the extension.

My theory was a forced log being left on and creating massive log files.  It's looking like I was wrong.  Now I don't have another theory.  As I follow the code with xdebug and phpstorm, nothing seems to be going wrong, and nothing seems to take a long time.

What are some other possible ways that an extension can cause slow-down, but only after a couple of days?

Any ideas that might lead me in the right direction would be VERY appreciated.

EDITS:

re:can you explain "that programatically creates an order based on a REST API" a bit more? –  andrewkett

A jquery script run on the cart redirects a customer to a 3rd party hosted checkout based on the customers geoip
the customer is redirected back with a new param on the url to my custom controller
the controller makes a call to a RESTful API which returns an xml with order details
the details are then used to build an order with the quote items in magento and the customer/payment info in the XML (based fairly heavily on http://www.devinrolsen.com/creating-magento-orders-programmatically/ )
order is submitted, confirmation emails sent, etc.

this all is working well on a number of sites.


texts:
I've seen a similar thread here but it just doesn't work for me, maybe because of using Magento 2.15 instead of Magento 2.0 which had some major changes.

I'm not able to get Products to show on the Product page, due to "Call to an undefined function toHtml() on null", the getImage function is returning null.

Following this here: Magento 2 - How To Display Cross Sell Products On Product Details Page (PDP)?

Thanks for any help.


texts:
I created a store with Magento 2.2.5 in windows and I used as server xampp.
I installed Debian 9 and I want to move my project to it.

I copied my project folder to /var/www/html
I exported and imported my database
I edited base_url in core_config_data
I edited app/etc/env.php

Now when I want to access to my store through my web browser I got inaccessible page

My other php projects works perfectly.
Thanks.


texts: OneStepCheckout not redirecting to 3rd party payment gateway - Magento 1.9.4

texts:
I am using MageStore OneStepCheckout version 3.5.1 with Magento 1.9.4 CE. I am using 2Checkout payment gateway on my website. However, when I press Place Order button at checkout, it doesnt redirect to the payment gateway. After pressing the button, nothing happens but the order actually gets placed.

I was using the same payment gateway with OneStepCheckout one or two years back and it used to work fine. Now, I am moving back to this payment gateway and its not working. However, another thing to note is that it works fine with the default Magento Checkout. Please have this issue resolve. I also tested it with the latest 3.7.1 version but that gives the same issue.

I have also submitted a ticket to the MageStore but they seem to have discontinued the extension so I dont really expect a solution from them. It would be really helpful if you guys can help me solve this problem as I dont really want to spend for a new one step checkout extension.


texts: Magento - PayPal express checkout button missing in Shopping cart

texts:
Anyone else getting PayPal express checkout button in shopping cart missing?

From older posts It looks like It might be from the server being down?
Anyway, when I got to : fpdbs.paypal.com I can't reach the website.
The button image source is : https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecshortcut&locale=en_GB&ordertotal=#####&pal=########
And that fails too.
Anyone else?


texts: I want the list of products ordered against every order number

texts:
Current report displays products ordered on specific date / month / year. And same report is available for Orders.

How can I get a report which specifies which products were ordered against each order number.


texts:
I am trying magento 2 for first time and it's driving me crazy.

I have successfully installed magento 2 on my cloud shared hosting and everything looks ok except these:

Cannot create category: there is no form populated on Add subcategory or Add root category button click. See attached image 1. See the url in image.
Cannot add product, same as number 1 above.
It keeps saying One or more indexers are invalid. Make sure your Magento cron job is running. I have added cron job from cpanel. See attached image 2.

Images
1.

2.

Not sure what I have to do for this.

Running php version 5.6.x.x

Update

As per this error report

I have done this but it didn't help either.

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;


texts: Magento: I want my bundled product report

texts: It includes the product name and quantity as well as it will display the report on corresponding day how much product ordered. Actually i am selling food product daywise weekly bundled product. Please help me to get custom report in magento i am new here.


texts: what is wrong with robots.txt this file?

texts:
Hi Please check my Robots file. Many things are blocked, I don't think we should add Disallow: /

User-agent: *
Crawl-delay: 10
Allow: /
#Disallow: /

######################################
######## Goole Shopping Images #######
######################################

User-agent: Googlebot
Disallow:

User-agent: AdsBot-Google
Disallow:

User-agent: Googlebot-Image
Disallow:

#######################################
############### SITEMAP ###############
#######################################

Sitemap: https://www.hifix.co.uk/sitemap.xml

#######################################
################ PAGES ################
#######################################

#######################################
##### MAGENTO DIRECTORIES & FILES #####
#######################################

##### Directories #####

Disallow: /404/
Disallow: /app/
Disallow: /cgi-bin/
Disallow: /downloader/
Disallow: /includes/
Disallow: /lib/
Disallow: /magento/
Disallow: /pkginfo/
Disallow: /report/
Disallow: /stats/
Disallow: /var/

##### Paths (clean URLs) #####

Disallow: /index.php/
Disallow: /catalog/product_compare/
Disallow: /catalog/category/view/
Disallow: /catalog/product/view/
Disallow: /catalog/product/gallery/
Disallow: /catalogsearch/
Disallow: /checkout/
Disallow: /control/
Disallow: /contacts/
Disallow: /customer/
Disallow: /customize/
Disallow: /newsletter/
Disallow: /poll/
Disallow: /review/
Disallow: /sendfriend/
Disallow: /tag/
Disallow: /wishlist/

##### Files #####

Disallow: /cron.php
Disallow: /cron.sh
Disallow: /error_log
Disallow: /install.php
Disallow: /LICENSE.html
Disallow: /LICENSE.txt
Disallow: /LICENSE_AFL.txt
Disallow: /STATUS.txt

#######################################
######## QUERY STRING BLOCKER #########
#######################################

#Disallow: /*?*

#######################################
########### SCREAMING FROG ############
#######################################

User-agent: Screaming Frog SEO Spider
Allow: /
Disallow: /*.gif$
Disallow: /*.jpg$
Disallow: /*.png$
Disallow: /*.bmp$
Disallow: /*.xml$
Disallow: /*.css$
Disallow: /*.js$

Please suggest, what is wrong with this file?

Don't know who added
Disallow:

I think disallow should not be in here as I want Googlebot to index images and pages


texts: Magento 2.3 - Product images in order history

texts:
I want to load max 3 product images in the order history page on customer account.

I currently have a perfectly working code using $objectManager. But because Magento does not recommend to use objectManager, I want to transform this into a module.

How can I transform this code into a module?

Code:

<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $_product = $objectManager->get('Magento\Catalog\Model\Product')->load($itm->getProductId());
            $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');
            $image_url = $imageHelper->init($_product, 'product_page_image_small')->setImageFile($_product->getImage())->resize(160, 160)->getUrl();?>

EDIT:

namespace Vendor\OrderProductImage\Block\Item;

class Renderer extends \Magento\Framework\View\Element\Template
{

public function getProductCollectionWithImage(array $productIds)
    {
        $filter = $this->filterBuilder->setField('entity_id')
            ->setConditionType('in')
            ->setValue($productIds)
            ->create();

        $searchCriteria = $this->searchCriteriaBuilder
            ->addFilters([$filter])
            ->create();

        $result = $this->productRepository->getList($searchCriteria);

        $parsedCollection = $this->collectionFactory->create();

        if ($result->getTotalCount() > 0) {
            foreach ($result->getItems() as $item) {
                $item->setImage($this->buildImage($item));
                $parsedCollection->addItem($item);
            }
        }

        return $parsedCollection;
}
private function buildImage(\Magento\Catalog\Api\Data\ProductInterface $item)
    {
        return $this->imageBuilder->create($item, 'category_page_grid')->toHtml();
    }

}

History.phtml

<?php foreach ($_orders as $_order) : ?>
<div class="order-row row align-items-center" onclick="window.location = '<?= $block->escapeUrl($block->getViewUrl($_order)) ?>'">

        <a href="<?= $block->escapeUrl($block->getViewUrl($_order)) ?>">
            <?= $block->escapeHtml($_order->getRealOrderId()) ?> - <?= $block->formatDate($_order->getCreatedAt(), \IntlDateFormatter::LONG) ?>

<?= $block->escapeHtml($_order->getStatusLabel()) ?>

        <?php $items = $_order->getAllVisibleItems(); $item =  array_slice($items, 0, 3); foreach($item as $itm): ?>
        <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $_product = $objectManager->get('Magento\Catalog\Model\Product')->load($itm->getProductId());
            $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');
            $image_url = $imageHelper->init($_product, 'product_page_image_small')->setImageFile($_product->getImage())->resize(160, 160)->getUrl();?>

                        <img src="<?php echo $image_url;?>" border="0" alt="order-product-image" />

                        <?php echo substr($this->escapeHtml($itm->getName()), 0, 20) ?>

        <?php endforeach;?>

<?php endforeach; ?>


texts:
Can anyone see what I am doing wrong here. It displays All categories instead of only showing the specific website/store categories.
$collection = $this->_categoryCollectionFactory->create();

$collection->addAttributeToFilter('featured_category', 1)
        ->addFieldToFilter('is_active', 1)
        ->addAttributeToSort('featured_sortorder')
        ->addAttributeToSelect('*');

$collection->setStore($this->_storeManager->getStore());

Update:
I got it working by adding a path filter. It now shows the categories by website/store.
/**
 * Retrieve featured categories
 *
 * @return \Magento\Catalog\Model\ResourceModel\Category\Collection
 * @throws \Magento\Framework\Exception\LocalizedException
 * @throws \Magento\Framework\Exception\NoSuchEntityException
 */
public function getFeaturedCategories()
{
    $rootCategoryId = $this->_storeManager->getStore()->getRootCategoryId();

    $collection = $this->_categoryCollectionFactory->create();
    $collection->addIsActiveFilter()
        ->addAttributeToFilter('path', array('like' => "1/{$rootCategoryId}/%"))
        ->addAttributeToFilter('featured_category', 1)
        ->addAttributeToSort('featured_sortorder')
        ->addAttributeToSelect('*');
    return $collection->load();
}


texts: Why reset the customer session data when FPC is enabled?

texts: Regarding this article from @SohelRana what is the business or technical decision to empty the customer session data when FPC is enable?


texts: Where is the template file for the front-end grid view in Magento 2.3?

texts: I need to overwrite the front-end grid view but cannot find the correct file. This is the grid view that appears as a front end option for categories and search - not the admin grid.


texts: I would like to know where can I find the CSS files that display the menu in mobile view? So basically I'm looking for this file that when the view reaches 767px width the menu will collapse and will display the nav-toggle button to display the mobile menu. Can anyone point me to the exact file?


texts: Magento 2.3: product quantity shows negative value but I have the backorders disabled

texts: why I have negative stock qty? I don't enable the backorders options and any products show negative values. Any idea?  Working in Magento 2.3. Regards.


texts: What is the role or composer.json in magento 2? How it is better to use?

texts:
Kindly provide me a role of composer.json in magento2 in brief.

How to use composer.json file in Magento 2 and what is its main role in project?

Thanks


texts: Auto Enable/Disable based on the Stock Status

texts:
I'm trying to disable the product if it's out of stock and enabled if it's in stock

Here's the observer I created:

public function product_prepare_save($observer) {
        $product = $observer->getProduct();
        $stockData = $product->getStockData();

        if ( $product && $stockData['qty'] ) {

            $stockData->setData('is_in_stock', 1); // Set the Product to InStock
            Mage::getModel('catalog/product_status')->updateProductStatus($product->getProductId(), $storeId, Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

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

What am I missing over here?


texts:
Since I am just adding a product attribute which is stored in EAV tables, this is how InstallData.php looks like

<?php

namespace Namespace\Modulename\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;

    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'customer_product_points',
            [
                'type' => 'decimal',
                'backend' => '',
                'frontend' => '',
                'label' => 'Customer Product Points',
                'input' => '',
                'class' => '',
                'source' => '',
                'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => 0,
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => false,
                'unique' => false,
                'apply_to' => ''
            ]
        );
    }
}

Executing php magento setup:upgrade I was able to see new attribute in the system.

But the attribute is not visible while adding a new product. Have I missed anything here ? I need to add points to products and same will be reflected on frontend.


texts: Magento 1.9.1 Configurable swatches not generating images nor directory in Media > Catalog > Swatches > 1

texts:
We have identical local and staging environments on git, and on the same branch, but the configurable swatch assets are not displaying on the staging site. I've narrowed this down to the images not being present in the directory "media > catalog > swatches > 1…". When we load the page locally Magento will generate sized images within the directory, however this is not the case on our staging server. I'm trying to understand why this is the case. I've already confirmed the following:

Ensured all files are the same
Ensured databases are the same
Ensured the default and proper permissions are applied to each folder and file

Could anyone comment on why this is happening and what I might possibly do to resolve it?

Thanks you for your assistance in advance!

Alex


texts: Magento Shopping cart sales rule not removed when applicable product removed from cart

texts:
I have added two products one is for eligible coupons another one not eligible.

Then  I applied coupon code, code is applied fine.
After some time I removed coupon eligible item, coupon code is not showing, but when I added again same item to cart it automatically came.
How to remove coupon code when applicable product removed from cart.

steps to reproduce issue.

1>add two prodcts one applicable and another one is not applicable item
2> apply coupon code
3> getquote[estimate]
4> remove applicable item
5>after remove done add again
5>getquote[estimate]


texts: How to get associated product Id's from grouped product Id?

texts:
I try many solutions but i can't get the result please help me for getting associated products from grouped productId like for configurable product we use
$parent_pro = $objectManager->create('Magento\Catalog\Model\Product')->load($productId);
$_children = $parent_pro->getTypeInstance()->getUsedProducts($parent_pro)

How can I get Grouped child products?


texts:
How does this work? I cannot seem to find anything on it.
I'm looking for a way to validate a field before before_save. If condition are good, then continue, otherwise throw error. This would happen in the product admin.

For example...keep in mind this is an example.

$product = $observer->getProduct();

$weight = $product->getWeight();

If(!$weight())
{
Validation Error(Or if we could just make the attribute required on this event or Zend validation )
}

I've tried on the before_save, but just not working.

Mage::throwException(Mage::helper('catalog')->__('Weight is blank));

I've added my code.
The challenge now is that when I 'Save' it fires. However, if I don't do anything It won't fire a second time. On a third time it fires again as an endless loop. This prevents the logic from working as intended.

$product = $observer->getProduct();

$erpsku = $product->getErpSku();
$weight = $product->getWeight();
$DimensionalShippingHeight = $product->getDimensionalShippingHeight();
$DimensionalShippingWidth = $product->getDimensionalShippingLength();
$DimensionalShippingLength = $product->getDimensionalShippingWidth();

$productModel = Mage::getModel('catalog/product');
$attr = $productModel->getResource()->getAttribute('erp_sku');
$erpskuoptionvalue = $attr->getSource()->getOptionId('Sales');

if(($erpsku == $erpskuoptionvalue) && !$weight && (!$DimensionalShippingHeight || !$DimensionalShippingWidth || !$DimensionalShippingLength))
{

   Mage::throwException('Please fill in Weight & All Shipping Dimensions');

}
elseif(($erpsku == $erpskuoptionvalue) && !$weight)
{

   Mage::throwException('Please fill in Weight');

}
elseif(($erpsku == $erpskuoptionvalue) && (!$DimensionalShippingHeight || !$DimensionalShippingWidth || !$DimensionalShippingLength))
{

   Mage::throwException('Please fill All Shipping Dimensions');

}


texts: Let non-admin backend users change their own password

texts:
I have a shop with multiple users, some of them with quite restricted rights (handling orders only).
I have however not found a solution to let them change their own password without involving an admin or giving them the rights to change all users in the shop.
Is there a way to achieve a way to let non-admin users set their own password (possibly also with password guidelines, but this is not necessary) without involving another party?


texts: Unable to override model class, only this file has problem

texts:
I am overriding Worldpay Model class that create xml request file.

<?xml version="1.0" encoding="UTF-8"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <preference for="Sapient\Worldpay\Model\XmlBuilder\RedirectOrder" type="Company\Worldpay\Model\XmlBuilder\RedirectOrder" />
    </config>

Model code:

    <?php
    /**
     * @copyright 2017 Sapient
     */
    namespace Company\Worldpay\Model\XmlBuilder;

    use Sapient\Worldpay\Model\XmlBuilder\Config\ThreeDSecureConfig;

    /**
     * Build xml for RedirectOrder request
     */
    class RedirectOrder extends \Sapient\Worldpay\Model\XmlBuilder\RedirectOrder
    {
//code here
    }

I am unable to override this piece of code.
As I do the same thing for another file its override successfully but this RedirectOrder is not.
Please refer complete file that I want to override.

updated constructor code:

public function __construct(array $args = array())
    {
         $this->threeDSecureConfig = new \Sapient\Worldpay\Model\XmlBuilder\Config\ThreeDSecure();

        $this->tokenRequestConfig = new \Sapient\Worldpay\Model\XmlBuilder\Config\TokenConfiguration($args['tokenRequestConfig']);
        $this->shopperId = $args['shopperId'];

    }


texts:
I know that a lot of code that is currently in Magento 2 (2.1.2) is more or less ported from Magento 1 and that a lot of code will be substituted by an equivalent in the future. In this aspect, I'm wondering what's the future of collections in Magento 2.

Let me explain:

Magento 1:

In Magento 1 we are used to get a collection like this:

$products = Mage::getModel('catalog/product')->getCollection();

We could then apply filters and other operations to the collection:

$products->addAttributeToFilter('price', ['gteq' => 10]);
$products->addFieldToFilter('created_at', ['lt' => '2016-10-10']);
$products->setPageSize(10);
// ... etc ...

And last but not least, our collection would return the models:

foreach ($products as $product) {
    echo get_class($product); // Mage_Catalog_Model_Product
}

Magento 2:

Magento adds a lot of new layers of abstraction, implementing a more SOLID way of working. This means that when we want a list of entities, we ask it from a repository:

$productResults = $this->productRepository->getList($searchCriteria);

If we want to apply filters we use a combination of the SearchCriteriaBuilder, the FilterGroupBuilder, the FilterBuilder and the SortOrderBuilder:

$this->searchCriteriaBuilder->addSortOrder(
    $this->sortOrderBuilder
        ->setField('created_at')
        ->setAscendingDirection()
        ->create()
);
$priceFilter = $this->filterBuilder
    ->setField('price')
    ->setValue(10)
    ->setConditionType('gteq')
    ->create();
$createdAtFilter = $this->filterBuilder
    ->setField('created_at')
    ->setValue('2016-10-10')
    ->setConditionType('lt')
    ->create();
$filterGroups = [
    $this->filterGroupBuilder->addFilter($priceFilter)->create(),
    $this->filterGroupBuilder->addFilter($createdAtFilter)->create()
];

And if we want to iterate over our results, we get Data Models, not actual (inherited) models:

foreach ($productResults->getItems() as $product) {
    echo get_class($product); // \Magento\Catalog\Model\Data\Product
}

This kind of abstraction follows the SOLID principle and embraces the 'composition over inheritance'-principle. Any 'exotic' operations that would be otherwise done on the collection (like joins for examples) are done internaly in the repository, which makes it also easier to use outside of the module.

The question:

All of this makes me wonder: with the whole repository / data model-approach, is there any room in the future of Magento 2 for collections? Are collections only to be used internally by the module itself and not outside of it? Or are the going to be deprecated in favour of the Entity Manager?

Currently, if you want to embrace Data Models, you still have to create an inherited model (inherited from \Magento\Framework\Model\AbstractModel) just to get the collection working (since Magento\Framework\Data\Collection::setItemObjectClass requires the model to extend from Magento\Framework\DataObject). And you need to collection to be able to filter in your repository. But then again, in the repository you have to 'convert' your (regular) Model to a Data Model.

Or do we have to implement it like the Order Repository, where the getList() returns an instance of Magento\Sales\Api\Data\OrderSearchResultInterface, but under water the search results are nothing more than a regular collection that implements this interface. Fun fact: the search results states it will return an array of Data Models (Magento\Sales\Api\Data\OrderInterface[]), but if you analyze the code, getItems() will execute Magento\Framework\Data\Collection::getItems() which in return returns not the data models, but the order models (as set by Magento\Sales\Model\ResourceModel\Order\Collection::_construct()). So much for 'composition over inheritance'.

A lot of questions on what's the proper way in Magento 2. Again, there are 100 ways of doing the same thing, but what is 'The Magento Way'? Or am I just totally on the wrong track here?


texts: How to set customer custom attribute in magento 2?

texts:
I have created some custom attributes for a customer in magento2 community edition,

I have used below code to set in my custom code

use Magento\Customer\Api\AccountManagementInterface;
use Magento\Framework\App\Action\Context;
use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Model\CustomerExtractor;

class CreateCustomer extends \Magento\Customer\Controller\AbstractAccount
 {
  protected $customerRepository;
  protected $accountManagement;
  protected $customerExtractor;

  public function __construct(
    Context $context,
    AccountManagementInterface $accountManagement,
    CustomerExtractor $customerExtractor,
  ) {
    $this->accountManagement = $accountManagement;
    $this->customerExtractor = $customerExtractor;
   parent::__construct($context);
}
  public function execute()
{
  try {
       $customer = $this->customerExtractor->extract('customer_account_create', $this->_request);
        $password = $this->getRequest()->getParam('password');
        $confirmation = $this->getRequest()->getParam('password_confirmation');

        $customer = $this->accountManagement
            ->createAccount($customer, $password, $redirectUrl);

         $this->customerRepository = ObjectManager::getInstance()->get(
            \Magento\Customer\Api\CustomerRepositoryInterface::class
        );

        $customer->setCustomAttribute('is_checked', 0);
        $this->customerRepository->save($customer);
 }catch (StateException $e) {
      print_r($e->getMessage());
   }
  }
}
 $customer->setCustomAttribute('is_checked', 0);

This attribute is a custom attribute and I have set default_value as 0, but it is not saving on creating a customer. I can't see any value in the table for any of the customers.

This is not storing in the table. What is the reason please anyone helps me with this.

Here is the screenshot for the attribute in the table

attribute_code is customer_activated.


texts: I want to Add product quantity increment like 2pkt,4pkt and 8pkt and i also want to discount like 2pkt with 7% , 4pkt with 10% and 8pkt with 15% give discount.


texts: Fixed Amount Discount Code not working when two different items added to cart

texts:
I am using Magento and am trying to apply a coupon code which discounts a fixed amount of £5 off any order over the value of £149. The code is working fine until two different items are added to the cart. Even if the value is over £149, as soon as there are two or more different items the code is discounting seemingly random amounts such as £2.33 or £1.21. The amount seems to vary with the number of items in the cart as soon as a second item is added.

The code is configured as 'Fixed amount discount for whole cart' and did work previously, I'm not sure why this glitch is occurring now. Is anyone able to advise please? Thanks in advance.


texts: How do the extension attributes work in Magento 2?

texts:
I'm not sure what the docs are saying.

I know they're used to add attributes (complex or not) via etc/extension_attributes.xml and I managed to make the compilation process create an interface with auto-generate custom methods, but that's about it.

Let's take for example a couple of interfaces: github link 1 and github link 2. How can I use extension attributes to add certain attributes in one of those interfaces? I'm not interested in complex joins. Just adding a scalar attribute, say "attr1" of type string.

The Data interfaces are the gateway to the model's erm... data, so I need to understand how the extension of those interfaces work in order to properly use the system. I frequently get a Data interface as a param instead of an actual model, and that's ok actually. But I'm a little confused on how the extensions work.


texts: Magento 2 : Add Import new Entity type in "Import Settings"

texts:
I am not sure how to create new entity type in Import Settings dropdown.
What would be the best way to add a custom value in dropdown ?


texts: I am not able to delete the seller_id attribute

texts:
I am not able to edit any product from my backend and it's showing:

""Source model "marketplace/source_option" not found for attribute "seller_id"

Trace:

#0 /home/lagootug/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(387): Mage::exception('Mage_Eav', 'Source model "m...')
#1 /home/lagootug/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(201): Mage_Eav_Model_Entity_Attribute_Abstract->getSource()
#2 /home/lagootug/public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php(70): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset), Array)
#3 /home/lagootug/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm()
#4 /home/lagootug/public_html/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml()
#5 /home/lagootug/public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php(79): Mage_Core_Block_Abstract->toHtml()
#6 /home/lagootug/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs->_prepareLayout()
#7 /home/lagootug/public_html/app/code/local/Ced/CsMarketplace/Model/Layout.php(79): Mage_Core_Block_Abstract->setLayout(Object(Ced_CsMarketplace_Model_Layout))
#8 /home/lagootug/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Ced_CsMarketplace_Model_Layout->createBlock('adminhtml/catal...', 'product_tabs')
#9 /home/lagootug/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/catal...', 'product_tabs')
#10 /home/lagootug/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#11 /home/lagootug/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#12 /home/lagootug/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#13 /home/lagootug/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#14 /home/lagootug/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(Array, true, true)
#15 /home/lagootug/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(250): Mage_Adminhtml_Controller_Action->loadLayout(Array)
#16 /home/lagootug/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->editAction()
#17 /home/lagootug/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit')
#18 /home/lagootug/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/lagootug/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/lagootug/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/lagootug/public_html/index.php(83): Mage::run('', 'store')
#22 {main}

Please help me with steps.


texts: How to include third party library files to custom module without composer

texts:
I need to include Youtube API library files for my custom module.
Without composer, it should be done.
Any suggestions?


texts:
I am trying to migrate Magento v1.9.5 data to Magento v2.3.5 using the following command:
bin/magento migrate:data --reset --auto /app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.4.5/config.xml
This fails with this error:
[ERROR]: Not mapped id key 396 found for eav_entity_attribute.attribute_id
Can anybody give me any pointers in how to resolve this?


texts: what is the need of implement arrayaccess interface for Varien_Object class?

texts:
I know using ArrayAccess interface we can use object as array(getting setting unseting).And i have idea that ArrayAcess interface contain 4 undefined methods.we should implement these methods if class implements arrrayacess.
i removed "implements arrayaccess" from Varien_Object class.but still i'm not getting any error.
so my question is where Varien_Object reference used as array?.
please give me some examples.and why i'm not getting any error?
thanks in advance.


texts: You need to choose options for your item in Magento2 after running command indexer:reindex

texts:
I Moved database and webserver files from one server to another. After moving everything works fine. But when i run php bin/magento indexer:reindex on new server then while adding products programmatically it shows me this error on new server.
You need to choose options for your item

Actually after debugging i found that collection is not returning me data with attributes however i added $collection->addAttributeToSelect('*') in my code. But before running indexer:reindex command it returns me all data with all attributes. After running command it will not return collection with attributes. I am using magento 2.3 ce.

After further dubug i found that in my configurations flat table was on

After turning selecting No the issue disappear.
But the problem is why i cant load my collection with attributes when use flat catalog product is enables.
Ofcourse after enabling flat catalog we will get more better performance.But how we fix this issue with flat catalog enables.


texts: How can I display the grand total in the minicart? - Magento2

texts:
I currently have my subtotal tax settings set to 'Display subtotal excluding tax'. This has changed the subtotal in the minicart to display the subtotal excluding tax.

How can I display the grand total of the order including tax in the highlighted area with the settings mentioned above?


texts: Miss data in backend and frontend (dublicated)

texts:
I ask this question few days ago but because i couldn't get an answer i had to ask this question again. sorry for this but i can't continue my work because of this problem.

This is the link of my question

I transfer my site from windows server to Linux, after that when i log in to the back-end i saw that the newsletter option in menu is disappear and i haven't newsletter option in menu!!!

Also this problem happened for search and all these links are disappear in front-end!!!

I also set permissions to 777 but nothing has changed!!!

How can i fix this problem? Where is the problem? I searched so much about this but i couldn't get any solution for it.


texts:
I have move my Magento 2 website from shared host to VPS. I just finished moving site and it is loading fine. For some reason header.panel block is now missing in the header of site?

I have compared new site to backup of old site and there are no differences in any files. I can not work out why it is no longer displaying.

I have tried recompiling the site but no luck.

Does anyone have any ideas why it would now not be being displayed?


texts: Magento 2 - Category Image URL showing two paths

texts:
Bit of a strange one, but hopefully it's easy to resolve.

I have uploaded some product Category images to certain category pages in the Admin client but when I view them on the web they don't load. The reason appears to be that it is trying to load two paths in the src attribute, which are slightly different.

Any ideas what I need to do to resolve this... :-)

src="https://www.myurl.com/pub/media/catalog/category//pub/media/catalog/tmp/category/25mm.jpg"

As you can see there are two paths in the URL, one has "tmp" (in bold) and if I modify the SRC this one loads. It appears that it is prepending the URL?

Any ideas would be appreciated.

src="/pub/media/catalog/tmp/category/25mm.jpg" <- This one loads the image?


texts:
I'm doing an e-commerce multivendor, so when a customer buys from the website I need to do an order split and payment split. The payment seems to be more problem, how can I automatically do this?
I was thinking in an observer before order placed or pluginBefore. But I have no idea of the module that does this.
Greetings!


texts: Magento2 view Left nagivation is not loading at Participant Cours page

texts:
Sorry, when i click menu i created (Participant Course), i don't know why I can't load the magento interface

This is my customer_account.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">
<update handle="customer_account"/>
<body>
    <referenceBlock name="customer_account_navigation">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-custom">
            <arguments>
                <argument name="path" xsi:type="string">course/manage/course</argument>
                <argument name="label" xsi:type="string">Participant Course</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>
</page>

Please help me!


texts:
I have defined a lastname2 attribute for customer and customer_address, it shows up correctly in all forms, but when I'm creating a new address, its does not get 'prefilled' with the customer's value.

Any clues on how to do it?

The definition of my fields:

$entityAttributes = array(
        'customer'=>array(
            'lastname2' =>  array(
                'store_label'=>'Apellido Materno',
                'label' => 'Apellido Materno',
                'input' => 'text',
                'type'  => 'varchar',
                //System =  False and visible true = Show in 'customer_account_create', 'customer_account_edit', 'checkout_register'
                'system'=>true,
                'visible'=>true, //Watch out!! Only visible fields get processed by the form controllers!!!
                'user_defined'=>false,
                'used_in_forms' => array('adminhtml_customer', 'customer_account_edit', 'checkout_register','customer_account_create'),
                'required' => 0,
                'position' =>69
            ),),
'customer_address'=> array(
            'lastname2' =>  array(
                'store_label'=>'Apellido Materno',
                'label' => 'Apellido Materno',
                'input' => 'text',
                'type'  => 'varchar',
                //System =  False and visible true = Show in 'customer_account_create', 'customer_account_edit', 'checkout_register'
                'system'=>false,
                'visible'=>true, //Watch out!! Only visible fields get processed by the form controllers!!!
                'user_defined'=>false,
                'used_in_forms' => array('customer_account_create','customer_register_address','customer_address_edit','adminhtml_customer_address','adminhtml_customer'),
                'required' => 0,
                'position' =>49
            ),
        ),
    );
# Install Attributes
    foreach($entityAttributes as $entity=>$attributes)
    {
        foreach($attributes as $attribute_code=>$definition)
        {
            $installer->addAttribute($entity, $attribute_code,  $definition);

            /**
            * @var Mage_Eav_Model_Config
            */
            Mage::getSingleton('eav/config')
            ->getAttribute($entity, $attribute_code)
            ->setData('used_in_forms',$definition['used_in_forms'])
            ->save();
        }
    }

My config.xml (relevant extracts, the full version is here)

<global>
<!-- [...] -->
        <fieldsets>
            <!-- @see http://www.excellencemagentoblog.com/customer-registration-fields-magento1-6 -->
            <customer_account>
                <lastname2>
                    <create>1</create>
                    <update>1</update>
                    <name>1</name>
                    <to_quote>customer_lastname2</to_quote>
                    <to_customer_address>lastname2</to_customer_address>
                    <to_customer_address>customer_lastname2</to_customer_address>
                </lastname2>
            </customer_account>
            <customer_address>
                <lastname2>
                    <to_quote_address>*</to_quote_address>
                </lastname2>
            </customer_address>
        </fieldsets>
<!-- [...] -->
</global>

Edit: Its not the browser's autofill, I want to replicate the behaviour of the firstname and lastname fields, that show the customer's first and lastname (respectively) by default


texts: How to add custom Email attachment with .html format

texts:
I have to add the email attachment. I have create a custom module

public function execute()
{
    $post = $this->getRequest()->getPostValue();
    if (!$post) {
        $this->_redirect('/');
        return;
    }

    $this->inlineTranslation->suspend();
    try {
        $recipientMail = $this->getRequest()->getPostValue('email');

        $postObject = new \Magento\Framework\DataObject();
        $postObject->setData($post);

        $error = false;

        $sender = [
          'name' => 'Test',
          'email' => 'test@gmail.com',
        ];

       $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;

       $transport = $this->_transportBuilder
        ->setTemplateIdentifier('send_email_email_template') // this code we have mentioned in the email_templates.xml
        ->setTemplateOptions(
            [
                'area' => \Magento\Framework\App\Area::AREA_FRONTEND, // this is using frontend area to get the template file
                'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
            ]
        )
        ->setTemplateVars(['data' => $postObject])
        ->setFrom($sender)
        ->addTo($recipientMail)
        ->getTransport();

       $transport->sendMessage();
       $this->inlineTranslation->resume();
       $this->messageManager->addSuccess(
        __('Thanks for contacting us. We\'ll respond to you very soon.')
    );
       $this->_redirect('/');
      return;
   } catch (\Exception $e) {
       $this->inlineTranslation->resume();
       $this->messageManager->addError(
        __('We can\'t process your request right now. Sorry, that\'s all we know.' . $e->getMessage())
    );
       $this->_redirect('/');
       return;

   }
  }
}


texts: Magento 1.7: PCI scan Can't Pass category URL with 'mode' param

texts:
Don't know why but the PCI scan do not pass Category URL of Magento and provide a SQL injection with 'mode' param in the below format.

/main-category/sub-category/l/price:10-20/category-name.html?dir=desc&mode=x'%2Bsleep(15)%2B'&order=name HTTP/1.0

How should I resolve this type of issue?
Do anybody have gone through it, if yes please provide your kind suggestions.

Thanks in Advance


texts: Magento 2 How to identify order is placed from frontend or rest API?

texts:
How to identify order is placed from frontend or rest API ?
when we are trying to area code from any event after order placed
$this->_checkState->getAreaCode()

then we are getting always area code is "webapi_rest"
it must be frontend.
If checkout placed order is using REST API then how to identify order placed is from frontend or rest API or any other medium?


texts: I need table name with prefix in custom controller file. [magento 2]

texts:
public function checkHelpful($rid ,$pid ,$uid )
{
    $connection = $this->objectManager->get('Magento\Framework\App\ResourceConnection');
    $tbl = $connection->getTableName('catalog/product_index_price');
    echo $table;
}

the output of this is 'catalog/product_index_price'. Not getting the exact table name with prefix.


texts: How to get all cms blocks ids where "is_slider" = true?

texts:
Modyfying current slider system to make it a little bit more autonomous as in it's original form I must manually remove code from list if specific products is already gone or promotion is over so I added additional attribute into table "is_slider", "start_date" and "end_date" but my collection does not work.
What I've done wrong ?

    $collection = Mage::getModel('cms/block')->getCollection()
      ->addAttributeToSelect('*')
      ->addFieldToFilter('is_slider', '1')
      ->getAllIds()
      ;

Of course this code should select only ids where "is_slider" is true, regardless what date is but it is not important for now.

How to get only those Ids where "is_slider" = true?

OMG I'm blind ......
Yes of course it does work after I changed it from "page" to "block"


texts: ReflectionException when installing Magento 2.3.2 on Debian 10.0.0

texts:
I am trying to install Magento 2.3.2 (with Sample Data) on Debian 10.0.0 but when I try to run the setup it shows this error:

Fatal error: Uncaught ReflectionException: Class Magento\Framework\App\ResourceConnection\Proxy does not exist in /opt/lampp/htdocs/magento2/vendor/magento/framework/Code/Reader/ClassReader.php:19 Stack trace: #0 /opt/lampp/htdocs/magento2/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...') #1 /opt/lampp/htdocs/magento2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(49): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...') #2 /opt/lampp/htdocs/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Framewo...') #3 /opt/lampp/htdocs/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') #4 /opt/lampp/htdocs/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ in /opt/lampp/htdocs/magento2/vendor/magento/framework/Code/Reader/ClassReader.php on line 19

Setup:

XAMPP: 7.2.21
PHP: 7.2.21
OS: Debian 10.0.0


texts:
After deleting an attribute and product attribute I can't run

  php bin/magento cron:run

anymore. Also in the backend of Magento,

  backend>content>Design>configuration

I get the following error message:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'mcm2017_cd.design_config_grid_flat' doesn't exist, query was: SELECT COUNT(*) FROM `design_config_grid_flat` AS `main_table`

Error Message on running ssh: php bin/magento indexer:reset

  mcm2017@mcmtravels.com [~/mcmtours.at]# php bin/magento
  indexer:reindex Design Config Grid indexer process unknown error:
  SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'mcm2017_cd.design_   config_grid_flat' doesn't exist, query was:

CREATE TABLE IF NOT EXISTS `design_config_grid_flat` (
  `entity_id` int UNSIGNED NOT NULL COMMENT 'Entity ID' ,
  `store_website_id` int NULL COMMENT 'Store_website_id' ,
  `store_group_id` int NULL COMMENT 'Store_group_id' ,
  `store_id` int NULL COMMENT 'Store_id' ,
  `theme_theme_id` varchar(255) NULL COMMENT 'Theme_theme_id' ,
  PRIMARY KEY (`entity_id`),
  INDEX `DESIGN_CONFIG_GRID_FLAT_STORE_WEBSITE_ID` (`store_website_id`),
  INDEX `DESIGN_CONFIG_GRID_FLAT_STORE_GROUP_ID` (`store_group_id`),
  INDEX `DESIGN_CONFIG_GRID_FLAT_STORE_ID` (`store_id`),
  FULLTEXT `DESIGN_CONFIG_GRID_FLAT_THEME_THEME_ID` (`theme_theme_id`)
) COMMENT='design_config_grid_flat' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci
Customer Grid index has been rebuilt successfully in 00:00:03
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00

I've tried to create the table design_config_grid_flat in the database, but without success.

Is that what I have to do? Some help would be highly appreciated!


texts: sql query for shipping countries from my sales order

texts:
I need to write a SQL query to get all countries where we have shipped al orders.

Which table has all sales order countries?
I am not able to find all the countries.


texts: How to add validation in phone number to display in the form of 123-456-7890 at checkout page in Magento 2

texts: Need to add validation in phone number and also display format i.e automatically it display in the form of 123-456-7890


texts: Global variable override by Bootstrap style

texts:
I have declare h1 tag font size in global variable,
app\design\frontend\zero_theme\theme\web\css\source\components_variables.less
@h1__font-size: 48px !important;

Declare inside the custom less file,
C:\xampp\htdocs\mage\app\design\frontend\zero_theme\theme\web\css\source\components\common.less
h1 {
    font-size:@h1__font-size;
}

When i see website home page, the font override by bootstrap font.
How to apply by global variables to home page?


texts:
I am trying to import a font (have Luma theme installed) with no success. Browsed similar threads about this, made changes in typography and variable files, but still can't get rid of the default 'Open sans' font.

Here's my css file:

@font-face {
font-family: 'Chalet';
font-style: normal;
font-weight: 400;
src: url('C:xampp/htdocs/testshop/vendor/magento/theme-frontend-  luma/web/fonts/LEGO-Chalet-60-Tab-Regular.eot'); /* IE9 Compat Modes */
src: local('Chalet'), local('Chalet'),
url('../fonts/LEGO-Chalet-60-Tab-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */

   url('../fonts/LEGO-Chalet-60-Tab-Regular.woff') format('woff'), /* Modern Browsers */
   url('C:xampp/htdocs/testshop/vendor/magento/theme-frontend-  luma/web/fonts/LEGO-Chalet-60-Tab-Regular.ttf') format('truetype'), /* Safari, Android, iOS */

}  (tried also full local path)

Any ideas?


texts: Unique downloadable sales - is it possible?

texts:
Business model is as follows:

Customer uploads a file (PDF/XLS)
Customer pays for our services through one of the payment gateways
We use the information from the file to manually create a unique PDF for the customer
We upload the resulting file to customer panel
File is emailed to the customer + customer is able to login and download it

Is this doable with Magento and extensions, without writing our own?


texts: Titles of additional websites don't show correctly (they show the URL of the default store/website)

texts:
Magento 1.9.3.7
Porto theme

I've setup a default store and then a few additional websites/stores. They all have their own domains. I customized the look and content of each domain/website within the single Magento installation and everything shows up the way it suppose to including a different favicon for each domain/website BUT the title of all the other stores shows the URL of the main/default website/store. It actually flicks for a moment when loading - first it shows the URL of the domain/store it is loading (which is weird in itself because I didn't enter the entire URL in the www.MYadditionalSITE.com format into

System > Configuration > General > Design > HTML Head > Default Title

but only the words MYadditionalSITE).

After it flicks the URL of the actual site - it then displays the URL of the default domain/website in the browser's tab in the following format:

DEFAULTstore.com

If I save the website onto the bar - I see the correct favicon and next to it:

DEFAULTstore.com

When I place my mouse over that - I see:

DEFAULTstore.com
and underneath it:
www.MYadditionalSITE.com

I deleted all Cache (it's currently disabled anyways) and re-indexed everything.


texts: Customer selects type of configurable product > Query for vendors with that product

texts:
I would like some advice on how to go about this project before I start! We are developing a Magento site where other vendors can sell their product.

My first project:

  "Get product structure to display correctly on product pages.  There
  is an attribute called “vendor”.  There is a “Tier 2” Simple product
  created “for” every configurable but is not “included” in the
  configuration.  This “Tier 2” product has a vendor ID of “0”.  This is
  for display only in the vendors login system.  So what we will have
  will look like:

  1)      Configurable SKU             1001

  2)      “Tier 2” SKU’s                    1001-blu | 1001-wht |
  1001-blk | 1001-red

  3)      Simple Product SKU’s    1001-blu-ven1 | 1001-blu-ven3 |
  1001-wht-ven3 | 1001-blk-ven1 |1001-blk-ven2 | 1001-blk-ven3
  |1001-red-ven1 | 1001-red-ven2 | 1001-red-ven3

  So, with that said, you will have 9 SKU’s under 1001 Configurable.
  The challenge is to write the page so that it displays all
  configurations – Red, Blue White and Black PRIOR to displaying the
  “show vendors” button.  Once all required configurations have been
  chosen, the “show vendors” button will display.  Once clicked, a
  display (It has yet to be undecided if it will be a jQuery
  .slidedown() or a jQuery popup)  will display the vendors (think
  “attribute”) and prices for said configuration. "

I'm thinking to set up some test products, just assuming that one vendor or another will carry each. Then when user selects specific color- search database for vendor attribute. What I really need advice on is what tables to set up if any and/or how to query for the results. Any help VERY much appreciated! :D


texts: Call the product to the home page using a SKU or ID Magento 2

texts:
I'm trying to develop an extension.
I want to select a product SKU in the admin to be able to display the product on the home page.

app\code\My\Mpanel\etc\adminhtml\system.xml

  app\design\frontend\My\claue\Magento_Theme\templates\script.phtml

I use the code:

<?php $themeHelper = $this->helper('My\Mpanel\Helper\Data'); ?>

Everything works well.

I spent quite a bit of time.
Please help.


texts: Magento 2: Get collection of disabled products

texts:
Following code isn't working to retreive disabled products even after adding respective filter:

    /**
     * @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory
     */
    protected $_productCollectionFactory;

.....

 $childIds = array(1,2,3); //array of enabled and disabled product ids.
 $collection = $this->_productCollectionFactory->create()
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED)
            ->addAttributeToFilter('entity_id', array('in'=> $childIds))
            ->load();

Actual: $collection has all enabled products.

Expecting: $collection should have all disabled products from $productIds array.
Need help to find disabled products in $childIds array.
TIA


texts: Custom block on product page if product is out of stock / in stock

texts: I want to add two custom blocks on product page - one to be displayed if product is in stock and the other one if product is out of stock.


texts: What is the _setActiveMenu function in Magento 1

texts:
I don't understand the _setActiveMenu function in Magento 1..
Usually it is used with the loadLayout function.

Thanks


texts:
In my normal projects, I use xdebug with phpstorm and it's great; I have no problem with it. However, in Magento2, using xdebug on my localhost is not possible because when xdebug remote is enabled in php.ini, Magento2 takes 1-2mins to load a page. It's totally frustrating.

Disabling the xdebug extension in php.ini will immediately increase the page load to about  5-10secs. Still slow, but better than minutes.

I've now resorted to print_r and logger everywhere in my code. But this is incredibly painful! More so when Magento reports that the error is coming from some factory which then I have to go in and mess up the core with all my print statements!

I've tried on 2 different computers and they both have the same issue with xdebug. First one is a Windows7 x64 8GB ram on an i5 processor. Second machine is a Windows10 x64 16GB ram on an i7 processor.

What is wrong with debugging Magento2 with xdebug? Ideally, I'd like to use a debugger. How can I fix this? Otherwise, how else can I debug when developing on Magento2?


texts:
I want to retrieve the search term in my Observer for use elsewhere but I cant seem to find out how to extract the data.

So far I have tried this (search term is Football):

events.xml:

<event name='abstract_search_result_load_before'>
        <observer
           name='Path\To\This\Search.php'
           instance='Path\To\This\Search.php'
        />
</event>

Search Observer:

public function execute(\Magento\Framework\Event\Observer $observer) {
    $this->myhelper ->log('search');

    $event = $observer->getEvent();
    $collection = $event->getData('collection');
    $search = $collection->getSearchCriteria();

    $this->myhelper->log('************' . var_export($search, true));
}

Produces:

main.INFO: search [] []
main.INFO: ************Magento\CatalogInventory\Model\ResourceModel\Stock\Status\StockStatusCriteria::__set_state(array(
   'data' =>
  array (
    'fields' =>
    array (
      'list' =>
      array (
      ),
    ),
    'filters' =>
    array (
      'list' =>
      array (
      ),
    ),
    'orders' =>
    array (
      'list' =>
      array (
      ),
    ),
    'criteria_list' =>
    array (
      'list' =>
      array (
      ),
    ),
    'initial_condition' => true,
    'products_filter' => '7',
    'website_filter' => '1',
  ),
   'mapperInterfaceName' => 'Magento\\CatalogInventory\\Model\\ResourceModel\\Stock\\Status\\StockStatusCriteriaMapper',
)) [] []


texts:
I have some subfolders in my Magento DocumentRoot like /vendor/ and /media/ this folders are not protected and are reachable from the web for everyone. Now I want to protect these folders through apache configuration. Is it possible and will it work when I deny the access for all except the IP address of my Server?

Can someone share an example of an Apache conf?


texts: Magento 404 Page redirect to home page in Nginx

texts:
We work on a Magento website and recently we have created a customer 404 page basically a new CMS page and set it as CMS no route page in configuration.

This is working fine on my local system and website replica (Running through a subdomain) but not on main website.

If we type a wrong CMS page url then it redirect to home page. If we type wrong sub category url then it redirect to parent category page e.g. /men/clothing/jeansss.html redirect to /men/clothing.html and /men/clothings.html redirect to /men.html and /mens.html redirect to home page.

Please help me on this. Is there anyone who have faced the same issue?


texts: Buys X get cheapest as Y from same category magento 2

texts:
As per the answer from here I have created an event for salesrule_validator_process and the code is below.

class CustomCartPriceRules implements ObserverInterface {
    public function __construct() {

    }

    /**
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer) {

        $result = $observer->getEvent()->getResult();
        $item = $observer->getEvent()->getItem();
        $rule = $observer->getEvent()->getRule();
        $address = $observer->getEvent()->getAddress();
        $qty = $item->getQty();

        if ($rule->getData('name') == 'Buy 2 get 1 free'):

                // overriding magento rules here and updating Almusbah Offer
                $result->setAmount(0)
                    ->setBaseAmount(0)
                    ->setOriginalAmount(0)
                    ->setBaseOriginalAmount(0);

                $item->setDiscountPercent(0);

            $products = [];
            $z = 0;
            $totalQty = 0;
            $dA = 0;
            foreach ($address->getAllItems() as $q):

                $validate = $rule->getActions()->validate($q);

                if ($validate):
                    $products[$z]['sku'] = $q->getData('sku');
                    $products[$z]['qty'] = $q->getData('qty');
                    $totalQty += $q->getData('qty');
                    $products[$z]['totalQty'] = $totalQty;
                    $freeQty = (int) ($totalQty / 3);
                    $products[$z]['freeQty'] = $freeQty;
                    if ($products[$z]['freeQty'] > 0):
                        $products[$z]['applyDiscount'] = 1;
                        $dicountPercent = 100;
                        $dA = ($products[$z]['freeQty'] * $q->getData('calculation_price'));
                        $products[$z]['discountAmount'] = $dA;
                        $totalQty -= 3*$products[$z]['freeQty']; // appying on each 3 items
                    endif;
                    $z++;
                endif;
            endforeach;
            //echo '<pre>';print_r($products);exit;
            $chkCurrentSku = $item->getSku();

            foreach ($products as $p):
                if(isset($p['applyDiscount']) && !empty($p['applyDiscount']) && $chkCurrentSku == $p['sku']):
                    $discountAmount = $p['discountAmount'];
                    $fullDiscount = 100;
                    $item->setDiscountPercent($fullDiscount);
                    $this->almusbahBuy2Get1Offer($discountAmount,$result);
                endif;
            endforeach;

        endif;

    }

    public function almusbahBuy2Get1Offer($discountAmount, $result) {

                   $result->setAmount($discountAmount)
                        ->setBaseAmount($discountAmount)
                        ->setOriginalAmount($discountAmount)
                        ->setBaseOriginalAmount($discountAmount);
            }

}

My admin configuration is as follows.

When I add 2 items to productwith product A 4 qty and B with 2 qty.Where B is cheaper than A.So B should be free for 4 products of A.Instead one product from A and one from B are added into discount.

See screenshot below.

In this case product with price 14 and qty 2 should be added as discounted instead of 1 from 14 and another of 145.

Can someone please help how i can add the cheaper product as discounted in the above code.


texts:
This notification from today:

New Community Edition 2.0.x Patch (MDVA-532) Enables Upgrades to Magento 2.1 – June 22, 2016
A new patch, MDVA-532, enables merchants using Magento Community Edition 2.0.x to upgrade to Magento 2.1 Community Edition Release Candidates or GA software. More information about the patch and important instructions for command-line upgrades to Magento 2.1 when sample data is installed are available in a technical bulletin posted at http://devdocs.magento.com/guides/v2.0/release-notes/tech_bull_21-upgrade.html.

Says that you are able to update to 2.1.0 but I could update only to 2.1.0-rc3.

After copying the patch over I edited the composer.json to request 2.1.0 but I get this error:

Problem 1
    - The requested package magento/product-community-edition 2.1.0 exists as magento/product-community-edition[2.1.0-rc3, 0.42.0-beta7, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.1.0-rc1, 2.1.0-rc2] but these are rejected by your constraint.

I have 2.1.0-rc3. Is there anything else that I should do? The documentation mentions editing composer.lock only for EE.


texts:
I have a complex problem. I want to add more categories to my website, but an orange box appears. Does anyone know what to do?

I have been surving over the internet and some pages tell me to re-instlal the ADMINHTML + ADMIN on my FTP. I did, but still it''s not working.All help is welcome


texts: magento1: what is use of catalog_product_index_eav table

texts:
I have created product attribute with the dropdown in Magento.

Product attribute backend type is int and attribute is filterable with results. but then find the values of that attribute in the catalog_product_entity_int table but it's not showing. but when I am finding in the catalog_product_index_eav table it's showing. I am confused what is the use of catalog_product_index_eav table and why it's showing value in that table.


texts:
I would like to do something as simple as create an upgrade script for an existing module to add custom category attributes. Unfortunately this has been anything but simple as no upgrade script is ever run. I've read about a dozen tutorials and stackoverflow questions to find an answer to no avail.

Below is my config.xml with version 0.2.1 at the top:

   <resources>
        <mymodule_services_setup>
            <setup>
                <module>MyModule_Services</module>
                <class>MyModule_Services_Model_Resource_Eav_Mysql4_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </mymodule_services_setup>
        <mymodule_services_write>
            <connection>
                <use>core_write</use>
            </connection>
        </mymodule_services_write>
        <mymodule_services_read>
            <connection>
                <use>core_read</use>
            </connection>
        </mymodule_services_read>
    </resources>

The install script at MyModule/Services/sql/mymodule_services_setup/mysql4-upgrade-0.2.1.php:

  $installer = $this;
  //$installer->installEntities();
  Mage::log('running script', null, 'services_upgrade.log');

  $installer->startSetup();

  $installer->addAttribute('catalog_category', 'hide_page_title',  array(
    'type'     => 'int',
    'label'    => 'Hide Page Title',
    'input'    => 'select',
    'source'   => 'eav/entity_attribute_source_boolean',
    'global'   => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'required' => false,
    'default'  => 0
  ));

  Mage::log('in the middle', null, 'services_upgrade.log');

  $installer->addAttribute('catalog_category', 'show_percentage_off',  array(
    'type'     => 'int',
    'label'    => 'Show Percentage Off',
    'input'    => 'select',
    'source'   => 'eav/entity_attribute_source_boolean',
    'global'   => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'required' => false,
    'default'  => 0
  ));

  Mage::log('finished', null, 'services_upgrade.log');
  $installer->endSetup();

The Setup class (MyModule/Services/Model/Resource/Eav/Mysql/Setup.php) specified in the config.xml is there but empty as follows for now:

class MyModule_Services_Model_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
{

}

Resource_core shows the module version being bumped up but the upgrade script is never run.

If anyone can give any help I would be eternally grateful as this simple task is taking hours.


texts: Customer checkout is not working, while guest checkout works

texts: When I log in, there is no 'next' button on the checkout page like the image that I attached, so I can't place an order. But when I checkout as a guest, it works fine. Help me please. Thank you in advance.


texts: Magento 2 product gallery doesn't close on iPhone

texts: I'm using Magento 2.2.1, with a theme that has magento blank theme as parent. I'm having a problem on iPhone 6, but not on Windows mobile or Android. Basically when I go on the product page, and open the product gallery images, I can't close the gallery anymore when I press the X, as I sayd, this happens only on iPhone. The gallery used is a Fotorama, is the default one, anyone has any idea what it might be?


texts: How to csll Catalog/Layer_View block in controller to get loaded attributes

texts:
I want to use below code in controller but not working.

$block = $this->getLayout()->getBlock('catalog.leftnav');

I used in phtml file here, it is working fine. but it is not working in controller.

Can any one help me on this issue.


texts:
I want to display sidebar in left side.

How can I do that?


texts: Flat product/category tables producing category URL instead of product on list view

texts:
I have enabled the flat product and category tables on a development site to test before using live, and for some reason product links in category views now link back to the category itself rather than through to the category.

Has anyone experienced this before?  Is this a quick fix that I'm just missing or is it going to be a long dredge through the codebase?


texts: System > Configuration > Fatal error: Class ‘Varien_Data_Form_Element_Color’

texts:
I am trying to access system > configuration but I get the following error ~

  Fatal error: Class ‘Varien_Data_Form_Element_Color’ not found in
  /home4/trifect1/public_html/lib/Varien/Data/Form/Abstract.php on line
  146

Appreciate any help or advice you can offer me.

Thanks!


texts: New custom attribute not showing on catalog

texts:
I already defined a custom attribute "Internal Title" under General Tab.
Now I want to add another new custom attribute but this does not work
Tried with different approaches I found (upgradeand install):

Here is my setup:

install-0.1.0.php

<?php
$installer = $this;
$installer->startSetup();
$attribute  = array(
    'type' => 'text',
    'label'=> 'CustomAttribute_Test',
    'input' => 'textarea',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'default' => "",
    'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'customattribute_test', $attribute);
$installer->endSetup();

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Unreal_Custom>
                <version>0.1.0</version>
        </Unreal_Custom>
    </modules>
     <global>
        <resources>
            <unreal_custom_setup>
                <setup>
                    <module>Unreal_Custom</module>
                    <class>Mage_Catalog_Model_Resource_Setup</class>
                    <connection>core_setup</connection>
                </setup>
            </unreal_custom_setup>

            <unreal_custom_setup_write>
                    <connection>core_write</connection>
            </unreal_custom_setup_write>

            <unreal_custom_setup_read>
                    <connection>core_read</connection>
            </unreal_custom_setup_read>
        </resources>

        <blocks>
            <custom>
                <class>Unreal_Custom_Block</class>
            </custom>
        </blocks>
    </global>
    <frontend>
        <routers>
            <custom>
                <use>standard</use>
                <args>
                    <module>Unreal_Custom</module>
                    <frontName>custom</frontName>
                </args>
            </custom>
        </routers>
        <layout>
          <updates>
            <custom>
              <file>uecustom.xml</file>
            </custom>
          </updates>
        </layout>
    </frontend>
</config>

I also tried to rename my install script to upgrade-0.1.0-0.2.0.php and changed          <version>0.2.0</version>

If someone could point me in the correct direction, would be great

Best