texts:
I would like to retain/restore cart items after order is placed & add them in cart for both Guest & Login user, how can I achieve this?
I am using Hosted Paypal, so when the user sees the reloaded frame, on refresh I want user to see the last items added in cart which got removed when user click on continue button of paypal.


texts: Can anybody tell me where I can change the layout and order of the addresses in the invoice pdf. I want to combine the City name with postcode number. Now the postcode number is combined with the county, which is not right.


texts: how to change Sales order default status? Magento 2

texts: In my website if order has placed via paypal or anything the status is seted as processing, but i like to set status to be pending. How to set, please let me know.


texts: Magento 2 - how to reference a template of my theme in a layout file?

texts:
I have this file

  app\design\frontend\company\mytheme\web\templates\header\foobar.phtml

How can I reference it in a layout file e.g. in

  app\design\frontend\company\mytheme\Magento_Theme\layout\default.xml

e.g. to set it as a template for a block?

<referenceContainer name="header.container">
    <container name="header-wrapper" label="Page Header" as="header-wrapper" htmlTag="div" htmlClass="header content foobar">
        <block class="Magento\Theme\Block\Html\Header\Logo"
               name="logo"
               template="Magento_Theme::foobar.phtml"  <-- this does not work... how to make it right and set foobar.phtml as template ?
        >
            <arguments>
                <argument name="logo_img_width" xsi:type="number">189</argument>
                <argument name="logo_img_height" xsi:type="number">64</argument>
            </arguments>
        </block>
    </container>
</referenceContainer>

If I move foobar.phtml to app\design\frontend\company\mytheme\Magento_Theme\templates then it works, but how does it work from my themes web directory?


texts: How do I hide price from non-registered user in magento 2 for specific products

texts: I want to hide price from non registered users in magento 2 for specific products. I want to do this functionality by using any observer or plugins not from direct conditions in overwritten phtml files.


texts: Discount disappear upon creating invoice MAGENTO 2.3

texts:
The discount is not being shown in invoice.
But there's a discount upon viewing the order.


texts:
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">

and

<form action="<?php echo $this->getUrl('customer/account/createpost'); ?>" method="post" id="form-validate">

both code call AccountController and createPostAction action but the first one make this process very complicated.so my qustion is why magento use this complicated method .

here action call this Function

public function getPostActionUrl()
{
    return $this->helper('customer')->getRegisterPostUrl();
}

and then Block use helper

public function getRegisterPostUrl()
{
    return $this->_getUrl('customer/account/createpost');
}


texts: Howto read/update newly created custom category attribute via SOAP API V2 - ASP.NET/C#

texts:
I managed to create a custom attribute for a category using custom module and following 'sqlscript':

$installer = $this;
$installer->startSetup();
$attribute  = array(
    'type' => 'varchar',
    'label'=> 'Legacy Id',
    'input' => 'text',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'default' => "",
    'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'legacy_id', $attribute);
$installer->endSetup();

Attribute is visible and editable in admin section.

Now I want to read/update this attribute through SOAP API V2 in a asp.net/c# application, but I am not able to get to the custom attribute.
When I use catalogCategoryAttributeList I get a list of all attributes including the one I created, however when I use method catalogCategoryInfo it shows only default attributes. I am not sure what parameter string[] attribute does. No matter what I put here, I always get the same result.
And I assume that I need to use that method to get to the attributes of that category (according to magento API documentation on getting category info).

Code-snippet:

catalogAttributeEntity[] List = Service.catalogCategoryAttributeList(SessionKey);
catalogAttributeEntity LegacyIdAttr = List.Where(c => c.code == "legacy_id").FirstOrDefault();
Category = Service.catalogCategoryInfo(SessionKey, 5681, null, null);

I hope someone can put me in the right direction on how to get my custom attribute and
possibly change it's value.
Thanks in advance.


texts: Magento tries to route a font file from skin/frontend

texts:
I'm developing a new template, based on RWD and when I try to load a font file, with extension woff, from:

http://www.example.com/skin/frontend/mytheme/mytheme/fonts/myfont.woff

I get an error report like this:

Inside the error report I get this:

a:5:{i:0;s:52:"Front controller reached 100 router match iterations";i:1;s:456:"#0 /var/www/vhosts/example.com/app/code/core/Mage/Core/Controller/Varien/Front.php(179): Mage::throwException('Front controlle...')
#1 /var/www/vhosts/example.com/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#2 /var/www/vhosts/example.com/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#3 /var/www/vhosts/example.com/index.php(83): Mage::run('default', 'store')
#4 {main}";s:3:"url";s:61:"/skin/frontend/mytheme/mytheme/fonts/myfont.woff";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Notes:

Magento 1.9.2.2
File exists under the folder structure path.
Nginx as webserver. Not sure if this may be somehow related.
Nginx mime.types file does include the woff file as application/font-woff                 woff;

Solution

As pointed by @MarioNigrele, the problem was Nginx trying to serve the URL as a PHP request. So adding the next block to my Nginx configuration solved the issue:

location /skin/ {
   location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
       access_log off;
       try_files $uri =404;
   }
}


texts: Changing the address book drop down from drop down list to radio buttons

texts: We need to select option for radio button shipping and billing address on checkout page. How to change this?


texts: Magento 2.3 - limit certain categories products

texts:
We have a few categories which function like "bestsellers" categories; these categories can hold any number of products, but I'd like to show only the top four.

So I figured to create an observer with the catalog_block_product_list_collection event and try to limit it. The observer triggers fine on the category pages, but whatever I try the collection isn't limited;

    $limitedCollection = $observer->getEvent()->getCollection();
    $limitedCollection->getSelect()->limit(4);
    return $this;

Or

    $limitedCollection = $observer->getEvent()->getCollection();
    $limitedCollection->setPageSize(4)->setCurPage(1);
    return $this;

Neither have any effect. What am I missing?
Edit: It's also important that the search/layered navigation etc functionality sees only 4 products.


texts: Refused to apply style “because its MIME type ('text/html') is not a supported stylesheet MIME type” in magento 2.3

texts: I move my code from "/var/www/html/demo" to "/var/www/html" after that CSS is not loading on my Magento 2 admin panel. The frontend is working fine.


texts: Magento 2 catalog_product_alert schedule entries not being created

texts:
All store configuration is properly setup, the cron is running, everything else is working, but there are no catalog_product_alert schedule entries being generated or back in stock alerts sent.

I have only found one curiosity, the core_config_data table includes the following setting:

crontab/default/jobs/catalog_product_alert/run/model : NULL

I suspect there should be some value there, but i cant seem to find any clues to what that value could be and i suspect this is part of the issue that no cron schedule is being created.

The following link helped understanding the issue, but provided no solution so far:
https://community.magento.com/t5/Magento-2-x-Technical-Issues/Product-Stock-Alerts-Not-Sending/td-p/43032


texts: Anonymous Scripts found in header and footer section magento source page


texts: How to exclude inactive categories/pages from generated google sitemap.xml?

texts:
Through Catalog > Google sitemap I have just generated a sitemap.xml file.

The file itself works perfect.
My problem though is, that the file also contains inactive categories.

I can't seem to find any options to exclude these inactive categories from my generated sitemap.xml file.

Do anyone know how this can be solved?

I am using Magento ver. 1.7.0.2


texts: Exclude Products from existing Shopping Cart Price Rules

texts:
we have around 1300 shopping cart price rules. we now added a new product that we want't to exclude from all of our shopping cart price rules. what is the best way to do that? I though of updating the conditions of the shopping cart price rules programmatically, but I have no idea how to handle the serialized conditions.

Michael


texts: Tax calculation after discount on Magento incorrect

texts:
I have a discount code on a Magento store that reduces the cost of the purchase by 10%. All works ok in that respect, except for the tax calculation.

Example:

Total value of the order is £34.18 Discount to be applied is 10% - £3.42

Therefore the new subtotal is £30.76

If we divide 30.76/1.2 and minus this figure from 30.76, i get the tax amount, which is £5.13.

That is exactly what i want. However, the options in the back of Magento change things dramatically, to the point where the tax is no longer correct, or the total is no longer correct.

If my settings are:

Apply Customer Tax: After Discount Apply Discount On Prices: Including Tax

My figures are: Total value of the order is £34.18 Discount: 10% = £3.42 (Correct) (New subtotal is £30.76) Tax: £5.01 (Incorrect) Total: £30.07 (Incorrect) (Difference of 69p, which is 20% of the discount amount).

What it appears it is doing is taking tax off of the total order and the tax off of the discount also. (Tax calculation is set to be based on the total).

Other settings:

Apply Customer Tax: After Discount Apply Discount On Prices: Excluding Tax

This is the only setting where the tax is calculated properly and correct, however, the discount on the front end is shown incorrect (showing excluding tax).

Apply Customer Tax: Before Discount Apply Discount On Prices: Including Tax

Tax is incorrect and displays as £5.70

So, am i missing something really simply, or is it a lot harder than this and certain files will need to be edited to get what i want? Magento 1.9.0.1 is my version, and i have been back and forth through the settings time and time again.


texts: Magento 2: Adding a new function to Magento\Catalog\Block\Product\View

texts:
I am trying to add a new function into the Magento\Catalog\Block\Product\View by extending the class.
I tried to use that function in the template which is getHelloWorld() but I can't seem to get the function to work

etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Block\Product\View" type="My\Module\Block\Catalog\Product\View" />
</config>

My/Module/Block/Catalog/Product/View.php

<?php

namespace My\Module\Block\Catalog\Product;

class View extends \Magento\Catalog\Block\Product\View
{
     public function getHelloWorld()
     {
         return 'Hello World';
     }
}

design/frontend/theme/folder/Magento_Catalog/templates/product/view/type/default.phtml

<?php $_product = $block->getProduct() ?>

//-----added it here this
<?php echo $block->getHelloWorld() ?>

<?php if ($block->displayProductStockStatus()): ?>
    Availability:
    <?php if ($_product->isAvailable()): ?>
        <span class="stock available" title="<?= /* @escapeNotVerified */ __('Availability') ?>">
            <?= /* @escapeNotVerified */ __('In stock') ?>

    <?php else: ?>
        <span class="stock unavailable" title="<?= /* @escapeNotVerified */ __('Availability') ?>">
            <?= /* @escapeNotVerified */ __('Out of stock') ?>

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


texts: How to get SID programmatically : Magento 1.9

texts:
I am working on multi store, and i want to share my cart between multi website using subdomain.

  Store > Configuration > General > Web > Session Validation Settings >
  Use SID on Storefront is set to "Yes" allow customer to stay logged in
  when switching between different stores.

However I am not getting SID in my front end URL.

Is there any way to get SID programmatically and append to front end URL?

Or is there any way to get SID automatically append to front end URL?


texts: Choosing Magento 2 branches, using patches or fixing bugs in custom modules?

texts:
I recently ran into a pretty annoying bug with Magento 2.1.6, which made it impossible to save categories with a lot of products (performance issue). I soon discovered that the solution was quite easy, and fixed this in a module of my own.

Later on, when revisiting this issue, I discovered that Magento had already fixed this bug in september (9 months ago!), and called it MAGETWO-58277.

The commits/fixed are only in the develop branch on Github and not in any of the other 2.1 or 2.1-develop branches, and thus also not in the 2.1.6 or even very recent 2.1.7 tags.

So, I'm trying to figure out what is going on. An essential patch is waiting around for 9 months doing nothing? Or is it somewhere out there that I could not find?

Now, on to the real question: How do you think is the best way to proceed? Should we build on the "develop" branch, thus getting the latest fixes, or should we use the composer versions and use a "patching" system like cweagans/composer-patches.

I know that the Magento docs say: use composer, but I'm trying to be practical here. Fighting bugs that were fixed 9 months ago is just a waste of valuable developer time.

We're currently experimenting with patches and composer, but after the 5th patch we made, we ran into an issue where the patch was fine for the develop branch (we created a pull request), but not for our 2.1.6 install, so we need to be extra careful.

This way we would need to create a patch for our version, create a PN if we want to contribute to the community (assuming it's a new bug) and re-create patches as Magento changes over time because patches will break at some point due to other code changes.

So, how do you juggle the M2 versions, patches and bugfixes?


texts: What is the best way to override Mage/Core/functions.php in Magento?

texts:
Magento has an elegant way to override it's modules. But what I have done till now is override Blocks, Models, Helpers and controllers.
But this file

  Mage/Core/functions.php

doesn't appear to fall in any of those categories. Is there any elegant way to override this other than putting it in local codepool?

I want to change the error log messages(system and exception) and populate them with session and IP so that I can get a better knowledge about the users who received the errors.


texts: Whoops, it looks like you have an invalid PHP version

texts:
I getting php version error message in my site.

I have two magento instance in same server, One is ruining & another  is not running. Please share idea/answer with me.


texts: Add custom product attribute to checkout summary Magento 2

texts: I am trying to add a custom product attribute to the list of items on the summary section in the checkout in Magento 2. The template file is at Magento_Checkout/web/template/summary/item/details.html and looking to display the value of the custom attribute before the product name. Any idea on how this value is added to the ko template? Looks like there is another question for this here but was never answered.


texts: Magento2: How to create different home page

texts:
1) Case 1: I need to create different Homepage Pages for each store views. So I have multiple store view and after enable page builder when I finished build page then display the same page on each store view.

How to set different home page for each store?

I have found information:

2) Case 2: if store view B, you want different something with store view A, you also use IMPORT and EXPORT but before IMPORT to store view B, you must create another CMS page first and assign it to store view B in STORES >> Configuration >> Web [GENERAL] then go to admin MGS >> Theme Setting, select store view B then IMPORT the homepage you just EXPORTED. In this case because you created another CMS page for store view B, so you can enable the builder on store view B then edit it and your changes will only affect to store view B.

but before IMPORT to store view B, you must create another cms page first and assign it to store view B in STORES >> Configuration >> Web [GENERAL]

OK, but how to create another CMS page? I should first go to content >> Pages and then create new pages and copy from 'home' eg. to 'home2' and then set in STORES >> Configuration >> Web [GENERAL]?

@ UPDATE

1) in Content >> Pages I have create new page "home2"

2) I have copy all contains from basic "home" and paste in "home2"

3) Then I go to Stores >> Configuration >> Web >>Default pages

4) Switch to English store Website and select new created page "home2".

5) After save and clean cache on English store view Homepage no displayed.

  [2018-08-03 11:00:41] main.CRITICAL: Invalid block type: btn btn-default {"exception":"[object] (Magento\Framework\Exception\LocalizedException(code: 0): Invalid block type: btn btn-default at vendor/magento/framework/View/Layout/Generator/Block.php:275, ReflectionException(code: -1): Class btn btn-default does not exist at vendor/magento/framework/Code/Reader/ClassReader.php:19)"} []


texts: Magento 2.4.1 EE Static content auto generate failed in developer mode

texts: I am using Mac M1 Chip and installed nginx, php7.4, composer, mysql8.0 and Magento 2.4.1 EE. I have set developer mode but the static content files not generate automatically. If I execute php bin/magento setup:static-content:deploy -f and frontend and backend website load correctly with theme. Is required to execute php bin/magento setup:static-content:deploy -f in developer mode?


texts: Website get stuck after upgradation of Magento 1.9.3.3 to 1.9.2.4

texts:
Sometime my site get stuck on proceed to checkout and add to cart after upgrading magento 1.9.3.3 from 1.9.2.2

Sometime add to cart button does not work. Same in admin when i try to create/save new product. It shows loading then i refresh admin and save again, it saves. It also happening in many events like creating new products, click on order section and cleaning cache. Re-indexing is also taking lot of time.

can anyone help, how to resolve these issues?


texts: replace line by bullets before category lists in dropdown menu

texts:
please visit this link :

http://demo.kidsdial.com/

on top you can see search box with "all categories", you can see there is a dropdown menu.

if we hover mouse on that"drop down menu" button, you can see list of "categories and sub-

categories". before every category name there is a line displaying.

I want to remove that line and put "bullet symbol", before all categories.

please help me to get some solution.


texts: Reindexing foreign key constraint fails on Attribute's Index

texts:
I am getting this error when I try to re-index the Attribute's Index on my magento 1.9.2.4 site.

Here is a excerpt from the image below

  exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (cmc_mag.catalog_product_index_eav, CONSTRAINT FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT FOREIGN KEY (entity_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCADE O)' in /home/cmcadm1n/public_html/lib/Zend/Db/Statement/Pdo.php:228

Any help would be appreciated.


texts: reloadPrice() method fires multiple times

texts:
I need to call a function when the price is reloaded and I successfully did that, but the problem is related to this.getPriceBox().on("reloadPrice", function (ev) {...} which fires multiple times and so does my call.
I thought it was about event bubbling maybe and tried to stop the propagation by using ev.stopPropagation(), but it didn't work.
Is it normal for this function to fire multiple times?


texts: Conditional Attribute Statement in View.phtml

texts:
I am attempting to do something seemingly simple, but experiencing odd results (and not my area of expertise).  On the view.phtml page, I need to print a small message, based on two custom attribute values (brand & classification).

If the product = BrandA and it's a computer, then echo "message 1"
If the product = BrandA and it's not a computer, then echo "message 2".

But for some reason, this is not working as expected.  if BrandA is in a different category, like hard drives, it still sets message 1, then it might work as expected, and revert back again.

I think this might be due to this "$product = Mage::registry('current_product');" but so gracious if anyone can provide any insight!

Side note, if I echo $productAttribute or $productClass, this seems to work as expected.

Again, thank you to anyone who can push me in the right direction.

$product = Mage::registry('current_product');
$productAttribute = $product->getAttributeText('brand');
$productClass = $product->getData('classification');

if(($productAttribute == "BrandA" || $productAttribute == "BrandB" || $productAttribute == "BrandC") && ($productClass == "Computers")): ?>
    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('1')->toHtml(); ?>
<?php endif;?>

<?php if(($productAttribute == "BrandA") && ($productClass != "Computers")): ?>
    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('2')->toHtml(); ?>
<?php endif;?>


texts: How can I remove wishlist and compare block pieces form the 404 not found page?

texts:
I need to remove wishlist and compare from the not found page. I use CMS to make the not found page. This is what I tried as a Design XML Update, and it didn't work:

<referenceContainer name="content">
    <referenceBlock name="catalog.compare.sidebar" remove="true" />
    <referenceContainer name="sidebar.additional" remove="true" />
 </referenceContainer>

and:

<referenceContainer name="wishlist_sidebar" remove="true" />

How can I do it?


texts: Magento 1 creating a variable fixed-amount coupon code in PHP

texts:
I'm trying to create a coupon code for a customer that gets a fixed value from PHP (essentially it can be a different amount for each customer/instance of generation).

For the coupon code generation, I created a rule and used the code available here:
https://mage2-blog.com/magento-1-programmatically-create-promotion-coupon-codes/

The only issue is that it seems the value must be set in the rule.

Is there a way to create coupon codes according to a rule but with different values, or do I need to create a rule as well each time I want to run this?


texts: How to Restrict magento admin panel access via particular IP addresses/ranges

texts: I am newbie in Magento. I want to restrict Magento admin panel access via particular IP addresses/ranges. Please guide me.


texts: Magento redis "read error on connection"

texts: I'm getting redis cache issue on apply the catalog rules from backend. The error is "read error on connection". Can anyone suggest the solution?


texts: Rounding of vat (tax) for product prices and consider 3 or 4 decimal places

texts:
We enter our product prices into magento exc vat and display them inc vat.

To get a nice price displayed to the customer as 19.95 the exc vat (20%) price would need to be 16.625.

If we store the price in the database directly or use magento store manager importer we can import the product price to be 16.625 but within the admin of Magento the price gets rounded up to be 16.63 and then when the tax is worked out the total would be 19.956 which then gets rounded up to 19.96

Referencing this other question Round Price to 4 decimal places it seems to do the trick on the surface but it seems really dangerous as it could have a knock effect with other areas of the store, specifically the checkout and payment gateways. Has anyone else encountered this issue or can offer a suggestion?


texts: How to add checkout first step as a login step in magento2?

texts:
I need the first step is login form like as magento1 and remove login or email adding the field on shipping step.

add first step as


texts:
I am trying to filter products by category as below in the screenshot.

Once the category selected from the drop down the products belongs to that category should populate in the products section.

I need to populate child categories in dropdown once the parent is selected in first dropdown.

can we have this filter in list page?

Please anyone suggest me the solution. Thanks


texts: magento2 bin/magento indexer:reindex this command delete the data from catalog_product_index_price

texts:
I am uploading products via xls and this is working fine.I am uploading bundle/simple products

After that when all process complete. then I run bin/magento indexer:reindex by script for reindexing.

This deletes the bundle item data from mysql table catalog_product_index_price, and if I running bin/magento indexer:reindex using command prompt then this is working fine.


texts: Magento 2 product detail page detail tab vertical

texts: I want to make product detail tab vertical instead of horizontal.


texts:
I using this guide Creating new completely custom reports to do my custom report,
but show blank the the custom report page.
Can help me solve it?

My code same with the guide. Please check at that link.


texts: Magento 2.2; Show left.phtml in Anchor Categories

texts:
This template (Catalog Module) displays a link that redirects to the parent category; but it looks that it only shows in non-anchor categories.

Does anyone know a way to implement it in anchor categories? I have tried already by means of xml customizations but I cannot get it to work.


texts: How do i get createAccount methods argument in after plugin Magento 2?

texts:
I am writing after plugin on create account method, to change the API response with.
I have to call

createCustomerAccessToken($username, $password)

function, which has two parameters. What I am doing is i take the username from createAccount method and pass it to createCustomerAccessToken function.I can easily get the $username value how i can get the password parameter value?
<?php

namespace Mlameh\Store\Plugin;

class AddAccessToken
{
/**
 * @var \Magento\Customer\Api\Data\CustomerExtensionFactory
 */
private $customerExtensionFactory;
/**
 * @var \Magento\Integration\Model\Oauth\TokenFactory
 */
private $tokenModelFactory;
/**
 * @var \Magento\Integration\Model\CustomerTokenService
 */
private $customerTokenService;
private $token;

public function __construct(
    \Magento\Integration\Model\CustomerTokenService $customerTokenService
) {
    $this->customerTokenService = $customerTokenService;
}

/**
 * Add Login token to customer
 *
 * @param \Magento\Customer\Api\AccountManagementInterface $subject ,
 * @param \Magento\Customer\Api\Data\CustomerInterface $customer
 * @return  \Magento\Customer\Api\Data\CustomerInterface
 * @throws \Magento\Framework\Exception\AuthenticationException
 */
public function afterCreateAccount(
    \Magento\Customer\Api\AccountManagementInterface $subject,
    \Magento\Customer\Api\Data\CustomerInterface $customer
) {

    //$password =
    $token['token'] = $this->customerTokenService->createCustomerAccessToken(
        $customer->getEmail()
    );
    return $customer;
}
}


texts: Admin custom page form action not working

texts:
I have create custom page in admin. Here am trying to save the some data to database.

I have doubt in form action this my code

.phtml

<form action="<?php echo Mage::helper("adminhtml")->getUrl("*/*/insertsilverrateAction") ?>" method="post" enctype="multipart/form-data">
    <input type="text" name="rate" value="10.10" required="">
    <button type="submit" name="save" class="scalable save">Submit</button>
</form>

Controller

class JR_CreateAdminController_Adminhtml_CustomController extends Mage_Adminhtml_Controller_Action
{
    public function insertsilverrateAction()
    {
        echo 'h1';
    }
}

When i click submit button redirect to 404-page.

How can add correct form action


texts:
I am using this event to add a new button:

controller_action_layout_render_before_adminhtml_sales_billing_agreement_view

This is my function:

    var_dump(Mage::getSingleton('core/layout')->getUpdate()->getHandles());
    if (!$block = Mage::app()->getLayout()->getBlock('adminhtml_sales_billing_agreement_view')) {
        return $this;
    }
    $block->addButton('test',[
        'label' => Mage::helper('mynamespace_mymodule')->__('Test'),
        'class' => 'test'
    ]);

    return $this;

The result of my var_dump is
array(4) { [0]=> string(7) "default" [1]=> string(11) "STORE_admin" [2]=> string(31) "THEME_adminhtml_default_default" [3]=> string(38) "adminhtml_sales_billing_agreement_view" }. But I cannot get my block, it doesn't get to the point to add my new button. It always returns $this.
Maybe my block name is incorrect. Any idea ?

Thank you


texts: I tried to made the category menu fixed or sticky in the top. I read this question and it's seems work, but i don't know on which file i should to add the javascript and CSS. So, which file should i add the JS and CSS file? And how can i call the JS to sticking all the category menu?


texts: Magento 2 : How to add configurable product to cart with the selected custom options?

texts: I had a configurable product with two variants such as color and size and I have one customizable custom option, I am trying to add this product to cart with a custom controller, but it says the required options are missing.


texts: Need to add Buy Now button as well as add to cart button in Magento

texts:
I want to add both buttons "Buy Now" as well as "Add to Cart", If the user clicks on Buy-now it will redirect to the "onestepcheckout" page directly (Magento extension), for Add to Cart need default functionality. I'm using Magento 1.9.2.4

Please suggest how to add both functionalities without extension.


texts: Magento and Stripe (without go via magento checkout) .. and Paul

texts:
There are a lot of stripe extensions for integrate stripe gateway into magento checkout step = OK. Or there is stripe widget for do direct payment = OK (but it, of course, if not integrated with magento can't say "Paul have bought X product").

=> How integrate Stripe buy button (widget, for direct payment in-stripe) in magento and into payment details see also product bought from Paul?? :-)
Is require import magento products in stripe database? If yes, how to do? :-)

Thanks


texts:
I am using Online module creator to create a table in admin panel.

I added the sql query as needed to create the table but I don't know what to write in the field Run Installing Php Code.

Please see the screenshot below for clear understanding


texts: jquery scrolltop does not work in chrome

texts:
Get
 Started

`enter preformatted text here`

       aaaaaaaaaaaaaaaaaaaaa

the scrolltoTop is working in firefox and this code is not working in chrome.


texts: Can anyone explain xml code ie. salesrule_validator_process event in magento?

texts:
<events>
    <salesrule_validator_process>
        <observers>
            <new_dicount_coupon>
                <type>singleton</type>
                <class>Test_Mrp_Model_Observer</class>
                <method>newcoupondiscountcal</method>
            </new_dicount_coupon>
        </observers>
    </salesrule_validator_process>
</events>


texts: How auto-generate product and category url in magento

texts:
In magento 1 using indexes, we can generate product and category url but in magento 2 using indexes we cannot do this.

I have so many products and category so how can i do this?


texts: Sorting issue while getting product from category ID using REST Api

texts:
I am reviewing Magento 2 REST API.
I am trying to get all the products from its category ID using below API:

  GET    /V1/categories/:categoryId/products

Some how I am unable to get product details (Can't even get its name and price) and it simply return product SKU, ID and Position in response. Moreover I cannot apply any kind of sorting or pagination like if i want to limit response array count to 10 or 20 then i cannot do it.

I tried to apply Search criteria as well but found no luck.

It works perfectly with Product Listing API

  GET    /V1/products

Please help me out. May be I am missing something.


texts:
In my magento 2.3.6 I have successfully completed an order but in sales -> transactions grid there is no data appearing.
I am using three payment methods
1- CCAvenue Net banking
2- Cash on delivery
3- Money Order
Have completed the order by using these payment methods, still no data appearing.
Cron is also installed using
php bin/magento cron:install
php bin/magento cron:run

What may be the reason?
I thought COD and Money order are offline payment methods that's why data is not available, Now using CCAvenue Net Banking still data not appearing.


texts: how do I change the text on the More Info tab?


texts:
In my custom module to displaying the button on customer edit page (adminhtml), when hit the custom button it will call my custom controller after executed again I am redirecting to customer edit page. Here My custom controller is called, but when it redirecting Error is throwing.

  Error: Fatal error: Call to undefined method
  Magento\Backend\Model\View\Result\Page\Interceptor::setUrl() in
  C:\xampp\htdocs\magentoee21\app\code\SR\StackExchange\Controller\Adminhtml\Stackexchange\Customer.php
  on line 22 Call Stack

and my code is:

root/app/code/SR/StackExchange/view/base/ui_component/customer_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="buttons" xsi:type="array">
            <item name="custom_button" xsi:type="string">SR\StackExchange\Block\Adminhtml\Edit\CustomButton</item>
        </item>
    </argument>
</form>

root/app/code/SR/StackExchange/Block/Adminhtml/Edit/CustomButton.php

<?php

namespace SR\StackExchange\Block\Adminhtml\Edit;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class CustomButton extends \Magento\Customer\Block\Adminhtml\Edit\GenericButton implements ButtonProviderInterface
{

    /**
     * @return array
     */
    public function getButtonData()
    {

        if($this->getCustomerId()){
            return [
                'label' => __('Custom Button'),
                'on_click' => sprintf("location.href = '%s';", $this->getCustomerUrl()),
                'class' => 'action-secondary',
                'sort_order' => 10
            ];
        }
    }

    /**
     * Get URL for back (reset) button
     *
     * @return string
     */
    public function getCustomerUrl()
    {
        $params = [
            'id' => $this->getCustomerId(),
            'store' => 0
        ];

        return $this->getUrl('stackexchange/stackexchange/customer',$params);
    }

}

//Admin controller

 <?php

    namespace SR\StackExchange\Controller\Adminhtml\Stackexchange;

    use \Magento\Customer\Controller\Adminhtml\Index\Edit;
    use Magento\Framework\Controller\ResultFactory;

    class Customer extends \Magento\Customer\Controller\Adminhtml\Index\Edit
    {

        public function execute()
        {
            $resultRedirect = $this->resultPageFactory->create(ResultFactory::TYPE_REDIRECT);
            $customer_Id = (int) $this->getRequest()->getParam('id');
            $store = $this->getRequest()->getParam('store');
            $customer = $this->_customerRepository->getById($customer_Id);

            //file_put_contents('Customer.txt', print_r($customer_Id,true), FILE_APPEND);

//Method 1
            //$resultRedirect->setPath('customer/index/edit/',['id' => $customer_Id, 'store' => $store,'_current' => true]);
            //return $resultRedirect;

//Method 2
            $resultRedirect->setUrl($this->_redirect->getRefererUrl());
            return $resultRedirect;

        }

    }

I have tried 2 different methods, but it's not working for me.

Could you please throw me right direction.


texts: How to create a combo of two products that, if bought together, have a temporary set discount?

texts:
My Magento site sells cameras, which we also push them to eBay and Amazon through a plug-in called M2E.

It is common in the camera industry to have combos like this:

SKU 12345 - Nikon D3200 18-55mm kit (black) $599.99
            Has a special instant rebate of $150 off from 9/1/12-9/7/12

SKU 23456 - Nikon 55-200mm VR lens $249.99
            If purchased with SKU 12345, a $100 instant rebate applies all month

Therefore presently we create a new SKU:

SKU 12345.23456 - Nikon D3200 18-55mm kit (black) with 55-200mm VR lens $849.98
                  Has an instant rebate of $250 from 9/1/12-9/7/12
                  Has an instant rebate of $150 from 9/8/12-9/30/12

That way we can push the SKU 12345.23456 out through the web via M2E to Amazon and eBay. And the price is correct.

However it's a problem because we have to manually manage the inventory levels. It's frustrating to say the least.

I have been reading about the Grouped, Bundle, and Configurable Products. But they do not do what we want. First of all they base the discount on a percentage, but we need the discount to be a set amount. Second of all they seem based around the idea of being customizable by the customer, whereas we need an individual SKU that represents each particular combination of various items, so that we can push that out to eBay and Amazon as set combos like that.

I can't rely on using shopping cart price rules for the discounts because then they won't get transmitted out through M2E, will they?

Therefore I need a solution to create a complex product in Magento that has its inventory determined by the other products. I am a developer but I'm somewhat new to Magento. Perhaps this will require a custom extension? Is there already an extension that can help with this?

Thanks.


texts: Get order by id and customers that made the order

texts:
I have following task to do (I have 0 magento experience, and I am told to do this):

Make standalone script that reads every order from Magento, and filter those that have purchased this product id => 297. Then write the customer and order information into a csv file on the server.

I know how to make CVS file, but I don't know how to work with magento.
How can I do this?


texts: The attribute 'cachable' is not allowed. Magento 2

texts:
I am facing the error in Magento Localhost which is

  Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file /var/www/html/magento/app/code/Mb/Customizations/etc/frontend/events.xml:
  Element 'event', attribute 'cachable': The attribute 'cachable' is not allowed.
  Line: 9

In the image you can see the error

So after That I tried to remove cacheable from the core class
magento/app/code/Mb/Customizations/etc/frontend/events.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

    <event name="layout_generate_blocks_after">
        <observer name="cust_productCanonical" instance="Mb\Customizations\Observer\ProductCanonical"/>
    </event>

    <event name="controller_action_predispatch_checkout_index_index" cachable="false">
        <observer name="checkcout_page_pre" instance="Mb\Customizations\Observer\Preloadtab" />
    </event>
    <event name="controller_action_postdispatch_checkout_index_index" cachable="false">
        <observer name="checkcout_page_post" instance="Mb\Customizations\Observer\Loadtab" />
    </event>

</config>

but after removing the casheable from the above xml file it gives me some else error

  1 exception(s):
  Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file /var/www/html/magento/app/code/TM/Crm/etc/frontend/events.xml:
  Element 'config': Missing child element(s). Expected is ( event ).
  Line: 2

magento/app/code/TM/Crm/etc/frontend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

<!--     <event name="checkout_onepage_controller_success_action">
        <observer name="tm_crm_checkout_onepage_controller_success_action" instance="TM\Crm\Observer\Crm" />
    </event> -->

</config>

So how can I remove this error and what is the problem in the above xml file. Thanks


texts: Load product prices from multiple stores for every product into one array

texts:
I need to load every product in Magento from two specific stores and collate the result into one array.

At the moment, I am doing it like this (using app/mage.php) and it's very slow:

public function getPrices($store_list)
{
    // Init
    $results = [];

    // Load Product Collection
    $product_collection = Mage::getModel('catalog/product')
        ->getCollection();

    // Iterate Through Collection
    foreach ($product_collection as $p)
    {
        // Load Retail Product
        $retail_product = Mage::getModel('catalog/product')
            ->setStoreId($store_list['Retail'])
            ->load($p->getId());
        $results[$retail_product->getSku()]['Retail'] = $retail_product->getPrice();

        // Load Trade Product
        $trade_product = Mage::getModel('catalog/product')
            ->setStoreId($store_list['Trade'])
            ->load($p->getId());
        $results[$trade_product->getSku()]['Trade'] = $trade_product->getPrice();
    }

    // Finished
    return $results;
}

Is there a way to speed this up by doing the data loading via a direct sql query?


texts:
I want to remove the count in the gird. Here it is showing 5 records found, i want to remove this. I am using grid.php to create the gird and not ui components.

Class grid.php in block folder

protected function _prepareCollection()
{
    try{

        $collection =$this->_collectionFactory->create()
            ->addFieldToSelect('product_id')
            ->distinct(true);

        $this->setCollection($collection);

        parent::_prepareCollection();

        return $this;
    }
    catch(Exception $e)
    {
        echo $e->getMessage();die;
    }
}

protected function _prepareColumns()
{
    $this->addColumn(
        'product_id',
        [
            'header' => __('Product'),
            'index' => 'product_id',
            'class' => 'product_id'
        ]
    );

    $block = $this->getLayout()->getBlock('grid.bottom.links');
    if ($block) {
        $this->setChild('grid.bottom.links', $block);
    }

    return parent::_prepareColumns();
}


texts: Problem with my cron in custom module in magento 1.9

texts:
I am unable to call cron into my model using this xml. Please suggest be a way.

app/code/local/Rkt/Crons/etc/config.xml

  <models>
        <cronscron>
            <class>Rkt_Crons_Model</class>
        </cronscron>
    </models>
</global>
<crontab>
    <jobs>
        <cronscron>
            <schedule>
                <cron_expr>*/1 * * * *</cron_expr>
            </schedule>
            <run>
              <model>cronscron/observer::setStatus</model>
            </run>
        </cronscron>
    </jobs>
</crontab>

/app/code/local/Rkt/Crons/Model/Observer.php

 class Rkt_Crons_Model_Observer
{

   public function setStatus()
   {

     Mage::log("WORKS!");

   }
}


texts: Large import files under pub/media taking too much space

texts:
I have worked on Magento before but haven't done anything related to imports, so a new problem arised were the disk of the AWS instance is getting used up due to large files in pub/media/import

You can see the folders img-old, img-old2 contains a lot of large images and zip files which I believe were imported at some point.

I would like to know how it would affect the site if I remove the imported files? Are these files used at any places in the site and the catalog itself?


texts: How do i display my color filter images in sidebar filter?

texts:
    <?php
    $attribute1 = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color1'); //"color" is the attribute_code
    $allOptions = $attribute1->getSource()->getAllOptions(true, true);
    foreach ($allOptions as $instance): ?>
      <?php
      $id = $instance['value']; //id of the option
      $value = $instance['label']; //Label of the option
      ?>
      <li data-facet-option-hidden="false" class="filt-color <?php echo $value;?>">

    <?endforeach;?>


texts: How to change tab position sorting order from admin catalog product Magento 2

texts: Need to change sorting order up/down tab product add/edit from admin catalog product.


texts: What is the best practice for updating a field in a table and returning new data in response?

texts:
I have been searching for an answer for some time, but couldn't find a reasonable answer so I ask here.
Magento experts, how do you do the following with fastest results and least resources?

Get a row matching a criteria,
Update a column
Return new data

in a Single call.
Everywhere I see is separately loading data based on queries,via model etc., for filtering.
And for Updating, we always have $id.
One way is custom query, but that too dosen't return new data, we need to get new data again.
what are others, standard, best practices?
Please guide.


texts: Difference between `checkout_onepage_controller_success_action` and `sales_order_place_after`?

texts:
Once user placed an order I would like to send SMS alert to user.

When I look for event, I found checkout_onepage_controller_success_action and sales_order_place_after.

Operationally, they both doing same I believe. Is there any difference between these two? Which one should be used in my case?


texts: How to save any text in capital letter entered by user in the form , user have access to enter any way?

texts:
Here is the input field where the user is entering the data:

<input type="text" name="nickname" id="nickname_field" class="input-text required-entry"
       placeholder="<?php echo $this->__("Enter your nickname") ?>"
       value="<?php echo $this->escapeHtml($data->getNickname()) ?>" />

I want to save the data in capital form in the Magento back end.


texts: Magento 2 styling issues after switch from default to production mode

texts:
I thought I should switch to production mode from default mode as I got closer to launching my site. As soon as I did that, the formatting of my front-end and admin section got really messed up. The front end is like one column now, almost like a mobile phone version of the site, but not even that nicely styled.

The image below is while still in default mode:

The image above is after the switch to production mode.

The admin section is screwed up also, like it has no formatting at all.

URL: www.warmanuals.com

Magento version is 2.2.1. I am also using Porto theme. The Porto people said it looks like a permissions issue, so the last thing I did was follow the directions here, for setting production permissions in a shared hosting environment where you can only have one user. This procedure did not change anything.

http://devdocs.magento.com/guides/v2.0/config-guide/prod/prod_file-sys-perms.html

Can someone help me please? Thanks.


texts: Magento 2: Catalog rule not apply on product special price

texts:
I have tried to apply Catalog Rule on product but this discount rule is not applied which product have already special price and tier price.

so is this default magento behaviour of its bug or any solution for that ?


texts:
I am creating a custom grid in an admin module. This grid represents a table almost column for column, however, I want to add a completely custom column with a bit of logic to this column. Here's my (simplified) code...

protected function _prepareCollection()
{
    $collection = Mage::getModel('me/mymod')
        ->getCollection();

    $this->setCollection($collection);

    // I need to perform some logic here to 'inject' into the _prepareColumns()
    $testString = Mage::app()->getRequest()->getParam('testString');

    return parent::_prepareCollection();
}

protected function _prepareColumns()
{
    $this->addColumn('username', array(
        'header' => Mage::helper('mymod')->__('Username'),
        'index' => 'username',
    ));

    // I want to get a value from 'prepareColumns() here
    $this->addColumn('test_string', array(
        'header' => Mage::helper('mymod')->__('Test String'),
        'index' => 'testString',
    ));

    return parent::_prepareColumns();
}

I know I can use a custom renderer here, but in my prepareColumns() method, I set a mode based on the request - so would need to pass that custom $testString through to the renderer instead - which seems even harder.

The easiest way I could thing was to just add a literal column to the collection call in prepareCollection() as asked here...

Add custom 'select' statement to Collection Magento 1.9

But I don't think it's possible.

I know I could put some custom logic in _prepareColumns() but it just seems messy - prepareCollection is obviously there to do exactly that.

Any ideas?


texts: Magento 2 : Custom Dynamic Option with Fileuploader Fields in UI_Component

texts:
T have Work on Dynamic Option that contain file-upload field and i want to save dynamic option with file in magento 2.

Here we can see Option with Dynamic Option that contain file field.

What the use of

$uploaderFactory->addValidateCallback('custom_image_upload',$imageAdapter,'validateUploadFile');


texts: Magento 2.1: Not add table into database

texts:
I follow this tutorial:
https://www.pierrefay.com/en/magento2-training/install-upgrade-setup.html
but i didn't add table into database, i had do anything in tutorial.
From here:
Go to /app/code/Pfay/Contacts/etc/module.xml and verify that the version of our module magento2 is 0.1.0.

<module name="Pfay_Contacts" setup_version="0.1.0">

Creating our installation process for magento2
Now we will create the file that will be launched during the installation of our module, under magento it is always called in the same way: InstallSchema and when called it executes the install function.
Create the file /app/code/Pfay/Contacts/Setup/InstallSchema.php like this:

<?php

namespace Pfay\Contacts\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallSchema implements InstallSchemaInterface
{
    /**
     * @param SchemaSetupInterface $setup
     * @param ModuleContextInterface $context
     * @throws \Zend_Db_Exception
     */

    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();
        /**
         * Create table 'pfay_contacts'
         */

        if (!$setup->getConnection()->isTableExists($setup->getTable('pfay_contacts'))) {
            $table = $setup->getConnection()
                ->newTable($setup->getTable('pfay_contacts'))
                ->addColumn(
                    'pfay_contacts_id',
                    \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                    null,
                    ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
                    'Contacts ID'
                )
                ->addColumn(
                    'name',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    100,
                    ['nullable' => false, 'default' => 'simple'],
                    'Name'
                )
                ->addColumn(
                    'email',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    100,
                    ['nullable' => false, 'default' => 'simple'],
                    'Email'
                )
                ->setComment('Pfay Contacts Table')
                ->setOption('type', 'InnoDB')
                ->setOption('charset', 'utf8');

            $setup->getConnection()->createTable($table);
        }
        $setup->endSetup();
    }
}

In this setup, we create the table in database that will be used for the continuation of the tutorials.

You notice the getTable function that just makes sure to format the table name, no need to declare pfay_contacts elsewhere (as on magento1).
This creates the table with the newTable function and adds columns with addColumn , a comment with setComment
And we specify options linked to the database with setOption
The table is then stored in the database from the connection and the createTable function.

As for magento1, an installer starts with startSetup and ends with endSetup

Enable the module, update the tables and assign the rights to the cache
Via the following commands:

php bin/magento module:enable Pfay_Contacts
php bin/magento setup:upgrade
chmod 777 -R var/

Can anyone help me with this?


texts: Magento 2 Error - file cannot be removed in magentodir/var/generation/Magento/Framework while i create block and upgrade set up

texts:
E:\xampp\htdocs\magento-2>php -dmemory_limit=5G bin/magento
  setup:di:compile The directory
  "E:/xampp/htdocs/magento-2/var/generation/Magento/Framework" canno t
  be deleted
  Warning!rmdir(E:/xampp/htdocs/magento-2/var/generation/Magento/Fram
  ework): Directory not empty#0
  E:\xampp\htdocs\magento-2\vendor\magento\framework
  \Filesystem\Driver\File.php(403):
  Magento\Framework\Filesystem\Driver\File->dele
  teDirectory('E:/xampp/htdocs...')

E:\xampp\htdocs\magento-2\vendor\magento\framework\Filesystem\Driver\File.php
(403):
Magento\Framework\Filesystem\Driver\File->deleteDirectory('E:/xampp/htdoc
s...')
E:\xampp\htdocs\magento-2\setup\src\Magento\Setup\Console\CompilerPreparation
.php(68):
Magento\Framework\Filesystem\Driver\File->deleteDirectory('E:/xampp/ht
docs...')
E:\xampp\htdocs\magento-2\vendor\magento\framework\Console\Cli.php(74):
Magen
to\Setup\Console\CompilerPreparation->handleCompilerEnvironment()
E:\xampp\htdocs\magento-2\bin\magento(22):
Magento\Framework\Console\Cli->__c onstruct('Magento CLI')
{main} PHP Fatal error:  Class 'Cli' not found in
E:\xampp\htdocs\magento-2\bin\magento  on line 31

  Fatal error: Class 'Cli' not found in
  E:\xampp\htdocs\magento-2\bin\magento on l ine 31


texts:
we have a shop that sells physical configurable products. We use a custom payment provider (own extension) and our store is located in Europe.

What core extension can we disable without nasty side effects?

Mage_Usa
Mage_Authorizenet
Mage_Downloadable
Mage_Authorizenet
Mage_GiftMessage
Mage_GoogleCheckout
Mage_Paygate
Mage_Poll
Mage_Usa
Mage_Weee
Phoenix_Moneybookers

thanks!!


texts: Magento 2.4.2: Where in Magento admin to configure to present taxes and custom duties in the shopping cart?

texts:
We have so far only been shipping within the US. But we now are planning shipping to Canada. The idea is to have the customer pay for all custom duties and taxes directly on our Magento site.
Shipping cost should display shipping and the brokerage as their sum. We need also to calculate and display duties in the shopping cart page. How to configure this if it is possible with Magento? If not, are we required to do this with the help of template overriding?


texts: Magento 2.3: Parent Category page does not show any subcategory products after data migration

texts:
I just migrated from Magento 1.9 to Magento 2.3.4 and I have an anchor category that should be showing all the subcategories products, but somehow it does not show any of the subcategory products.

Parent Category Display Setting:

in my M1 site , if i go to the category page, it will show all subcategory products:

http://m1-site.local/catalog/category/view/id/1404

in my M2 site, if i go to the category page, it won't show any products at all:

http://m2-site.local/catalog/category/view/id/1404

I tried to debug it in vendor/magento/module-catalog/Controller/Category/View.php:264 :

private function getPageType(Category $category) : string
{
    $hasChildren = $category->hasChildren();
    if ($category->getIsAnchor()) {
        return  $hasChildren ? 'layered' : 'layered_without_children';
    }

    return $hasChildren ? 'default' : 'default_without_children';
}

it should return layered but always return layered_without_children , this means the function does not count the subcategories correctly. When i checked the Store > configuration > Catalog > Storefront > Category Flat it was enabled, then i disabled it and run indexer and cache flush, but still the same case.

UPDATE
I noticed in M1 the query is inner joining the product table with mage_catalog_category_product_index but in M2 is with mage_catalog_category_product_index_store1

this mage_catalog_category_product_index_store1 table does not have product with category id 1404


texts:
I added some fields in the Magento contact form, but I have a problem with one field, which is a select type.

I try to display the label of the option on the mail but now the value is display....

Can we fix that ? (form.phtml)

<select name="query-select" id="query-select">
   <option disabled>Votre type de demande</option>
   <option value="demande-devis">Une demande de devis</option>
   <option value="delai-livraison">Un délai de livraison</option>
   <option value="retour-marchandise">Une demande de retour de marchandise</option>
   <option value="dispo-produit">La disponibilité des produits</option>
   <option value="ouverture-compte">Une ouverture de compte</option>
   <option value="sav">Une réclamation/SAV</option>
   <option value="suivi">Le suivi de ma commande</option>
   <option value="autre">Autre</option>
</select>

submitted_form.html

{{template config_path="design/email/header_template"}}

        {{trans "Name"}}
        {{var data.name}}

        {{trans "Email"}}
        {{var data.email}}

        {{trans "Entreprise"}}
        {{var data.company}}

        {{trans "Type de demande"}}
        {{var data.query-select}}

{{trans "Message"}}

{{var data.comment}}

{{template config_path="design/email/footer_template"}}

Thanks !


texts:
So I installed Magento 2.4 via docker/composer on my development machine.
I am trying to use the German (Germany) language for my store front view. I tried with just the default setup, I also tried using a i18n language pack (https://github.com/mageplaza/magento-2-german-language-pack) and i10n language pack (composer require community-engineering/language-de_de). I am unclear if I need any or all of these packs?
After doing all that and setting the Locale in the view settings, setup:upgrade and cache clear/flush, reindex, restart, switching to this view in the frontend changes almost nothing to German language. It changes a few words like "or" and "required", but that's almost it. I tried using Magento Luma default theme and also Solwin FreeGo (which I'd like to use).
For example from creating a new account, almost everything is in English:
Create New Customer Account
Personal Information
First Name
Last Name
* Pflichtfelder

Is localization really so bad for Magento or am I missing something here?


texts: How can i use my extention from old theme in my new theme in magento 1.9

texts: I had purchased and installed a search autocomplete extension in my old theme. I recently changed my theme. How can i use the same extension in my new theme.


texts: Magento 2 Interface Locale issue with en_gb(uk)

texts:
I am using Magento 2.1.9 with  Interface Locale en_gb(uk).

After changing from english (us) to english(uk):

I am not able to give special date for products.
Not able to add cart price rules also.

Please hep me out on this.

Thanks in advance.


texts:
I am getting this response in magento 2 curl. Do you know, how we can convert this response into array?

Here is my code:

$this->curlClient->post($url, $post);
$responseCurl = $this->curlClient->getBody();
print_r($responseCurl);

Current O/P:

{"status":true,"data":{"name":null,"start":"2018-04-19 11:07:02","end":"2018-04-19 11:07:02","discount_type":"P","discount_amount":12,"code":"abc_123"}}

Thanks in advance?


texts: How to use multiple keywords search back end of Magento 2

texts:
I have a product called:

Volvo XC70 Polar Navigation XS2

I would like to search in the back-end on

Volvo Polar

but it gives no result. I can't use multiple keywords. Is there anyway to make that possible?

Kind regards, Arjen


texts: Magento2 - Product Update Attributes sort order

texts:
we use the Update Attributes function a lot for adding extra attributes to the products.

Only the sort order of these attributes are based on oldest first (i think)
Is there a way to re-arrange them?

Because the attributes which we update the most are about on 2/3th of the page ... so that means a lot of scrolling ....

I have added a screenshot with the 2 attributes i would like to have on top ....


texts: Domain redirection in htaccess not working

texts:
I have changed domain on the Magento store, however I need to still keep old domain urls accessible and redirected to new domain urls.

for example.
old-domain.com/products  should redirect to new-domain.com/products

This is from my current htaccess

Options +FollowSymLinks
RewriteEngine on

#  RewriteCond %{HTTP_HOST} ^old-domain\.com$ [OR]
#  RewriteCond %{HTTP_HOST} ^www\.old-domain\.com$
#  RewriteRule (.*)$ http://www.new-domain.com/$1 [R=301,L]

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

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

as you can see, I tried 2 versions,

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

and

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

But none of them work.
Yes, I have disabled caching in Magento and yes, just in any case, I still flush the cache in Magento and I clear cache in browser too.

I dont know if this matters but anyways.
Both new and old domains are controlled by godaddy, with its default nameservers, and both domains have @ record pointed to my server IP address.

Please help : )

Note: of course, I have real domains in the htaccess instead of old-domain.com and new-domain.com

Currently any kind of url with old domain, just redirects to homepage of new domain.


texts: How to echo or vardump product detail on cart page

texts:
How can i call,
echo or vardump current product detail on cart page from phtml file.

please someone send code or suitable link for that.


texts: Downloadable Product links not available for combined order of downloadable and simple products after payment

texts:
I have spotted a strange bug in magento 2 with combined orders of downloadable and simple products.

It was observed on a Magento CE 2.3.4 on Ubuntu 18.04 LAMP and on a vanilla Magento 2.4-dev instance.

I run a number of tests, see my result of all test cases:

1. Place an order with simple and downloadable product and payment by paypal website payment standard payment:

Expected result:
Order Status processing, invoice created, download available

Actual result:

Order Status processing, invoice created, download not available (this should not be the case, customers expect the download to be available right after payment)
If shipping is created, download is available

2. Place an order with simple and downloadable product and payment with check money order and manual invoice creation OR downloadable product only in order, payment with paypal:

Expected and Actual result:
Order status processing, download is available

So it looks like there is a difference if the invoice creation is triggered by an extenal payment platform such as PayPal or Stripe.com or if the invoice is created manually in Magento admin. The invoice creation is the required step to enable downloads.

I have not tested all other possible combinations of product types in one order (grouped, virtual, bundle).

Any idea how this can be fixed?
Link to github issue: https://github.com/magento/magento2/issues/27590


texts: How to implement Magento's Table gateway joins correctly

texts:
Synopsis

When I create or save an instance of my custom model, I would like it to automatically save relationships in a pivot table.

How can this be done in Magento? and
How can I filter my frontend results with this (in a block)?

Data

$data = [
    'store_id' => [1, 2, 3],
    'field_a'  => 'value',
];

$model = Mage::getModel('custom/model');
$model->setData($data);
$model->save();

Table Structure

custom_model_table
id
field_a

custom_model_table_stores
custom_id
store_id

P.S. Magento's model structure is NOT an ORM but more a Table Gateway


texts: Magento2 Move static block to above footer and below main content

texts:
In my magento2 based website I have a static block that i want to load right before the footer block but below the main content of the page.
I have tried the below but that did not seem to make it load anywhere.
I also tried replacing the name value in the referenceContainer to footer but then that put the static block inside the footer which is not what I want because I want/need this static block to be full width of the page and not contained within any other div.

thoughts on how to achieve this?

<referenceContainer name="page.main">
<block class="Magento\Cms\Block\Block" name="muah_landingpg_footer_banner" after="-">
    <arguments>
        <argument name="block_id" xsi:type="string">muah_landingpg_footer_banner</argument>
    </arguments>
</block>


texts: Magento 1 extension and composer : Packagist and/or Firegento

texts:
I just finished an extension and I was wondering : in order to have my extension available in composer, is it better to publish it on Packagist or in Firegento ?

In fact, I already published it to Packagist and it seems to work (my extension is loaded as expected), but then I found some sources like this one where it is said :

  For reasons we don’t have time to cover, having Magento packages as a part of packagist.org isn’t feasible. Instead, the crew over at Firegento, via their hackathon, have created their own custom composer repository at packages.firegento.com. This is a composer repository for Magento extensions.

For me, it's feasible, but I'm probably misunderstanding something ...

In other words, my question is : is it feasible to have a Magento extension on
Packagist and make it work with composer ? If not, why ?

For information, I use aydin-hassan/magento-core-composer-installer and magento-hackathon/magento-composer-installer in my composer.json.

Thanks.


texts: Magento 2 Move Top Links to Main Navigation

texts:
I am trying to move the top links (default message, account links, etc) at the top to follow the main navigation.  I have tried:

<move element="top.links" destination="page.top" before="-" />

and

<referenceContainer name="page.top">
<block class="Magento\Framework\View\Element\Html\Links" name="top.links"
destination="navigation.sections">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>

among many other variations with no luck.  It places it after the section before the content.  Not after the Nav tag where I want it.  Basically  What is the trick?

Stan


texts: Magento 2.3.5 admin panel showing blank page

texts: After successful installation when you open admin url, Admin panel showing black and also frontend links not working.


texts: Magento 2.3 - After setup Multi-website CSS unknown error - LEMP (Centos 7 - Nginx)

texts:
After configure multi website using https://magento.stackexchange.com/a/117930/57334 css not loading.
Note: My main website working, multi Website only getting this error.


texts:
I moved the reviews from the tab block

<referenceContainer name="page.wrapper">
    <container name="product-review-container" as="product-review-container" after="main.content">
        <block class="Magento\Review\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="product/view/list.phtml"/>
    </container>
</referenceContainer>

and deleted the tab because I don't need him

<referenceBlock name="reviews.tab" remove="true"/>

question: how to create a slider with reviews from the reviews block

more or less like this


texts: Understanding object manager argument replacement using di.xml for commands

texts:
I'm following object manager argument replacement tutorial. One of the possible di.xml looks like

<type name="Pulsestorm\TutorialObjectManagerArguments\Model\Example">
    <arguments>
        <argument name="scaler1" xsi:type="string">bar</argument>
    </arguments>
</type>

Which means in Model Example's class's constructor, replace (whatever old) value of argument $scaler1 with bar.

Whereas for commands it looks like

<type name="Magento\Framework\Console\CommandList">
    <arguments>
        <argument name="commands" xsi:type="array">
            <item name="testbedCommand" xsi:type="object">Pulsestorm\TutorialObjectManagerArguments\Command\Testbed</item>
        </argument>
    </arguments>
</type>

Which says add 1 new item(command) in CommandList's constructor argument commands(which is of array type).

I don't see use of the name testbedCommand anywhere in the module.
What will be it's usage ? Should it be unique?


texts: Allowed memory size exhausted while exporting products

texts:
I am getting below error as when i am trying to export products from System->Import/Export->Export

If i check using phpinfo(); then it says

memory_limit 1024M &
max_execution_time 18000

How to fix this?


texts: Solution to : My USPS label print contain a “SAMPLE-DO NOT MAIL” watermark

texts:
I had the issue were i was unable to print the shipping label without the "SAMPLE DO NOT MAIL" Watermark.
After 2 days of research on the google and every possible doc i could read it finally payed off.
Here is the solution and path to the correct file that need to be edited in your magento cpannel.

The API containing "Certify" is their testing API and will print labels with the sample watermark. In order to generate actual labels, you must remove "Certify" from all of your Web Tools XML requests.

So for those who don't know were it is in magento 1.9.3.2 go to:

  public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/USPS.php

Open the file usps.php with the edit tool in your cPanel, or with any editing tool such as notepad+ etc...
in usps.php Run a search command by pressing command+F and delete the word   "certify".
In my case i only had 2 results showing so i just delete them and save.
go back and create a new shipping label and voila !!!!

if this doesn't work for you email your issue to uspstechnicalsupport@mailps.custhelp.com
They usually answer you within 1 or 2 ours but you need to email them 3 times because first 2 will be auto responded.


texts: UI component Field Valiation issue in Magento 2.1

texts:
I have create a field in magento 2.1 with integer validation.
<item name="validation" xsi:type="array">
                    <item name="integer" xsi:type="boolean">true</item>
                </item>

this lines of code works fine magento 2.3 for Integer validation but when i use this in magento 2.1 that treats it like required field + Integer value validation.
any help would be appreciated.


texts: magento 2 simple admin form with submit and without any data source

texts:
Trying to create simple form inside admin to perform some action inside Block class (included into layout) and return success or error message.

The thing is I needn't use any data source and edit/delete actions.
So simply need to submit it and do some actions inside.

I tried to make form via template and layout, but submit takes me to "admin/dashboard" instead of needed controller whatever I tried to set inside form action parameter.

view\adminhtml\templates\index\index.phtml

<form class="form" action="" method="post">

    <fieldset class="fieldset">
        <legend class="legend"><?php echo __('Import Product') ?></legend>

                <?php echo __('GTIN') ?>

                <input type="text" id="number"
                       name="number"
                       class="input-text">

    </fieldset>

            <button type="submit" class="action submit primary" title="<?php echo __('Submit') ?>">
                <?php echo __('Submit') ?>
            </button>

</form>

view\adminhtml\layout\importproduct_index_index.xml

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

        <referenceContainer name="content">
            <block class="Modules\Import\Block\Adminhtml\Index\Index" name="index.index"
                   template="Modules_Import::index/index.phtml"/>
        </referenceContainer>

</page>

How to make submit to needed controller? Or is there another way to create simple form?


texts:
How can I keep Add to cart button disable until end user filled all the required option for product??

For e.g. If products has required attributes like color and size then at first add to cart button will be disable but once user select the color & size then Add to cart button will enabled automatically.

I think using jQuery this can be done easily but I don't think it's proper way to do so ...is there any Magento way to achieve this??


texts: Add custom tab to configurable product on add/edit product tab Admin side

texts:
I have searched for the issue but didn't find any clue.I studied this link and so many other's like this for custom tab and i did it.But the issue is that  i want to restrict the tab to be only visible to configurable product and also want to show on  product add tab.Currently it's working for edit.MY admin side xml code is :

 <adminhtml_catalog_product_edit>
    <reference name="product_tabs">
        <action method="addTab">
            <name>my_custom_tab</name>
            <block>mymodule/adminhtml_catalog_product_tab</block>
        </action>
    </reference>
</adminhtml_catalog_product_edit>


texts: How to include the module name in magento2

texts:
Is anyone knows how to load the model in magento2?

What we need to do in magento2 to translate the below line in Magento2

$order = $observer->getEvent()->getOrder();

        $orders = Mage::getModel('sales/order_invoice')->getCollection()
                        ->addAttributeToFilter('order_id', array('eq'=>$order->getId()));


texts:
During Magento 2 upgrade process from 2.1.7 to Magento 2.1.8, when I run command: php bin/magento setup:upgrade
I was getting below error:

  Cannot instantiate interface
  Magento\Framework\App\Config\ConfigSourceInterface in
  /home/public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73


texts: How to I add another option to an existing select attribute?

texts:
I have created an attribute using the following install script:

<?php

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

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->addAttribute('catalog_category', 'category_pricebreak', array(
'group'         => 'Display Settings',
'input'         => 'select',
'type'          => 'varchar',
'label'         => 'Price Break',
'option'        => array(
        'values' => array(
            0 => '$10',
            1 => '$50',
            2 => '$100',
            3 => '$250',
            4 => '$500',
            5 => '$1000',
        ),
    ),
'backend'        => 'eav/entity_attribute_backend_array',
'visible'       => 1,
'required'      => 0,
'user_defined' => 1,
'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$installer->endSetup();
?>

Now I would like to add another option for $25. I would also like to do this with an upgrade script as opposed to directly editing the DB. If possible, I'd also like this new $25 option to appear between the $10 and $50 options in the drop down. From what I've found so far it appears the only way to achieve this is by dumping all the current table data into an array, then basically dropping and recreating the table with the new option, then reinserting all the info back into the table. Is that the approach I have to take or is there a function I can use to simply insert a new option into the existing attribute list? I found this question to be somewhat helpful, but I'd like to make sure the new option appears in a specific order. Is this possible?


texts: Very often I observe customers adding to cart then moving to the checkout then disappearing. It looks like a bot or maybe competitors searching for our products and trying to hit us with fake purchases. Google charges us anyway so it cost us money. Very annoying. Any suggestions on what can I do with it or if it is a bot how to make sure and eventually block?


texts: Create custom dropdown config values in magento 1.9

texts: I need to create a custom dropdown having values of Enable/Disable in config file in magento 1.9 .How can I achieve this? can anyone help me?


texts:
I am trying to override a model in the Stripe extension, but I can't seem to get it to work. Here is what I have so far:
Stripe config.xml
<config>
 <global>
  <models>
      <compiler>
        <rewrite>
          <process>Stripe_Payments_Model_Compiler_Process</process>
        </rewrite>
      </compiler>
      <stripe_payments>
        <class>Stripe_Payments_Model</class>
        <resourceModel>stripe_payments_resource</resourceModel>
      </stripe_payments>
      <stripe_payments_resource>
        <class>Stripe_Payments_Model_Resource</class>
        <entities>
          <webhook>

stripe_webhooks

          </webhook>
        </entities>
      </stripe_payments_resource>
    </models>
...

Stripe Model to override path:
app/code/community/Stripe/Payments/Model/PaymentIntent.php
Stripe Model to override:
<?php

class Stripe_Payments_Model_PaymentIntent
{
...
}

My module's config.xml:
    <config>
     <global>
      <models>
          <dbcustom_stripe>
            <class>DBCustom_Stripe_Model</class>
          </dbcustom_stripe>
          <stripe_payments>
           <rewrite>
            <paymentintent>DBCustom_Stripe_Model_PaymentIntent</paymentintent>
           </rewrite>
          </stripe_payments>
      </models>
...

My overriding model path:
app/code/local/DBCustom/Stripe/Model/PaymentIntent.php
My overriding model:
<?php

class DBCustom_Stripe_Model_PaymentIntent extends Stripe_Payments_Model_PaymentIntent {

...

}

My module is active and is overriding a helper class. I have also tried flushing the cache multiple times. Not sure what else to try, any help is appreciated.


texts:
We load data from our supplier about the date when new stock will arrive.
The date is loaded like: 07-12-2016, which is 12 July 2016 and not 7 December 2016.

I use following code to load the date:

CODE:

<?php $today = Mage::helper('core')->htmlEscape($_product->getData('delivery_eta')); $date = Mage::helper('core')->formatDate($today, Mage_Core_Model_Locale::FORMAT_TYPE_FULL, false); echo $date;?>

But this is displayed as 7 December 2016. How can I change this, so that the date is loaded correctly like 12 July 2016?


texts: When i doing migration from magento 1.9.3.1 to magento 2.3.5 p2 getting this error. And after search this related issue i deleted some database tables but again and again i getting this issue on migrate:data command. But i do migrate this magento 1 version with magento 2.3.4 it will be done without any issue so anyone will be able to tell me how to solve this issue?


texts: Rest API issue in cart : multiple store only shows default store's price of a product in cart for both store in magento2.1.7

texts:
In my multi store Using here same magento2 default API calls to POST and GET cart items, However am getting only default price of a product for both english and arabic store.ALL other product up to product list API I got different prices for different stores there am used just 'store_code' after '/rest/' in API calls.

Expected Result : Price should be different for different stores products in cart.

Actual Result : Only getting default store's price of a product in both english and arabic stores in magento2.1.7.


texts: Using Magento Header and Footer with vBulletin

texts:
I have a Magento website currently in development and would like to have vBulletin 4 forums setup for my customers.

Is it possible to use the Magento Header/Navigation and Footer with vBulletin forums?  Would it be possible to "wrap" vBulletin inside of the Magento navigation of my main site?


texts: How to change the status value in orders api?

texts:
In the orders api of Magento 2, I'm sending status parameter as completed.

But I have custom status as "ProdCompleted.

So everytime I get status="completed" That's why I want that if api get parameter status="completed" then it should send the response for status="ProdCompleted"

  http://magentosite/rest/V1/orders

How can I do this? can I override the Orders API? If yes, then How can I override the orders API?


texts: How can I disable the glowing blue border on focus from all input fileds

texts:
I wonder if you could help.
I would like to disable the glowwing blue border on focus from all my input fields and replace it with border-bottom: 1px solid black.
I found this
input#search:focus:not([disabled]){ box-shadow: none }
I added to the css
border-bottom: 1px solid #000000;
so now I have
input#search:focus:not([disabled]) { box-shadow: none; border-bottom: 1px solid #0a0a0a; }
Then I added it to my _extend.less file app/frontend/vendor/theme/web/cs/source
and it works as required but only for the search bar input. I would like to do it for all my input fields.
Please give me a tip on how to do it.
Thank you in advance.
Pawel


texts:
I created this file (code\local\Mage\Catalog\Block\Product\Exclusives.php) to get all product from the attribute 'online_exclusive' that is also part for a specific attribute set id.

The code works, but in (template\catalog\product\exclusives.phtml) the toolbar is returning empty.
If I remove ->addAttributeToFilter('attribute_set_id', $setID) the toolbar returns a true value. I can't think of any other way to work this out. How else could I look for the attribute_set_id. This is being used as a sub category page that is displaying a static block.

{{block type="catalog/product_exclusives" name="online.exclusives" alias="online.exclusives" column_count="6" products_count="400" template="catalog/product/exclusives.phtml"}}

<?php

class Mage_Catalog_Block_Product_Exclusives extends Mage_Catalog_Block_Product_List{

   protected function _getProductCollection($setID){
      $collection = Mage::getResourceModel('catalog/product_collection');
      $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());

      $collection = $this->_addProductAttributesAndPrices($collection)
         ->addStoreFilter()
         ->addAttributeToFilter('attribute_set_id', $setID)
         ->addAttributeToFilter('online_exclusive', true);

      $this->setProductCollection($collection);

      return $collection;
   }
   public function getLoadedProductOnlineExclusiveCollection($e){
     return $this->_getProductCollection($e);
   }
}
?>

Thanks!


texts: Magento 2 product filter by rating in layered navigation

texts:
In Magento 2.3.5, I want to add filter by ratings options at layered navigation.
Please anybody can explain how can i achieve ?
Thank you,


texts:
I used memcache for sessions but can not login to both of frontend and backend in mg1810

before this, I did use redis for sessions and now want to use memcache instead of redis

Also did FLUSHALL in redis-cli, memcache service is running and local.xml set to ...

<config>
<global>

    <session_save><![CDATA[memcache]]></session_save>
    <session_save_path><![CDATA[tcp://127.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10]]></session_save_path>

</global>
</config>


texts:
In Magento 1.9.3.1 admin customer view got an error -

  Fatal error: Call to a member function getQntyInput() on null in public_html/app/code/community/MageWorx/CustomOptions/Model/Observer/Stock.php on line 164

and that line is

  if (!$productOption->getQntyInput()) continue;


texts: Magento 2.3: Account Email Confirmation is not sending

texts:
We are using Magento cloud environment for our project. There, we want to send a confirmation email when the customer get registered on our website.

So, I have done: Store -> Configuration -> Customers -> Customer Configuration -> Requires Email Confirmation -> Yes

Though, I have set the option to Yes, am not receiving any email when I register.

I have installed the Mageplaza SMTP extension and getting the test email without any issues.

So, I'm not sure, what could be the issue since its a default Magento config.

Any help will be appreciated!


texts: Magento 2: create table dependent on configuration

texts:
I have a requirement where I need to create a custom table in database but these should be dependent on some configuration of module.

Lets say I have enable disable configuration in my module, if any one change configuration value to enables then table will create in database otherwise no creation of table.

Note: this configuration is one time only means if any one select Enable then he can not change back to Disable.

Let me know if it is possible in magento, as if we use installer then it will execute once we upgrade the setup or enable the module.

And if yes then is it a correct way to do and also explain the correct way to achieve this requirement.


texts: How to add a subtotal for separate products in mini-cart?

texts:
I am using a slightly modified modern theme for my store. Most of my store is using a 3 column layout with a mini-cart in the right column.
By default the products in the mini-cart have a thumbnail, product name, quantity and unit price:

What I would like to do add a separate subtotal for every product in the
cart...something like in the picture:

Any help would be appreciated.

Regards


texts: populating products from xml on into magento catalog

texts:
I am looking to develop an automated system for inventory but got no pointers on how to, there is a product XML from a shop with product meta information, which my Magento store should read through after x number of minutes and fill in the inventory depending on code for <attr> code or delete, modify it, I will try to best illustrate this

<product>Playstation 4</product>
<sku>00123</sku>
<desc>A very cool console</desc>

<attr></attr>

That is an excerpt/example of an XML file which will be imported from an FTP server after successful login, how can I use that info to map those to my Magento store and sync my store level.


texts: Magento 2: installation command not working

texts:
I am executing magento 2 install command but it show error

SQLSTATE[42S02]: Base table or view not found: 1146 Table
'magento_saas.store_website' doesn't exist, query was: SELECT
main_table.* FROM store_website AS main_table WHERE
(main_table.website_id > 0)      ORDER BY main_table.sort_order ASC,
main_table.name ASC

installation command

php bin/magento setup:install --base-url=http://magento2.com/
--db-host=localhost --db-name=magento_saas --db-user=root --db-password=qwerty321 --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin@123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=localhost --elasticsearch-port=9200


texts: Exclude countries from cross border trade

texts:
We sell products from our store in germany. We'd like to use the cross border trade feature to have consistent prices for our EU customers.

Anyway all international customers should still be able to order products with 0 % vat.

Let me give you an example:

Cross border trade enabled
Germany (19 % Vat) – 119,00 € incl. 19 % VAT
Sweden (25 % Vat) – 119,00 € incl. 25 % VAT
US (0 % VAT) – 119,00 € incl. 0 % VAT

Cross Border Tax disabled
Germany (19 % Vat) – 119,00 € incl. 19 % VAT
Sweden (25 % Vat) – 125,00 € incl. 25 % VAT
US (0 % VAT) – 100,00 € incl. 0 % VAT

What we need
Germany (19 % Vat) – 119,00 € incl. 19 % VAT
Sweden (25 % Vat) – 119,00 € incl. 25 % VAT
US (0 % VAT) – 100,00 € incl. 0 % VAT

I did alot of research and found two possible solutions.

Adjust prices via shoppingcard pricerules

Set up a price rule for all countries with vat 0% and give them a procentual discount of 15,9446 (= -19% VAT). Would work but our tax accountant doesn't like that solution.

Adjust prices via price extension

There are several extension out there to adjust price zone for countries. I think this would solve our problem but we would have alot of work to set up the prices for all products.

So is there another solutions for this problem? Is it possible to exclude countries from the cross border trade feature?


texts: Searching for SKU not showing results, Magento 2 EE

texts:
Searching with the SKU doesn't return any results.  Example of SKU:

ZOR_ZONU3103

I've made sure that the sku attribute is set as Searchable.  I have reindexed.  I tried SOLR.

Is this a known issue, or something can be adjusted to work somewhere?


texts: Price filter returns wrong results - Price is stored as 0 instead of null and is set to special_price

texts:
We have a problem with our price filter. We are using magento 2.2.6 and Smile-SA/elasticsuite 2.6.x-dev.

When I go to a category and set a price range filter 0-0,99 I get results with a higher price. The URL looks like: /baelle/?price=0-1
When I query the ElasticSearch manually for one of the given SKUs the price looks always as the following for all customer groups:

price: [
    {
        price: "0.0000",
        original_price: "79.9500",
        is_discount: true,
        customer_group_id: "0"
    }
],

In the backend the product is configured with a price of 79.95 and no advanced pricing. In the catalog__product_index_price table it's stored like this:

But when I set special_price in the backend the price in ElasticSearch changes to the according special_price. Similar to the entries in catalog_product_index_price it looks now like this:

All of this happens to configurable and simple products alike and we have no idea where or what the problem could be.

Any ideas why the price filter is not working as expected?

Update

I figured out we have some products where the indexer is working as expected but for the majority it is not. \Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice::prepareFinalPriceDataForType()
Is not beeing called either way.

I executed php bin/magento dev:tests:run unit to see if maybe an test for the indexer is failing but only one test failed and it has nothing to do with the indexer.

I tried to find a pattern which products are working as expected and which don't but I had no luck with it.

Update 2

I started to disable all third party modules. After disabling all, clearing all caches and executing bin/magento setup:di:compile there is still no difference.

Update 3

I have tried to run the dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price integrations tests in order to figure out some more details but the tests fail straight away with the following error:

  Error in fixture: "dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple.php".
   Unable to save Stock Item

Could this error lead into a wrong index?


texts: Magento filter by attribute and category not working

texts:
$products = Mage::getResourceModel('catalog/product_collection')
->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')
->addAttributeToFilter('category_id', array('eq' => 26))
->addAttributeToSelect('*')
->addFieldToFilter('trending',1)
     ->setPageSize(20);

This wont work when i use both  ->addAttributeToFilter('category_id', array('eq' => 26)) and   ->addFieldToFilter('trending',1)
if any one them are removed it will work


texts: How can I add a product in specific website programatically?

texts:
I want to add a product in a particular website.

I am using below code for add to cart product programmatically.

try {
    $params = array();
    $params['qty'] = 1;//product quantity
    $_product = $this->product->loadByAttribute('sku', $getsku);

    if ($_product) {

        $additionalOptions = [];
        $additionalOptions[] = array(
           'label' => "yyyy",
           'value' => $this->getRequest()->get('attendeename'),
        );
        $additionalOptions[] = array(
            'label' => "zzzzz",
            'value' => $this->getRequest()->get('relationship'),
        );
        $_product->addCustomOption('additional_options', serialize($additionalOptions));

        $this->cart->addProduct($_product, $params);
        $this->cart->save();
        $this->registry->register('atc_status',"1");
        $errmsz['success'] = "1";

    }
}


texts: Missing words when create pdf invoice with chinese character

texts:
I am currently having a problem:
Currently when I create an invoice in the backend in Chinese, my font is missing some characters that cannot be created. I tried searching for different fonts on google but couldn't find the right one.
So I want to ask that in order to be able to create a pdf file, which font do I need and where do I download it.

Thank for reading and supporting me


texts: How can we check context object list for observer in magento2

texts:
I want to know context object list which we can use methods directly from $context object in Observer.

Just like in below URl.

Magento2 – Use Defined Methods from Context Object
URL:- https://webkul.com/blog/magento2-use-defined-methods-context/

Please help me if anybody have answer.


texts:
I wish to create a simple adminhtml public page and not a private page.

  www.website.com/admin/users/form

How can I realize that ?


texts: Admin category positioning not working properly

texts:
I recently found an issue with magento admin category positioning. When i drag n drop a category position to switch places with another category. Nothing happens.. It basically runs for like 20 seconds and it shows that it changed. Request completed with success. But when i look at catalog_category_entity table. I see that position didn't change. And when i refresh admin page i see no changes. Before when it didn't worked at all i just sorted categories manually by simply editing the position column, and it did worked for all categories except 2. I just can't make them to switch places.

Anyone has a solution for this issue?
Really need help with this one..


texts:
I have installed a multistore extension (https://landofcoder.com/magento-2-currency-auto-switcher.html)

but it is not working in the frontend, the stores and currency are not switching automatically, I have to change them manually then they are working.

I have run these commands::
uploaded unzip folders in Magento respective subfolders

sudo php bin/magento setup:upgrade
sudo php bin/magento setup:di:compile
sudo php bin/magento setup:static-content:deploy
sudo php bin/magento cache:flush
sudo php bin/magento indexer:reindex

I have also done all the configurations and enabled the extension also.

After running these commands the design of the site gets disturbed and all the CSS and JS files are not loaded OR not found, so the first issue is how to run the css and js files and another issue is that if they run then stores and currencies are not auto-switched.

What may be the issue?


texts: Custom filter in the sales order admin grid giving Invalid block t

texts:
I've been able to filter custom added column  like 'seller name ' its get from seller id of product.

other filters are working.

$this->addColumn('seller_id', array(
        'header' => Mage::helper('marketplace')->__('Seller Names'),
        'index' => 'seller_id',
        'filter'    => true,
        'sortable'  => true,
       // 'renderer'  => 'marketplace/adminhtml_productrequest_renderer_sellername'
    ));

when I try to use the column to search I get an error like this.

  exception 'Mage_Core_Exception' with message 'Invalid block type: 1' in C:\wamp\www\magento\app\Mage.php:595
      Stack trace:
       C:\wamp\www\magento\app\code\core\Mage\Core\Model\Layout.php(495):
  Mage::throwException('Invalid block t...')
      1 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Layout.php(437):
  Mage_Core_Model_Layout->_getBlockInstance(true, Array)
      2 C:\wamp\www\magento\app\code\core\Mage\Adminhtml\Block\Widget\Grid\Column.php(369):
  Mage_Core_Model_Layout->createBlock(true)
      3 C:\wamp\www\magento\app\code\core\Mage\Adminhtml\Block\Widget\Grid\Column.php(51):
  Mage_Adminhtml_Block_Widget_Grid_Column->getFilter()
      4 C:\wamp\www\magento\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php(314):
  Mage_Adminhtml_Block_Widget_Grid_Column->setGrid(Object(Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid))
      5 C:\wamp\www\magento\app\code\local\Mage\Adminhtml\Block\Sales\Order\Create\Search\Grid.php(157):
  Mage_Adminhtml_Block_Widget_Grid->addColumn('seller_id', Array)
      6 C:\wamp\www\magento\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php(624):


texts: Magento system log filling up with CSS and JS debug messages


texts: Update product stock with observer Magento 2

texts:
right now I need to have a sincronization between my magento products and a third party software, lets call it X, X stores all the products info, my goal is to use a observer to update a single product stock on page load, so when it loads the page it will make sure to have the stock update to prevent errors between the two databases stocks.

Any idea is welcome.

PD : Thanks for your time.


texts: Getting PHP Fatal error: Call to a member function getAttributeCode() on Admin

texts:
Suddenly I am getting a fatal error, when I go the Manage products page on Magento Admin, Can anyone suggest what could be the reason ?

  PHP Fatal error:  Call to a member function getAttributeCode() on a
  non-object in
  /app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line
  1186,