texts: How can I use Magento rewrite to use another CMS?

texts:
I am trying to find a way to load pages from another CMS into Magento. I was thinking of using a CMS page (maybe block page) that could get the content with PHP... And it would check the URL to see which page to load.

So how do I configure Magento rewrite so that every time a page is loaded it checks if the page exists in my other CMS if not it would return HTTP Not Found?

I am also thinking of using category for the link.


texts: Just out of curiosity. Is it possible hiding technology usage from website profiler, e.g: w3techs.com or builtwith.com? Information to be hidden such as Content Management System, Server Side Programming Language, Web Server. If possible, any negative influences? Thank you.


texts: Magento2 : Add new attribute set without Default attributes

texts:
I want to remove all the default attribute from my newly created product attribute set

My script is :

public function __construct(EavSetupFactory $eavSetupFactory, AttributeSetFactory $attributeSetFactory, CategorySetupFactory $categorySetupFactory)
{
    $this->eavSetupFactory = $eavSetupFactory;
    $this->attributeSetFactory = $attributeSetFactory;
    $this->categorySetupFactory = $categorySetupFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    // CREATE ATTRIBUTE SET
    $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);

    $attributeSet = $this->attributeSetFactory->create();
    $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
    $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
    $datas = [
        [
            'attribute_set_name' => 'Testing',
            'entity_type_id' => $entityTypeId,
            'sort_order' => 200,
        ]

    ];

    foreach ($datas as $data) {
        $attributeSet->setData($data);
        $attributeSet->validate();
        $attributeSet->save();
        $attributeSet->initFromSkeleton($attributeSetId);
        $attributeSet->save();
    }

    // CREATE PRODUCT ATTRIBUTE
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    // CREATE PRODUCT ATTRIBUTE
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'blockcontent',
        [
            'type' => 'text',
            'label' => 'Block Content',
            'input' => 'multiselect',
            'source' => \Test\ProductAttribute\Model\Product\Attribute\Source\Blockcontent::class,
            'frontend' => '',
            'required' => false,
            'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
            'sort_order' => '30',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'default' => null,
            'visible' => true,
            'user_defined' => true,
            'searchable' => true,
            'filterable' => true,
            'comparable' => true,
            'visible_on_front' => true,
            'unique' => false,

            'used_in_product_listing' => true,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'option' => ''
        ]
    );
    $eavSetup->addAttributeToGroup(
        \Magento\Catalog\Model\Product::ENTITY,
        'Testing',
        'General', // group
        'blockcontent'
    );

    $setup->endSetup();
}

}

Everything is working fine but in my custom attribute set all default attribute "name, description etc" also coming which i dont want.


texts: What event would I want to observe for when an order is set to 'complete' in the back end?


texts: Hide single attribute value under Layered navigation

texts:
please visit this link : http://hotwheelstoys.in/mobileapp/boys-toys.html

at the left side you can see "SHOP BY" , below that "CHARACTAR".

below dropdown values. here i want to hide the last dropdown "Hawkeye"

I dont want to delete it from backend. but i want to hide this.

if this attribute option have more than one ,than also i want to hide it. all i need is i want to hide one attribute option.

app/design/frontend/base/default/template/em_layerednavigation/filter/checkbox.phtml

    <?php if ($removeUrl = Mage::helper('layerednavigation')->getRemoveUrl($this->_filter)): ?>

    <a class="btn-remove" href="<?php echo $removeUrl ?>" title="<?php echo $this->__('Clear All') ?>"><?php echo $this->__('Clear All') ?>

<?php endif ?>

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

        <?php $inputId = $_item->getFilter()->getRequestVar().'_'.$_item->getValue() ?>
        <input type="checkbox" id="<?php echo $inputId ?>" name="<?php echo $_item->getFilter()->getRequestVar(); ?>" value="<?php echo $this->urlEscape($_item->getUrl(true)) ?>" <?php if ($_item->isSelected()):?>checked="checked"<?php endif ?> />
        <label for="<?php echo $inputId ?>"><?php echo $_item->getLabel() ?>
            <?php if ($this->shouldDisplayProductCount()): ?>
            (<?php echo $_item->getCount() ?>)
            <?php endif ?>

<?php endforeach ?>


texts: Sale tag not visible on configurable products

texts:
The first image is configurable, the 2nd one is a single image.
Now the sale tag is not visible on configurable products.

Can I fix this? And how.


texts: Add read_timeout to Mage_Cache_Backend_Redis

texts: Although not set by default, is it possible (or does it even make sense) to add a read_timeout value to the Mage_Cache_Backend_Redis section in full_page_cache?


texts: Add Custom Total to Cart's GrandTotal in Magento

texts: I'm trying to add an oversized fee for large products. Most of what that entails is a little more complicated than I want to explain here. Basically, I've built a custom function to check if the product is oversized and assign the appropriate shipping cost. However, I can't figure out how to get that value added into the grand total at check out.


texts:
I have a site running Magento 1.9.3 and I want to generate random reviews.
I don't need the content to be using target keywords or anything - I only need it for testing different layouts and design concepts.
Is there a tool or a script out there that can help me get this done?


texts: Programmatically Assign Customer Group for Selected Category Product Order

texts:
I want to assign a customer group for the customers, who have placed the order from selected category or particular products.

I have a category name grouper. In this category, I have some products with SKU names x1,x2 and x3.

I also have the Customer Group named same as product of this category. ie  x1,x2 and x3 and these products can only be purchased alone.

So when I purchased or place order x1 then the customer group for this customer should assign as x1. When the order is success the group should assign.

Any ideas?

Thanks in advance.


texts: How do you add item subtotal and grand totals to the packing slip pdf?

texts:
I'd like to list the item subtotal for the items, and then the grand total beneath - much like the invoice PDF does.
I'm failing to tackle both problems:

I've edited /app/code/local/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php from the invoice example but unfortunately $priceData['subtotal'] is zero.
It appears to me this is because that higher up the stack I need to be adding various calls but it feels wrong to be duplicating so much code when the invoice object has this info already.

Simply adding $this->insertTotals($page, $shipment); just lists zeros, presumably because the subTotals mentioned in -1- are zero.

Can someone help direct me to a solution please?


texts: How can I add custom product link in Magento 1?

texts:
Let's suppose I want to add a custom link to my product in M1, is there a way to do that? These products would be linked to an external site. I have two buttons on my website - Buy Now And Add to Cart. Buy now redirects customers directly to the checkout page.

I want this feature to function something like this:

If there is no custom URL entered in the backend, Magento should create product URL as it usually does and both buy now & add to cart button should appear.

If there is a custom product URL entered, Magento should use that link. ONLY 'buy now' button should appear in that case, and if customers click on buy now button, it should redirect them to the external website.

Here's the code in addtocart.phtml

<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>
<?php $buyNowTitle = $this->__('Buy Now'); ?>
<?php if($_product->isSaleable()): ?>

        <?php if(!$_product->isGrouped()): ?>
        <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
        <?php endif; ?>

        <a  title="<?php echo $buyNowTitle ?>" id="product-buynow-button" class="button btn-cart product-add-btn" onclick="productBuyNowForm.submit(this)"><?php echo $buyNowTitle ?>
        <button type="button" title="<?php echo $buttonTitle ?>" id="product-addtocart-button" class="button btn-cart product-add-btn" onclick="productAddToCartForm.submit(this)"><?php echo $buttonTitle ?></button>


texts:
I see this error in the firebug.

  "ReferenceError: $j is not defined"

I read that it is to do with jquery file.
I have following code in my theme in local.xml file.

    <default>
        <reference name="head">
            <!-- Link to external JavaScript file (e.g Jquery CDN)-->
            <block type="core/text" name="google.cdn.jquery">
                <action method="setText">
                     <text><![CDATA[<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script><script>window.jQuery||document.write('<script src="/skin/frontend/default/mytheme/js/jquery.min.js">\x3c/script>');</script><script>jQuery.noConflict();</script>]]></text>
                </action>
            </block>
            </reference>
            </default>

What is this error? How can I solve?


texts: How to install XDebug in Lampp to debug Magento?

texts:
I have installed xdebug from source in my system and add to my php.ini the following code at the end of the file:

/opt/lampp/etc/php.ini

[Xdebug]

zend_extension=”/usr/lib/php/20151012/xdebug.so”
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

I created a php file to see the state of the server:

phpinfo.php

<?php phpinfo(); ?>

After restart apache I have no information about xdebug running. I don't know what seems to be the error or what are missing.

I did: /opt/lampp/bin $ phpenmod xdebug And it created me a xdebug.ini in /etc/php/7.0/mods-available with

zend_extension=/usr/lib/php/20151012/xdebug.so

Instead of compiling over source xdebug I downloaded the working builds from ActiveState (the makers of the Komodo IDE) provide their pre-compiled binaries of xdebug they use in their IDE.
Just go to their site:
http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging
The packages contain builds for all php versions.
I copied xdebug.so to /opt/lampp/lib/php/extensions and changed my php.ini with the entry zend_extension=”zend_extension=/opt/lampp/lib/php/extensions/xdebug.so”
I changed also xdebug.ini with zend_extension=/opt/lampp/lib/php/extensions/xdebug.so
I restarted lampp and nothing seems to work for now.

When I run phpinfo.php with apache restarted I have no information about xdebug.


texts:
While Creating New Product Attribute ,
the error:

  Class Magento\SalesRule\Model\ResourceModel\Rule\CollectionFactory does not exist


texts:
the best way to create column in the editor is?
I try to create  with Bootstrap class but, it's not working...

Thanks


texts: Magento 2 Rest API getting "The signature is invalid. Verify and try again on some installations but works in postman

texts:
I have a small php script that fetch some product information from the Magento 2 Rest API.
The problem I am facing is that it works fine for some Magento 2 shops, but not others. For some shops I get
"The signature is invalid. Verify and try again."
But if I use the same credentials in Postman I get:

This is the script getting the products from Magento 2
$url = $_GET["url"];
$apiUrl = $url . 'rest/V1/products';
$consumerKey = $_GET["consumerKey"];
$consumerSecret = $_GET["consumerSecret"];
$accessToken = $_GET["accessToken"];
$accessTokenSecret = $_GET["accessTokenSecret"];
$searchurl = $apiUrl;
$method = 'GET';

function sign($method, $url, $data, $consumerSecret, $tokenSecret)
{
    $url = urlEncodeAsZend($url);
    $data = urlEncodeAsZend(http_build_query($data, '', '&'));
    $data = implode('&', [$method, $url, $data]);
    $secret = implode('&', [$consumerSecret, $tokenSecret]);

    return base64_encode(hash_hmac('sha1', $data, $secret, true));
}

function urlEncodeAsZend($value)
{
    $encoded = rawurlencode($value);
    $encoded = str_replace('%7E', '~', $encoded);
    return $encoded;
}

$search = [
    'searchCriteria[pageSize]' => 2,
    'searchCriteria[currentPage]' => 1,
];
ksort($search);
$data = array_merge([
    'oauth_consumer_key' => $consumerKey,
    'oauth_nonce' => md5(uniqid(rand(), true)),
    'oauth_signature_method' => 'HMAC-SHA1',
    'oauth_timestamp' => time(),
    'oauth_token' => $accessToken,
    'oauth_version' => '1.0',
],$search);

$data['oauth_signature'] = sign($method, $searchurl, $data, $consumerSecret, $accessTokenSecret);

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => $searchurl . '?' . http_build_query($search),
    CURLOPT_HTTPHEADER => [
        'Authorization: OAuth ' . http_build_query($data, '', ',')
    ]
]);
$result = curl_exec($curl);
curl_close($curl);

Can anyone give me a clue as to why this happens?


texts: Remove Print Receipt from thank you page

texts: Please check the Screenshot below. I want to remove Print receipt title from thank you purchase page, this page appears after placing a successful order.


texts: How to enable ajax for adding to cart up-sell, cross-sell and related products in Magento 2.3.6?

texts:
I have enabled "add to cart" button for my up-sell, cross-sell and related products.
Now work all fine, but clicking on the button reloads the page. How can i enable ajax for this?
Magento Version 2.3.6


texts:
If we include CSS in layout XML as below, Magento includes it after style-l.css and style-m.css.

<css src="Magento_Theme::css/home/custom.css" media="all" />

But if we include CSS as below then Magento includes it before style-l.css and style-m.css. So what is the reason for the same ?

<css src="Magento_Theme::css/home/custom.css" />


texts: magento2 theme development process step by step

texts:
How to create replicate theme of luma ?

I have register theme successfully. and see css files come from public/static/frontend/My Namespace.after googling get its like front-end cache.

How can i modify css file and how can override phtml file ?

Can Any one explain how can i create theme in magento 2 ? What is the structure for that ?


texts: Magento 2 order email converting the special characters into symbols

texts:
Magento 2 order emails converting the special charactesrs ä,ü,ö  into symbols like ", ?
example: when I enter the name in checkout like Präsad Prasüd Prasadö and converted in the email is Pr?sad Pras?d Prasad?
can anyone please suggest how to resolve it.


texts: How to get category image based on category ID?

texts:
I am trying to get an image which is uploaded for the category.

& also

I have category id and want to load complete details of that category based on category ID.

How can I achieve this?


texts:
so I am setting up some daily offers on my Magento site, and I would like my front page banner to always redirect to the daily offer.
Is there a way to set a redirect(or something similar) up, so that every day the redirect link changes to my specefic chosen product?

This is for december, so each day there would be a new offer.

Thank you


texts: Magento 2 - get special price of product by product id or sku

texts:
I need to get the special price of a product by product Id or Sku. Let's say I have an existing product with Id '21' and Sku 'test-21'.

This information is provided in my custom block class, how can I get the special price of this product in mentioned custom class?


texts: Magento 2: Blank page that I can fill up

texts:
As i am trying to get my head around Magento 2 i'm trying to start to create a module. (to learn from it)

This module needs a frontend blank page that i can fill up myself.
I got it to output my main.phtml and the page also is routed good.
It works even perfectly if i would use the layout of the current theme.

But i'm trying not to get the theme layout and in order to not do that i use this in my index.php :

class Index extends Action
{
    protected $resultPageFactory;
    protected $resultPageLayout;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        $resultPageLayout = $this->resultPageFactory->create();
        $resultPageLayout->getLayout()->getUpdate()->removeHandle('default');
        return $resultPageLayout;
    }

I do get a blank page now. I'm guessing that the removeHandle('default'); just strips away all Handles and therefor leaving me with a blank page.

The problem :

It does not output my main.phtml anymore (which is a simple hello world.). I does get to my frontend/layout XML because the title of the webpage (which is defined in layout XML) is still the same.

I'm trying to figure it out. Hoping you guys can help me!


texts: Magento 2.2.5 google-analytics code not show Frontend

texts: We have installed Lastest Magento Version 2.2.5 and Also add google analytics id but not show on frontend


texts: Security patch 5344 unknown after changing admin url

texts: The status of my Security patch 5344 (Shoplift) is unknown on MageReport.com after changing Magento admin url. Is this normal or should I change it back?


texts: How do I create a shopping cart rule for A SET of products

texts:
I run an online delivery restaurant. I want to create a shopping car rule (or several rules, nevermind) generating the following discounts:

If you buy 1 starter + 1 main course + 1 desert, you get a $5 discount;
If you either buy 1 starter + 1 main course or 1 main course + 1 desert, you get a $3 discount.

Please note that "Starters", "Main courses" and "Deserts" are categories in my store. So if you have the following cart:

3 starters
3 main courses
2 deserts
1 bottle of wine

I want you to get a total discount of $13, i.e. $5 for each 3-courses menu + $3 for the 2-courses menu. (The "Wine" category is not included in the rule and does not generate any discount.)

I have searched everywhere without getting a satisfying answer. The closest ones I have found were these 2, but they did not solve all the problems:

Is this coupon possible? Get fixed amount off for each 5 items from a specific category [2nd answer]
Cart/Catalog Price rule for a set of products only

Thanks a lot for your help!


texts:
When I apply a coupon code on cart page and then submit it automatically, the customer is redirected to home page and show success message in home page only.

How to avoid the redirect, stay on the same page and show the success message on the cart page?

<form id="discount-coupon-form" action="<?php echo $this->getUrl('checkout/cart/couponPost') ?>" method="post">

           <input type="hidden" name="remove" id="remove-coupone" value="0" />

                <input class="input-text" id="coupon_code" name="coupon_code" value="<?php echo $this->escapeHtml($this->getCouponCode()) ?>" placeholder="Enter Your Coupen code if you have...." />

                <button type="button" title="<?php echo $this->__('Apply Coupon') ?>" class="button" onclick="discountForm.submit(false)" value="<?php echo $this->__('Apply Coupon') ?>"><?php echo $this->__('Apply Coupon') ?></button>
                <?php if(strlen($this->getCouponCode())): ?>
                    &nbsp; <button type="button" title="<?php echo $this->__('Cancel Coupon') ?>" class="button" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel Coupon') ?>"><?php echo $this->__('Cancel Coupon') ?></button>
                <?php endif;?>

</form>


texts: Cart price rule on bundle with different manufacturer

texts:
I'm trying to configure a cart price rule for a bundle product that consist of 2 items from different manufacturer. One of the item must remain full price and the other one must be discounted.
If I set manufacturer (base, child or parent) is not XYZ manufacturer.
It will apply the code to both items.
If I don't select the sale item and only ad the other option to cart, the rule doesn't apply.
Looks like the same happens if I try to use the skus.
Item A 0% (manufacturer A)
Item B 20% (manufacturer B)
If I add both to cart: 20% off both
If i add just item A: 0%
Anything I am missing?
Thanks!
Emili


texts: How do I perform keyword searches via REST?

texts:
Does Magento support keyword searches via REST or must it be extended to do so?

I'm very new to Magento, and have been tasked with developing an extension that needs to perform product searches via AJAX requests.

Magento is running and sample data has been imported, the REST endpoints are working but I can't seem to find the correct parameter that performs a search. I've tried something like this but the query params are ignored:

<myhost>/api/rest/products?q=shirt

Data is being returned, but there's absolutely no filtering being applied at all. I've tried other parameters as well but with the same results.

Searching for a solution on the issue through the various Magento wikis and SE threads haven't yielded anything helpful. Any guidance would be appreciated.


texts: Add free gift for each 3 of a product in a particular category

texts:
I have a requirement for the following: "For every time a user adds 3 of a particular product from a certain category they should get a defined free gift automatically added"

So if a customer adds 10 of this product then they should receive 3 X Free Gift

I've taken a look at the extensions out there but they don't really seem to be overly clear at what they are offering. My question is, does anyone know how to achieve the outcome either manually or via an extension?

Thanks in advance


texts: Magento 2 Shipping method additional section reload

texts:
I want to display a custom message in shipping method section. The message is displayed based on the country and cart weight.

I have created a custom block in shipping method section. Now it is displayed only for logged in customers.

I want to reload the message section when the country changed. How can I do it?
Here is my code

Namespace/Module/view/frontend/web/template/checkout/shipping/shipmessage-block.html

Namespace/Module/Model/ShipmessageConfigProvider.php

 public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfiguration,
        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $date,
        \Magento\Framework\ObjectManagerInterface $objectmanager,
        \Magento\Quote\Model\Quote $quote,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Framework\Serialize\Serializer\Json $serialize
    ) {
        $this->scopeConfiguration = $scopeConfiguration;
        $this->cart = $cart;
        $this->_objectManager = $objectmanager;
        $this->quote = $quote;
        $this->date = $date;
        $this->_checkoutSession = $checkoutSession;
        $this->serialize = $serialize;
    }
    /**
     * @return array() $showHide
     */
    public function getConfig()
    {

        $shipMessage = [];
        $shipMessage['ship_message'] = $this->getShipMessage();
        return $shipMessage;
    }

    public function getShipMessage()
    {

        $quote = $this->_checkoutSession->getQuote();
        $countryId = $quote->getShippingAddress()->getCountryId();
        $items = $quote->getAllItems();
        $cartWeight = 0;
        foreach($items as $item) {
            $cartWeight += ($item->getWeight() * $item->getQty()) ;
        }
        $message ="Cart Weight is " .$cartWeight;
        return $message;
    }

Namespace/Module/view/frontend/web/js/view/checkout/shipping/shipmessage-block.js

define([
    'ko',
    'jquery',
    'Magento_Checkout/js/model/quote',
    'uiComponent'

], function (ko, $, quote, Component) {
    'use strict';
    var shipMessage = window.checkoutConfig.ship_message;
    return Component.extend({
        defaults: {
            template: 'Namespace_Module/checkout/shipping/shipmessage-block'
        },
        isMessage: function () {
                if(shipMessage != ""){
                  return 1;
                } else {
                  return 0;
                }
         },
        getMessage: function() {
            return shipMessage;
        }
    });
});


texts:
I need to logout a user after successful registration to login page.

I tried to redirect the user after registration by creating a observer customer_register_success but it dint work, When the observer is called the loggin action is not triggered so I added a redirection that  will solve my problem but dint. its working as usual.

public function execute(Observer $observer)
{
      $this->messageManager->addErrorMessage(__('Your account is not approved.'));
      $this->_response->setRedirect($this->_urlFactory->create()->getUrl('customer/account/login'));

}

I tried with this link belo but it only works with login page and not in registration process.

  Magento 2: Get Customer data after login with observer

How do I Logout the user.


texts: How to give custom option date a default value

texts:
I have a custom product option: date of birth. This date is usually the customers dob so I'd like it to be the default value of the custom option field.

In the date.phtml file getDateHtml function is called: <?php echo $this->getDateHtml(); ?>

The function creates the date field. I know how to get dob of the logged in customer but how do I pass it on to the getDateHtml function?

It does check for preconfigured values but i can't set one in custom product options.

Help anyone?


texts: Item description not visible in sales email

texts:
I'm trying to print the description for each product in the items table of the sales email.
Based on the file, it looks like it should be doing this already:
In module-sale/view/frontend/templates/email/items/order/default.phtml we have this line:
<?= $block->escapeHtml($_item->getDescription()) ?>
Is there any reason this wouldn't be rendering?


texts: Component Manager Readiness Check Errors

texts:
When trying to install any extension in component manager, I end up with a bunch of errors during the readiness check. My biggest issue is:"Your PHP version is . The required PHP version is ."

My php version is 5.6.32 on both CLI and Server. I'm running magento 2.1.10 community.

I've tried the "disable-tls":false in my composer file.

More info: I'm on a shared server, meaning I'm limited on my php config. I can change the server php.ini, but not CLI. I'm locked at 128mb on CLI. Which adds all sorts of challenges.

Any advise would be greatly appreciated.

Update Edit:

Looks like my php problem was because I didn't have the cron setup correctly. I had to add both of these cron jobs pointing to my php.ini(since I can't edit the cli php.ini being a shared server):

/usr/bin/php -c /home3/user/public_html/php.ini /home3/user/public_html/magento2/bin/magento setup:cron:run >> /home3/user/public_html/magento2/var/log/setup.cron.log

/usr/bin/php -c /home3/user/public_html/php.ini /home3/user/public_html/magento2/update/cron.php >> /home3/user/public_html/magento2/var/log/update.cron.log

In that php.ini I've changed the memory_limit to be 2G. And then ran the following commands
php bin/magento cron:run
php update/cron.php
php bin/magento setup:cron:run

This solved all my issues but one:

Any advise on this one?


texts: Make the same multiple tab work separately in form Magento 2

texts:
$fieldset->addField('media_gallery', 'note',
        [
            'label' => '',
            'title' => __('Media Gallery'),
            'name'  => 'media_gallery',
            // 'required' => true,
            'text'      => $this->getContentHtml(),
        ]
    );

I have a tab like this. how can I duplicate it in a custom module? and
Make these 2 tabs work separately. please help me. thank you.


texts:
I have used this function for many 1.x projects and hoped that it would work in 2.x too but looks like I need to add more stuff to what should be a somewhat simple operation.

For some unknown reason after pushing "Update Shopping Cart" and reloading page item price and subtotal (yes, only those two) doesn't change to new ones. I have different prices for configurable product options so price must be updated. Dropdown option for product after refresh is set to new one and Totals are reloaded to new prices too. DB shows that data saved properly.

After hitting that "Update Shopping Cart" button again, new price shows up. So it is saved but doesn't show after first reload.

Magento: Blank theme, v2.1, cache disabled, developer mode.

Code that I use:

Event:

<event name="checkout_cart_update_items_before">
    <observer name="my_checkout_cart_update" instance="Company\Module\Observer\Cartupdate" /></event>

Function:

protected $_cart;
protected $_configurable;

public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectManager,
    \Magento\Framework\Event\ObserverFactory $observerFactory,
    \Magento\Checkout\Model\Cart $cart,
    \Magento\ConfigurableProduct\Model\Product\Type\Configurable $config
) {
    $this->_objectManager = $objectManager;
    $this->_cart = $cart;
    $this->_observerFactory = $observerFactory;
    $this->_configurable = $config;
}

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $cart = $this->_cart;
    $data = $observer->getEvent()->getInfo()->toArray();

    foreach ($data as $itemId => $itemInfo)
    {
        $item = $cart->getQuote()->getItemById($itemId);

        if (!$item)
            continue;

        if (!isset($itemInfo['option']) or empty($itemInfo['option']))
            continue;

        if ($item->getProduct()->getTypeId() == 'configurable')
        {
            $options = $item->getOptions();

            $newId = $this->_configurable->getProductByAttributes($itemInfo['option'],$item->getProduct())->getId();

            foreach ($options as $option)
            {
                if ($option->getCode() == 'info_buyRequest')
                {
                    $unserialized = unserialize($option->getValue());
                    $unserialized['super_attribute'] = $itemInfo['option'];
                    $unserialized['selected_configurable_option'] = $newId;
                    $option->setValue(serialize($unserialized));
                }
                elseif ($option->getCode() == 'attributes')
                {
                    $option->setValue(serialize($itemInfo['option']));
                }
                elseif (substr($option->getCode(), 0,11) == 'product_qty')
                {
                    $option->setProductId($newId);
                    $option->setCode('product_qty_'.$newId);
                }
                elseif (substr($option->getCode(), 0,14) == 'simple_product')
                {
                    $option->setProductId($newId);
                    $option->setValue($newId);
                }
                $option->save();
            }
            $item->setOptions($options)->save();
        }
    }
    $cart->save();
}


texts: French language pack with email templates for 1.9

texts:
I am looking for a recent language pack for Magento 1.9 with the email template files.

I came across this: https://github.com/versedi/Magento-Locales which is a collection of translations from the old Magento site. It has French translations but not the email templates.

There is also this one: https://www.magentocommerce.com/magento-connect/french-france-language-pack-for-magento-traduction-francaise.html Which is for 1.7 so it doesn't have the newest template files needed for 1.9.

Anyone who does know where to get it?


texts: Error in custom option file upload on magento 2.3.x

texts:
A few weeks ago some clients were uploading pdf files, and when they added to the cart, showed them an error the file is invalid,this is a lie, because it was upload a file with pdf extension.

here a one image show the js file

and this is the error what magento show me

so what i do for fix this error


texts:
I am using pcarousel extension in AccessShop theme for my store.

I am going to use multiple carousels for categories on homepage.

How to show category name in category carousels for home page?


texts: Modules/Extensions installed via Composer Problem

texts:
I've installed Magento 1.9.3 locally on my computer and then installed a couple of extensions via composer.

Modules/Extensions are Fontis Australia Post and Better404

They seem to have installed OK, I can see them in the folders and in admin/System/Advanced/Modules Output.

BUT I cannot see them anywhere else in admin to enable them.


texts: Save Product with value from database // ProductName + DB-Value

texts:
I am a Beginner. It was a challenge to code the module. But here I just can not get on. I hope someone can help me please.

The output of my module is working on view.phtml:

 <?php $custominput =  Mage::getStoreConfig('my_section/mygroup/my_field')?>

<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

<?php echo $custominput ;?>

I need the $custominput inside the function/model/controller where the productname is added in backend. When saving the product name, the word from the database should be added directly.

'Productname' + 'custominput' -> SAVE = Productname custominput

'Productname custominput' + 'custominput' -> SAVE = Productname custominput custominput

Thanks -> god bless you ;)


texts: How to get Subscriber based on from date in Magento 1.9?

texts:
I am able to get all subscriber but there is no date filter in Magento for subscribers.

Can anyone tell me how to get subscriber based on date in magento?


texts: Magento 2 : How to use objectManager class object?

texts:
I am little bit confuse, how to use object manager.
I have checked this answer but not getting satisfied answer.

Always we are recommending that never use objectManager like \Magento\Framework\App\ObjectManager::getInstance().

Instead of use this :

public function __construct(
   ...
   \Magento\Framework\ObjectManagerInterface $objectmanager,
   ...
)
{
   ...
   $this->_objectManager = $objectmanager;
   ...
}

But when we are using this in any plugin file or any custom module file, we are getting error or its not working. But in case of direct method we are getting solution.

Is there any proper definition, where we have to use direct method of objectManager and where we have to use ObjectManagerInterface ?

Actually when I am trying to get objectManager object in my custom module file I am getting some error and its not working. and with the help of direct method getting proper solution.


texts: Magento 2 Update SID on all store in multistore setup

texts:
I have two stores in magento 2, one store has store code "abc" points to domain "www.abc.com" and other store has store code "xyz" points to domain "www.xyz.com".

When I set Add store code to url option to Yes. My both store working fine. Both store cart and account sharing worked. but I don't want to use store code in url for SEO purpose, and when I set Add store code to url option to No. Cart and account sharing stop to work.

When I logout from one store, I still login in other store. I checked SID in both store. Both store has different SID.

I added following code in index.php

if($_SERVER['SERVER_NAME'] == 'www.abc.com') {
$my_param_run_code = 'abc';
}

else {
$my_param_run_code = 'xyz';
}

$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] =
$my_param_run_code;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

also I added following in top of .htaccess file

SetEnvIf Host abc.com MAGE_RUN_CODE=abc
SetEnvIf Host abc.com MAGE_RUN_TYPE=store
SetEnvIf Host ^abc.com MAGE_RUN_CODE=abc
SetEnvIf Host ^abc.com MAGE_RUN_TYPE=store

SetEnvIf Host xyz.com MAGE_RUN_CODE=xyz
SetEnvIf Host xyz.com MAGE_RUN_TYPE=store
SetEnvIf Host ^xyz.com MAGE_RUN_CODE=xyz
SetEnvIf Host ^xyz.com MAGE_RUN_TYPE=store

Where I am wrong in setting of multistore, I want cart and account sharing on both store without using Add store code to url option and also without using store switcher. I want my both store use same SID, when SID update on one store, it automatically update on other store as well.


texts: backend: get custom options from invoice

texts:
I am working on the backend invoice template.

In adminhtml (sales/order/invoice/view/items.phtml), the item list is performed with :

<?php $_items = $this->getInvoice()->getAllItems() ?>
<?php $i=0;foreach ($_items as $_item): ?>
    <?php echo $this->getItemHtml($_item) ?>
    <?php echo $this->getItemExtraInfoHtml($_item->getOrderItem()) ?>
<?php endforeach; ?>

I would like to be able to access items custom options inside that loop.

I tried several things :

$_item->getOptions();
$_item->getProductOptions();
$_item->getItemOptions();
$_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());

but none is working…

Thank you for your help,


texts: How to Validate Comma Seprated Values in Admin Configuration

texts:
I want to Add Validation of Comma Separated Values in Admin Configurations

I Know How to Add Custom Validation Using Js is just need the Regex (Regular Expression)


texts: Magento Saleable quantity not reflecting

texts:
Here is an interesting one.
All the id numbers were created at the same time but the highlighted ones have both been disabled so should have a '0' for saleable quantity?
The one highlighted at the top does and is not showing on the frontend, but the one at bottom does not so is still showing as available on the frontend.

Any thoughts magento guru's?


texts: Is it possible to configure the recently viewed products widget to show the products that all visitors have recently viewed? The regular widget only shows the products which you have viewed yourself.


texts:
Here is what I do (simple):

$quoteB = Mage::getModel('sales/quote')->load(1234);
$currentQuote = Mage::getModel('checkout/cart')->getQuote();
$currentQuote->merge($quoteB);
$currentQuote->assignCustomer(Mage::getSingleton('customer/session')->getCustomer());
$currentQuote->collectTotals()->save();

I basically merge a given quote (1234) into the current Quote so as the cart is updated with the information I want.

What I can't manage to do, is find some way to retrieve $quoteB's ID from the $currentQuote

I could obviously add a field to sales_flat_quote and store the quotes which are merged into said field, but I'm looking for a native way for Magento to do it, if such method exists.


texts: Observing Magento 2 events in JavaScript

texts:
Magento 2 emmits a catalog_product_compare_add_product event whenever you add a product to the comparison list, which ultimately renders a "You added product %1 to the comparison list." message block.

How would you set up an observer in JavaScript that executes a JavaScript function whenever this event is emmitted? I'm aware you can do this by overriding \Magento\Catalog\Controller\Product\Compare\Add, but I would prefer not doing this if there's another way that doesn't involve overriding a core controller.

UPDATE:

I noticed this code in vendor/module-catalog/view/frontend/templates/product/compare/link.phtml:

    <a class="action compare no-display" title="<?php /* @escapeNotVerified */ echo __('Compare Products') ?>"
       data-bind="attr: {'href': compareProducts().listUrl}, css: {'no-display': !compareProducts().count}"
    >
        <?php /* @escapeNotVerified */ echo __('Compare Products') ?>

Since a "Compare Products n items" link will always be rendered whenever you add something to the comparison list, I guess the better question would be, how do I monitor this
 via KnockoutJS so that I can execute my own JavaScript whenever the link is inserted into the
 (without using a generic DOM mutation observer)?

UPDATE 2:

For now I have come up with a simple solution using KnockoutJS's containerless control flow that I'm somewhat satisfied with:

    <a class="action compare no-display" title="<?php /* @escapeNotVerified */ echo __('Compare Products') ?>"
       data-bind="attr: {'href': compareProducts().listUrl}, css: {'no-display': !compareProducts().count}"
    >
        <?php /* @escapeNotVerified */ echo __('Compare Products') ?>
        ()

The reason I'm not 100% satisfied is because I have to rely on setInterval() (and clearInterval() to implement a timeout) to detect when the message block is displayed. If someone can come up with a solution using a true event handler in JavaScript/KnockoutJS that is only triggered when a product is added to the comparison list, then I will accept that as the answer.


texts: How can i solve the error : Fatal error: Uncaught exception for removing duplicate images

texts: I am try to delete duplicate images using this source link


texts:
My problem is that i uploaded an image in the cms/banner/layout and it did not show on the homepage. This is the design from the homepage:

<reference name="content">
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
       <action method="addPriceBlockType">
             <type>bundle</type>
             <block>bundle/catalog_product_price</block>
             <template>bundle/catalog/product/price.phtml</template>
       </action>
       <action method="setColumnCount"><columns>4</columns></action>
       <action method="setProductsCount"><count>6</count></action>
</block>
</reference>

This is what is the generated html:

    test

What am i missing ?

This is the code which generates the html:

<?php

    $banner = $this->getBanner();

    if ((int)$banner->getId()):
        $width = ((int)$banner->getWidth()) ? $banner->getWidth() : '' ;
        $height = ((int)$banner->getHeight()) ? $banner->getHeight() : '' ;
    ?>

    <a class="sama_banners_container" style="background-image:url('<?php echo $this->helper('sama_imageresize/image')->run($banner->getImage())->resize($width);?>');
        height:<?php echo $height?>px;" href="<?php echo $banner->getVar3();?>">

        <?php echo $banner->getDescription();?>

    <?php endif;?>

This is the block parts:

<block type="core/template" name="top_banners" before="-" template="homepage/topbanners.phtml">
                <block type="sama_banners/banner" name="homepage_banner" before="-" template="sama_banners/banner.phtml">
                    <action method="setIdentifier"><id>homepage_large</id></action>
                </block>
                <block type="sama_banners/banner" name="homepage_small_1" before="-" template="sama_banners/banner.phtml">
                    <action method="setIdentifier"><id>homepage_small_1</id></action>
                </block>
                <block type="sama_banners/banner" name="homepage_small_2" before="-" template="sama_banners/banner.phtml">
                    <action method="setIdentifier"><id>homepage_small_2</id></action>
                </block>
                <block type="sama_banners/banner" name="homepage_small_3" before="-" template="sama_banners/banner.phtml">
                    <action method="setIdentifier"><id>homepage_small_3</id></action>
                </block>
            </block>


texts: How to set products in stock after import

texts:
I managed to create a module to update the product set to in stock when an import is done.

The only problem I see now is that the cache is invalidated afterwards and I also need to update the cache after reindexing the site.

This is my code for the modules app/etc/modules/Myweb_Stockin.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Myweb_Stockin>
            <active>true</active>
            <codePool>local</codePool>
        </Myweb_Stockin>
    </modules>
</config>

This is my code for the config app/code/local/Myweb/Stockin/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Myweb_Stockin>
            <version>0.0.1</version>
        </Myweb_Stockin>
    </modules>
    <adminhtml>
        <models>
            <mywebstockin>
                <class>Stockin_Model</class>
            </mywebstockin>
        </models>
        <events>
            <catalog_product_import_finish_before>
                <observers>
                    <stockin>
                        <type>model</type>
                        <class>Myweb_Stockin_Model_Observer</class>
                        <method>product_save_after</method>
                    </stockin>
                </observers>
            </catalog_product_import_finish_before>
        </events>
    </adminhtml>
</config>

This is my code for the observer app/code/local/Myweb/Stockin/Model/Observer.php which is from this page: https://stackoverflow.com/questions/7168295/magento-auto-changing-the-stock-availability-from-out-of-stock-to-in-stock

<?php
    class Myweb_Stockin_Model_Observer {
        public function product_save_after($observer) {
            $collection = Mage::getResourceModel('cataloginventory/stock_item_collection');
            $outQty = Mage::getStoreConfig('cataloginventory/item/options_min_qty');
            $collection->addFieldToFilter('qty', array('gt' => $outQty));
            $collection->addFieldToFilter('is_in_stock', 0);
            foreach($collection as $item) {
                $item->setData('is_in_stock', 1);
            }
            $collection->save();
        }
    }
?>

I need to know if there is something wrong with this code.

I am at a loss trying to find out where the invalidated cache is coming from.


texts: Css and js not working after transfered site to new server Magento2

texts: I have moved my magento to new dedicated server ,css and js not working. Also have done static deploy,Can anyone help me to fix this issue


texts: Magento add product to wishlist in REST Api

texts:
I am trying to add product to wishlist with below script in custom REST API  its not working, but this below script is working at controller and magento root folder

        $wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer('67', true);
        $product = Mage::getModel('catalog/product')->load('214');

        $buyRequest = new Varien_Object(array());

        $result = $wishlist->addNewItem($product, $buyRequest);
        $wishlist->save();


texts: Magento 2.3 Multi websites + Customer attributes

texts:
My client has multi website in Magento2. (ex. Site A and Site B)

Now, I have to create customer attribute for both website but value of both sites attributes are different.

For Site A customer attribute value like (A,B,C)

and For Site B Customer attribute value like (P,Q,R).

Does anyone know how to achive this?


texts: Does anyone know if there is a way to issue store credit? Can we give someone $100 store credit and then they order $50 in product on one day and next month they order another $50 in product...


texts: how to retrieve attributes based on each other

texts: I have products with three attributes and I need to retrieve attributes based on each other. like for example if I have car make, car model and year of production and I need to first retrieve car make then for specific make I retrieve car model and for both make and model retrieve year of production. how to do do


texts: Is changing the theme will affect the extensions in magento2?

texts:
Today i had purchased the new theme for my store. I want to change the theme but i'm afraid on my extensions will had a problem or not.

I'm a beginner in magento2. Also, currently my store magento version is 2.2.2 and i want to upgrade the store to 2.2.6(latest version). Please anyone clear my doubts in detail. Thanks in advance.


texts: CMS pages which are include differenent static blocks are showing the all the same block

texts:
Because I wanted to include shipping and return texts in different CMS pages in a magento website, I used static blocks and was adding the following code so i don't have to make edits in all of them but just the one block.

{{block type="cms/block" block_id="block_product_tab_shipping"}}
{{block type="cms/block" block_id="block_product_tab_returns"}}

Everything was working fine but with the latest magento updates i noticed that all those pages are now showing the same block. Even if i use different ones...

Every page are now show the shipping block. I noticed that after disabling cache everything worked fine.

Its weird because all the cms pages of a footer column is showing the same block, the other column is showing another block :S

Magento changed the way that those blocks are now cached?

Can i exclude only those blocks from cache to resolve the issue?

Do you have any other suggestion?


texts: Magento 2: How to get product type in observer?

texts:
I have below code.

namespace Custom\Module\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;

class TestObserver implements ObserverInterface {

    protected $_logger;

    public function __construct(\Psr\Log\LoggerInterface $logger) {
        $this->_logger = $logger;
    }

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

         foreach ($order->getAllItems() as $item) {
            $this->_logger->info('Item ID: ' . $item->getProductId());
        }
        exit;

        return $this;
    }
}

How to get product type? What are the all options for getAllItems?


texts: Magento 2 - How to create custom grid menu in admin?

texts:
I want to create a grid menu in the admin panel. I'm stuck at creating layout using components. I have some records in a table. Now how can I display it in the admin grid?

The following is the code that I now used.

I created Hiren/Employee/etc/module.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Hiren_Employee" setup_version="0.0.1"/>
</config>

I created **Hiren/Employee/etc/adminhtml/routes.xml*:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
    <route id="employee" frontName="employee">
        <module name="Hiren_Employee"/>
    </route>
</router>
</config>

I created Hiren/Employee/etc/adminhtml/menu.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
    <add id="Hiren_Employee::EmpManage" title="Manage Employee" module="Hiren_Employee" sortOrder="51" resource="Hiren_Employee::EmpManage"/>
    <add id="Hiren_Employee::viewData" title="View" module="Hiren_GridMenu" sortOrder="10" action="employee/view" resource="Hiren_Employee::viewData" parent="Hiren_Employee::EmpManage"/>
</menu>
</config>

I created Hiren/Employee/Setup/InstallSchema.php:

<?php

namespace Hiren\Employee\Setup;

class InstallSchema implements \Magento\Framework\Setup\InstallSchemaInterface
{
    public function install(\Magento\Framework\Setup\SchemaSetupInterface $setup, \Magento\Framework\Setup\ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();
        if (!$installer->tableExists('emp_table'))
        {
            $table = $installer->getConnection()->newTable($installer->getTable('emp_table'))
            ->addColumn('no', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], 'no')
            ->addColumn('name', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 255, ['nullable => false'], 'Name')
            ->addColumn('city', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 255, [], 'city')->setComment('Employee Table');

            $installer->getConnection()->createTable($table);
            $installer->getConnection()->addIndex($installer->getTable('emp_table'), $setup->getIdxName($installer->getTable('emp_table'), ['no', 'name', 'city'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_FULLTEXT), ['no', 'name', 'city'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_FULLTEXT);
        }
        $installer->endSetup();
    }
}

I created Hiren/Employee/Controller/Adminhtml/view/Index.php:

<?php

namespace Hiren\Employee\Controller\Adminhtml\view;

class Index extends \Magento\Backend\App\Action
{
    protected $resultPageFactory = false;

    public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
    {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
    }

    public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->prepend((__('VIEW')));
        return $resultPage;
    }
}


texts: Magento 2 Commerce Question : What is the use of MAGEID and TOKEN in Magento 2 Commerce and How we can use it installing the extension

texts:
I am new to Magento Commerce 2.3.4 and need to understand the use of MAGEID and TOKEN generated by the Magento account. I have the MAGEID and TOKEN but I don't know how and where to update this token in Magento file/database.

Also how I can use the TOKEN while installing any extension or downloading a release?


texts:
I am making a module that adds a button to the Admin order view and allows the user to create a shipment and invoice (among others) once this button is clicked.

I have used an observer to add the button and get the current order_id. I also used setLocation to the onclick parameter of the button.

However, when I press the button, I am presented with a 404 page. I am not sure if the problem is my controller, setLocation url or somthing else. Here is my config.xml:

<?xml version="1.0"?>
<config>
<modules>
    <ID_AcsCourier>
        <version>0.1.0</version>
    </ID_AcsCourier>
</modules>

<frontend>
    <routers>
        <acscourier>
            <use>standard</use>
            <args>
                <module>ID_AcsCourier</module>
                <frontName>acscourier</frontName>
            </args>
        </acscourier>
    </routers>
</frontend>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <id_acscourier before="Mage_Adminhtml">ID_AcsCourier_Adminhtml</id_acscourier>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

<global>
    <events>
        <adminhtml_widget_container_html_before>
            <observers>
                <acscourier>
                    <class>ID_AcsCourier_Model_Observer</class>
                    <method>addButtonVoucher</method>
                </acscourier>
            </observers>
        </adminhtml_widget_container_html_before>
    </events>

    <helpers>
        <acscourier>
            <class>ID_AcsCourier_Helper</class>
        </acscourier>
    </helpers>
</global>
</config>

And this is the button onclick from my observer:.

'onclick'   => 'setLocation(\' '  . Mage::helper('adminhtml')->getUrl('*/acscourier/index', array('order' => $order['order_id'])) . '\')',

My controller (AcsCourierController.php) is under controllers/Adminhtml and begins like this:

class ID_AcsCourier_Adminhtml_AcsCourierController extends Mage_Adminhtml_Controller_Action
{

    public function indexAction() {
        echo "Hello World";
        exit;
    }

}

Again, this module is not supposed to produce any output. Once it completes, it will just redirect back to the order page and (hopefully) present a message. But in order to get there, I first need to sort the 404 thing...

Any help is greatly appreciated...


texts: I have created simple products and then I have create configurable product now when I am checking the associated product tab its showing blank, no products are visible.


texts: Automatically cancel magento 2 pending orders after a specified amount of time?

texts: We found that we sometimes run out of stock/inventory due to orders pending payment. Is there a way to "release" those stock/inventory after a specified amount of time, automatically, without us having to check regularly for orders pending payment and cancelling manually?


texts: Magento 2 how to write in data-mage-init

texts:
Magento uses below way to show Requistition list using "x-magento-init".

<div class="block block-requisition-list social-button" data-bind="scope: 'requisition_ - 111'">
<!-- ko template: getTemplate() --><!-- /ko -->
</div>

<script type="text/x-magento-init">
{
    "*": {
        "Magento_Ui/js/core/app": {
            "components": {
                "requisition_ - 111": {
                    "component": "Magento_RequisitionList/js/requisition/action/product/view/add",
                    "editModuleName": "requisition_ - 111.edit",
                    "title": "Add to Requistition List",
                    "action": "http://URL.com/requisition_list/item/add/",
                    "sku": "TEST",
                    "productFormSelector": "#product_addtocart_form122"
                },
                "requisition_ - 111.edit": {
                    "component": "Magento_RequisitionList/js/requisition/list/edit",
                    "modal": "add_to_requisition_popup",
                    "saveUrl": "http://URL.com/rest/V1/requisition_lists/"
                }
            }
        }
    }
}
</script>

Due to some limitations I can not use in this way, I searched that same can also be achieved using "data-mage-init" as well.

But not getting how can I rewrite same using "data-mage-init".

Any idea ?? ?


texts: Magento 2: 404 Page while accessing cron.php

texts:
I'm using Magento 2 CE.

We have cron.php in \update\cron.php. Not on Magento Root Folder.
I have tried both with URL, both leads to me 404 page.

Example:

http://doamin.com/cron.php
http://doamin.com/update/cron.php

404error while running cronjob in magento

There is no entry in cron_schedule table.


texts: Magento 2 - Extend onepage.phtml to add custom JS

texts:
Magento 2

I have created a custom shipping method module and need to add custom JS to the checkout page where the shipping address and shipping method is set. But it is not working for me.

I have added my own onepage.phtml in the following location :

My_Module\view\frontend\templates\onepage.phtml

I also created a checkout_index_index.xml file in the following location :

My_Module\view\frontend\layout\checkout_index_index.xml

The location of my JS :

My_Module\view\frontend\web\js\custom.js

The contents of my onepage.phtml file :

<script type="text/javascript">
        require(['jquery', 'custom-js'], function($) {
            alert('JS loaded');
        });
</script>

Contents of my checkout_index_index.xml file:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.onepage">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">My_Module::onepage.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Contents of my requirejs-config.js file:

var config = {
    map: {
        '*': {
            custom-js: 'My_Module/js/custom-js'
        }
    }
};

Contents of my module.xml file:

<?xml version="1.0"?>
  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="My_Module" setup_version="1.0.1">
        <sequence>
            <module name="Magento_Checkout"/>
        </sequence>
    </module>
  </config>

When I add the contents of my onepage.phtml file to the core onepage.phtml file the JS is loaded correctly.

Also, when I change the referenceBlock name to checkout.root in the checkout_index_index.xml file, my JS files are loaded but it seems that only the onepage.phtml file is then rendered and nothing else... Am I using the wrong name value?

Is there a better way to include JS or am I just missing something? Any help would be appreciated!


texts: Copy Luma Layered Navigation to Blank Theme

texts:
Please, can anyone provide instructions on how to copy the Luma Layered Navigation into the Magento Blank Theme?

I tried by adding the

  Magento_LayeredNavigation

into

app/design/frontend

Whilst it does show on the front end - it messes all other parts of the site up for example search is shown as an open state - and the top part of the site is shown on the bottom.

Which other files should I be adding or copying?

Would really appreciate if someone can help me with this

Thank you


texts:
I modified tax for the shipping by using observer "sales_quote_address_totals_after", which make changes in the Order Summary. But the Grand Total not getting changed, and when I make order, changed grand total is showing on admin.

When I see the grand total in network, it shows the changed grand total. Attached an screen-shot below


texts: Does Magento support Oauth for customers?

texts:
I went through the documentation at https://devdocs.magento.com/guides/v2.4/get-started/authentication/gs-authentication.html

But it's not clear to me whether I can use it for customer authentication.
I want customers to visit a site, say tool.example.com, which will NOT be a magento site, click a login button, get redirected to an Oauth screen at magento.example.com (which will be a magento site). I don't want the customers to enter their Magento account's credentials on the third party tool. Then I would like to fetch and display on tool.example.com some details like the list of orders placed by the user and the items currently in the user's cart.

If this is not supported out of the box, is there any extensions that can help me achieve this?


texts: Magento 2: how to change default order status for Cash On Delivery Payment

texts:
I want to change the new order status for Cash On Delivery Payment Method to Processing

I tried to do this:

I tried below changes in vendor but it didn't worked:

  vendor\magento\module-offline-payments\etc\adminhtml\system.xml

<group id="cashondelivery" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
Cash On Delivery Payment
 ----
<field id="order_status" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
     New Order Status
      <source_model>Magento\Sales\Model\Config\Source\Order\Status\Newprocessing</source_model>
OR
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
                </field>
---
</group>

Then I change in:

  vendor\magento\module-offline-payments\etc\config.xml

<cashondelivery>
   <active>0</active>
   <model>Magento\OfflinePayments\Model\Cashondelivery</model>
   <order_status>processing</order_status>
   <title>Cash On Delivery</title>
   <allowspecific>0</allowspecific>
   <group>offline</group>
</cashondelivery>

also did not help. how can this be achieved?


texts: How to save a image upload to a folder in magento2?

texts:
Created a custom tab on admin product edit page.
Here added a image upload section. I need to save the uploaded image to a folder.


texts: Magento2 redirecting to /defaultsite for homepage

texts:
Question fairly self explanatory but how do you prevent the homepage of a new Magento2 install redirecting to www.domain.com/defaultsite ? It should simply go to www.domain.com

We are using latest version 2.1.8

It occurs in both developer or production mode. Cache cleared in var folder. Have ran setup:upgrade and recompiled etc. The .htaccess file is the default one that comes with Magento2 and has no edits. Same scenario for our env.php file in app/etc folder.


texts:
getting error in Magestore Banner Slider,

2 exception(s): Exception #0 (Zend_Db_Statement_Exception):
SQLSTATE[42S22]: Column not found: 1054 Unknown column
'main_table.entity_id' in 'field list', query was: SELECT
main_table.entity_id FROM magestore_bannerslider_slider AS
main_table Exception #1 (PDOException): SQLSTATE[42S22]: Column not
found: 1054 Unknown column 'main_table.entity_id' in 'field list'
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S22]: Column
not found: 1054 Unknown column 'main_table.entity_id' in 'field list',
query was: SELECT main_table.entity_id FROM
magestore_bannerslider_slider AS main_table


texts: Magento 2.3 introduced a view table which causes issue with import of mysql dump. What's it for?

texts:
If you mysql dump a magento 2.3 store and try to import it elsewhere you get an issue due the the format of the view import query.

The problem part is this:

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

You need elevated permissions. The solution is this:

CREATE
OR REPLACE
VIEW `inventory_stock_1` AS select
    distinct `legacy_stock_status`.`product_id` AS `product_id`,
    `legacy_stock_status`.`website_id` AS `website_id`,
    `legacy_stock_status`.`stock_id` AS `stock_id`,
    `legacy_stock_status`.`qty` AS `quantity`,
    `legacy_stock_status`.`stock_status` AS `is_salable`,
    `product`.`sku` AS `sku`
from
    ( `cataloginventory_stock_status` `legacy_stock_status`
join `catalog_product_entity` `product` on
        (( `legacy_stock_status`.`product_id` = `product`.`entity_id` )));

My question is what is this view table used for? And why a view?


texts:
I have just installed Magento 1.8, when I login it shows me this message:

  Please enable cookies in your web browser to continue.

I have enabled cookies. I am using Chrome. What do I need to do?


texts: How to debug 'something went wrong' in magento2

texts:
I installed magento2 2.2.10 version and installed custom modules. At begining it works finely after adding products , customers and place an order then it's not loading any admin grids(customers , sales , theme configuration , etc).

http://localhost/magento/admin/mui/index/render/key/384b4baacce8db392b425b6a0474d8572ba8651cb5a889f5be528b3546375ea6/?namespace=customer_listing&search=&filters%5Bplaceholder%5D=true&paging%5BpageSize%5D=20&paging%5Bcurrent%5D=1&sorting%5Bfield%5D=entity_id&sorting%5Bdirection%5D=asc&isAjax=true

This ajax call giving an error as below

SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 2648 of the JSON data

Then i removed all my custom modules and run the following commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex

But no success to get the grid working again. How can i debug what will be the error in this case? Which module causing error?

I removed all var/report logs and refresh the page in admin but there is no error logs at all.

In my index.php file i placed below code as well. No error coming.

ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
$error = error_get_last();
echo("<pre>");
print_r($error);
}

In google when i searched got suggestion as ui_bookmark table needs to be cleared . I did that as well its still not loading any customers , pages , blocks , orders etc. Please help me on this..

I tried a fresh install and it has no issues... After added my custom modules got issue but i removed them all still issue is there. How can i trace it?


texts: Block type not working in layout/catalog.xml

texts:
I'm working with the AW Mobile2 extension which works fine more or less.
I notice the product image doesn't show up on the product view page. Unfortunately I do not see any related issue in the log files like "exception 'Mage_Core_Exception' with message 'Invalid block type'".

Debugging turned out out that Magento doesn't show the image because of the block type:

app/design/frontend/aw_mobile2/iphone/layout/catalog.xml

[Does not work]
<block type="aw_mobile2/catalog_product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>

[Works]
<block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>

app/code/local/AW/Mobile2/etc/config.xml

    <global>
        <blocks>
            <aw_mobile2>
                <class>AW_Mobile2_Block</class>
            </aw_mobile2>
        </blocks>
        ...

app/code/local/AW/Mobile2/Block/Catalog/Product/View/Media.php

class AW_Mobile2_Block_Catalog_Product_View_Media extends Mage_Catalog_Block_Product_View_Media
{
    /**
     * @return array|Varien_Data_Collection
     */
    public function getGalleryImages()
    {
        if ($this->_isGalleryDisabled) {
            return array();
        }
        return $this->_getMediaGalleryImages($this->getProduct());
    }

    /**
     * @param Mage_Catalog_Model_Product $product
     * @return Varien_Data_Collection
     */
    protected function _getMediaGalleryImages($product)
    {
        if (!$product->hasData('media_gallery_images') && is_array($product->getMediaGallery('images'))) {
            $images = new Varien_Data_Collection();
            foreach ($product->getMediaGallery('images') as $image) {
                if ($image['disabled'] && !$this->_isBaseImage($image, $product)) {
                    continue;
                }
                $image['url'] = $product->getMediaConfig()->getMediaUrl($image['file']);
                $image['id'] = isset($image['value_id']) ? $image['value_id'] : null;
                $image['path'] = $product->getMediaConfig()->getMediaPath($image['file']);
                $images->addItem(new Varien_Object($image));
            }
            $product->setData('media_gallery_images', $images);
        }

        return $product->getData('media_gallery_images');
    }

    /**
     * @param array $image
     * @param Mage_Catalog_Model_Product $product
     * @return bool
     */
    protected function _isBaseImage($image, $product)
    {
        return (strcasecmp($product->getImage(), $image['file']) == 0);
    }
}

The file permissions are also correct. Sure I could go with the working solution but I'm really wondering why the aw_mobile2 block type doesn't work. This part wasn't modified and should work though.

I stuck and appreciate any hint. Thanks!


texts: Inventory Stock Sales Channel Mageto 2.3.3

texts:
So we have this query that keeps running and BlackFire is complaining about it and I'm wondering if I turn it off there will be any negative effects. We're not managing our own stock so I assume it would be fine.

It looks like so from the BlackFire profiler:

select ? from inventory_stock_sales_channel where (type = ?) and (code = ?)

Any ideas on if it's okay to turn off and the best way of going about turning it off?

Would it be as simple as just removing the modules like so:

"replace": {
    "magento/module-inventory": "*",
    "magento/module-inventory-admin-ui": "*",
    "magento/module-inventory-api": "*",
    "magento/module-inventory-bundle-product": "*",
    "magento/module-inventory-bundle-product-admin-ui": "*",
    "magento/module-inventory-cache": "*",
    "magento/module-inventory-catalog": "*",
    "magento/module-inventory-catalog-admin-ui": "*",
    "magento/module-inventory-catalog-api": "*",
    "magento/module-inventory-catalog-search": "*",
    "magento/module-inventory-configurable-product": "*",
    "magento/module-inventory-configurable-product-admin-ui": "*",
    "magento/module-inventory-configurable-product-indexer": "*",
    "magento/module-inventory-configuration": "*",
    "magento/module-inventory-configuration-api": "*",
    "magento/module-inventory-distance-based-source-selection": "*",
    "magento/module-inventory-distance-based-source-selection-admin-ui": "*",
    "magento/module-inventory-distance-based-source-selection-api": "*",
    "magento/module-inventory-export-stock": "*",
    "magento/module-inventory-export-stock-api": "*",
    "magento/module-inventory-elasticsearch": "*",
    "magento/module-inventory-graph-ql": "*",
    "magento/module-inventory-grouped-product": "*",
    "magento/module-inventory-grouped-product-admin-ui": "*",
    "magento/module-inventory-grouped-product-indexer": "*",
    "magento/module-inventory-import-export": "*",
    "magento/module-inventory-indexer": "*",
    "magento/module-inventory-low-quantity-notification": "*",
    "magento/module-inventory-low-quantity-notification-admin-ui": "*",
    "magento/module-inventory-low-quantity-notification-api": "*",
    "magento/module-inventory-multi-dimensional-indexer-api": "*",
    "magento/module-inventory-product-alert": "*",
    "magento/module-inventory-reservations": "*",
    "magento/module-inventory-reservations-api": "*",
    "magento/module-inventory-reservation-cli": "*",
    "magento/module-inventory-sales": "*",
    "magento/module-inventory-sales-admin-ui": "*",
    "magento/module-inventory-sales-api": "*",
    "magento/module-inventory-sales-frontend-ui": "*",
    "magento/module-inventory-setup-fixture-generator": "*",
    "magento/module-inventory-shipping": "*",
    "magento/module-inventory-shipping-admin-ui": "*",
    "magento/module-inventory-source-deduction-api": "*",
    "magento/module-inventory-source-selection": "*",
    "magento/module-inventory-source-selection-api": "*"
  }


texts: How to show star rating on the category listing page?

texts:
I am working on the mobile site and I need to show the product star rating under each product.

The helper calls the template summary_short.phtml which has section to show the star rating but for some reason the object carries on information only about the number of reviews on the grid page. The same works fine on the product page.

I also don't want to do the query in the loop to avoid slowing down the platform.


texts: Currency symbol gets lost on specific store view

texts:
I got two store views in my shop.

1 english and 1 arabic(ar_SA)

Standard currency is SAR

On english store view the shop shows me SAR 100.00 for example.
On arabic store view I just get the Number itself like 100.00.

Can someone tell me why the SAR is missing?

EDIT:
Found out that in arabic store view the custom currency symbol is NOT used.
Tested it by hard coding symbol in app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php (just for test)


texts:
I have successfully run the compilation process, but when trying to enable the compilation mode, either through admin panel or through command line, I get no errors, but the state remains always disabled.

The folder includes has permissions 0775, and the file includes/config.php has 0777, so I don't think it's a permission issue.

Here is a typical sequence in putty:

myuser@serv01 [~]# php -cli public_html/shell/compiler.php disable
Content-type: text/html

Compiler include path disabled
myuser@serv01 [~]# php -cli public_html/shell/compiler.php enable
Content-type: text/html

Compiler include path enabled
myuser@serv01 [~]# php -cli public_html/shell/compiler.php state
Content-type: text/html

Compiler Status:          Disabled
Compilation State:        Compiled
Collected Files Count:    7605
Compiled Scopes Count:    4

UPDATE

Even changing the working directory didn't help:

myuser@serv01 [~]# cd public_html/shell
myuser@serv01 [~/public_html/shell]# php -cli compiler.php enable

etc...

UPDATE 2

The file includes/config.php is always empty, but the folder includes/src is updated / recreated during compilation.


texts:
i have two url.

1 : abc.com
2 : xyz.com

I want when click abc.com, it load abc.com and when click xyz.com, it load xyz.com
When i click xyz.com, it load abc.com now. Please help me!


texts:
Message queue topic "inventory.reservations.updateSalabilityStatus" is not configured.
i am getting this error when i click checkout or once Payment method click "Place Order" i am using magento 2.3.0 version. Any idea how to resolve this issue?


texts: Area code not set: Area code must be set before starting a session when deploy content

texts:
When I tried to deploy static content I am getting error on command line that ' Area code not set: Area code must be set before starting a session.'.
Deploy using quick strategy
frontend/Magento/blank/en_US            2459/2459           ============================ 100% %  1 sec
adminhtml/Magento/backend/en_US         2328/2328           ============================ 100% %  1 sec
frontend/TemplateMonster/theme059/en_US 2548/2548           ============================ 100% %  1 sec
frontend/Magento/luma/en_US             2475/2475           ============================ 100% %  1 sec

[Magento\Framework\Exception\SessionException]
Area code not set: Area code must be set before starting a session.

[Magento\Framework\Exception\LocalizedException]
Area code is not set

Can some please help me on this.
Magento version 2.2.4
After @amitshree suggestion I have run command in verbose mode, and still I am getting the same error but on different line.
Processing file '/home3/thermx2futurismd/public_html/vendor/magento/theme-frontend-luma/Magento_CustomerBalance/web/css/source/_module.less'  for area 'frontend', theme 'Magento/luma', locale 'default'module 'Magento_CustomerBalance'

.
[Magento\Framework\Exception\SessionException]
Area code not set: Area code must be set before starting a session.


texts: How to send magento 2 Order emails through mailchimp?

texts:
I have mail-chimp account and successfully integrated with my Magento2 website.
I Want to send the order emails via mail-chimp.
Newsletter subscription is working fine and syncing.
Order is not syncing in the MailChimp, it's always empty as below.

But the order email is not sending via mail-chip. Can I send order email only through mail-chimp and other emails through Magento(ex - Customer registration success, Reset password, etc)

How can i send my transnational email via Mailchimp? Is there any possibility?

If i setup the mailchimp all Magento email going through mailchimp like Forget password, Shipment notification, Credit memo etc?


texts: How to add Upload Button for importing a csv file in the Custom Admin Grid Container?

texts: I'm creating a custom module where i have a requirement to add a upload button to the Grid container for uplaoding a csv file and execute it to update a attribute value in the database. how do i achieve this.


texts: Updating product quantity invalidates *all* indexes? Can that be right?

texts:
I'm scratching my head trying to figure out if this is somehow the appropriate behavior in CE 1.8.1, or if I need to dig deeper in search for a solution.

It seems any change to a product's data, but in this case quantity specifically, results in an invalidation of all my indices except for "Catalog URL Rewrites", forcing me to reindex. And by reindex, I mean a "real" reindex, so with a catalog of 60,000 SKUs it takes several minutes.

So if the indexes are set to "Update on Save" something like cancelling an order results in a timeout error as all the indexes try to run.

Am I missing something here?


texts: Registration,Forgot password form show blank screen after submit

texts: If we submit register and forgot password form it display blank screen. But refreshing the page submit the data and display success screen.Could not understand what is the problem? please help!


texts: display 'welcome " customer_name"' at the top of the magento site

texts:
when customer login to site, it should display "welcome customer" at top of the site.

assume customer will login to site. after customer login, in top of the site there

should be a some message to welcome customer.

how to display welcome " customer_name" at the top of the site.

please help me to find solution.

thanks in advance.


texts: Magento 2.4 Custom Sort Order to Print Multiple PDF Invoices (Grouped Print sorted by Customer Name, then by order date)?

texts: Is it possible to select a range of invoices, apply a sort (say by Customer Name), then to print the selected range in that order?  We have customers placing numerous orders in a week that we list view manually on screen to bring them together.  We need to then print all invoices due to despatch that day in that order (grouped / sorted) by Customer.  This ensures they are consolidated for despatch and and none are missed.  Many thanks


texts:
I need to disable checkout (so neither billing nor shipping, ..) for certain product. Instead of the Add to cart button I need to have a textfield and a button that says Send me an email about this product
How can I do this?


texts: PWA studio yarn run watch:venia give error while run on server

texts:
i am just trying to setup PWA studio at my server and i am getting bellow error while run bellow command
yarn run watch:venia

    cat: /home/surtexam/.config/devcert/certificate-authority/certificate.cert: No such file or directory
Error: [pwa-buildpack:Utilities:configureHost.js] Could not setup development domain:
Error: Command failed: sudo cat /home/surtexam/.config/devcert/certificate-authority/certificate.cert
cat: /home/surtexam/.config/devcert/certificate-authority/certificate.cert: No such file or directory

    at checkExecSyncError (child_process.js:639:11)
    at Object.execSync (child_process.js:676:15)
    at Object.run (/home/surtexam/public_html/betaone/pwa-studio/node_modules/devcert/dist/utils.js:24:28)
    at LinuxPlatform.<anonymous> (/home/surtexam/public_html/betaone/pwa-studio/node_modules/devcert/dist/platforms/linux.js:81:35)
    at Generator.next (<anonymous>)
    at /home/surtexam/public_html/betaone/pwa-studio/node_modules/tslib/tslib.js:107:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/home/surtexam/public_html/betaone/pwa-studio/node_modules/tslib/tslib.js:103:16)
    at LinuxPlatform.readProtectedFile (/home/surtexam/public_html/betaone/pwa-studio/node_modules/devcert/dist/platforms/linux.js:80:24)
    at Object.<anonymous> (/home/surtexam/public_html/betaone/pwa-studio/node_modules/devcert/dist/certificate-authority.js:86:48)
    at Generator.next (<anonymous>)
    at fulfilled (/home/surtexam/public_html/betaone/pwa-studio/node_modules/tslib/tslib.js:104:62)
    at configureHost (/home/surtexam/public_html/betaone/pwa-studio/packages/pwa-buildpack/dist/Utilities/configureHost.js:165:11)
/bin/sh: line 0: cd: OLDPWD not set

Can any home have idea how to setup on server ? i am using bluehost VPN server for magento 2 and everything setup but not able to run yarn run watch:venia

Anyone please help


texts: Magento 2 - Mirasvit RMA data migration from M1 to M2

texts: We have migrated products, customers and orders details from M1 to M2 using https://devdocs.magento.com/guides/v2.3/migration/migration-tool-install.html now we would like to migrate RMA Mirasvit data from M1 EE to M2 Commerce. Is this possible by using the data migration tool please advise?


texts: How to write sub-query with group by in Magento 1.9?

texts:
I am new in learning Magento. I need to create query like this,

SELECT *
FROM YourTable
WHERE ARIDNR IN (
SELECT ARIDNR
FROM YourTable
GROUP BY ARIDNR
HAVING COUNT(*) > 1
)

How to write this using collection method or any other method?


texts: Magento 2: MassAction Model LSD method delete()

texts:
My massaction functionalities are working fine.
According to CodingStandard it shows this warning.

----------------------------------------------------------------------
 38 | WARNING | Model LSD method delete() detected in loop
----------------------------------------------------------------------

I have attached my MassDelete code below.

<?php

namespace modulename\Wallet\Controller\Adminhtml\Transaction;

use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use modulename\Wallet\Model\ResourceModel\Transaction\CollectionFactory;

class MassDelete extends \Magento\Backend\App\Action
{
    public function __construct(
        Context $context,
        Filter $filter,
        CollectionFactory $collectionFactory
    ) {
        $this->_filter = $filter;
        $this->_collectionFactory = $collectionFactory;
        parent::__construct($context);
    }
    public function execute()
    {
        $data = $this->getRequest()->getParams();
        $collection = $this->_collectionFactory->create();
        $collection->addFieldToFilter('transaction_id', ['in' => $data]);
        $recordDeleted = 0;
        foreach ($collection->getItems() as $auctionProduct) {
            $auctionProduct->setId($auctionProduct->getId());
            $auctionProduct->delete();
            $recordDeleted++;
        }
        $this->messageManager->addSuccess(
            __('A total of %1 record(s) have been deleted.', $recordDeleted)
        );

        return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT)->setPath('*/*/index');
    }
}


texts:
I want to show customer having specific value for attribute.
Suppose I made customer attribute say refcode, now I want to get list of all customer having refcode 1.

How can I add filter to list of customer?


texts: Multiple Controllers sharing same functionality

texts:
I have a module which needs multiple Controllers. Every Controller though starts with an authentification check provided by a GET Parameter. So instead of writing in every controller at the beginning the same code I am thinking of a better way. What is best practice here?
I thought of using a Helper, which works for sharing code but in the Helper I would need to call $this->_request->getParams(); which I don't know if this is possible.
Any hints or tips?


texts:
I have been trying to create an order using a custom extension, I managed to do so, but whenever I try to add a bundle product I get a message error

Selected required options are not available.

here is the code I'm using
<?php

$product = Mage::getModel('catalog/product')->load($productDetails["product_id"]);

$optionCollection = $product->getTypeInstance()->getOptionsCollection();
$selectionCollection =$product->getTypeInstance()->getSelectionsCollection($product->getTypeInstance()->getOptionsIds());
$options = $optionCollection->appendSelections($selectionCollection);

foreach($options as $option) {

    $_selections = $option->getSelections();

    foreach($_selections as $selection) {
        $bundled_items[$option->getOptionId()] = $selection->getSelectionId();
    }
}

$config = new Varien_Object(['product' =>$productDetails["product_id"],
                // X        'qty' => $productDetails["qty"],
                // 2        'bundle_options' => $bundled_items,
                // array( 234 => 1070, 235=> 1646)
                            'bundle_option_qty' => $productDetails["bundle_option_qty"],
                // array( 234 => 2, 235=>2 )
                            ]);
$quote->addProduct($product, $config);

?>

I found out that when loading the bundle items I'm not getting the options and that's why I get the exception
I also tried to use Magento's soap API but ones again when trying to add a bundle I get the error message " `

Please specify the product option(s).

I've been stuck on this for 4days now, any help is very much appreciated and thank you


texts: Order email is not sending to customer mail

texts: When a customer place order the email is not sending to customer and store admin.When i checked contact us email it is successfully send.


texts: I am trying to export all my URL redirects from my Enterprise Magento instance. Is there a way to do this in the Admin or a SQL statement I can use to export it as a CSV? I am unable to find it in the admin.


texts: Exclude child products from search in magento 2.3.2

texts:
I am trying to exclude child products from search. Say I have a bundle product B1 with 'xyz' name and it has a child with name 'abc'. Now searching for 'abc' in frontend also gives the product B1 in search results.
What I need is If I search 'abc' then I should not get product B1 in the search results.
I have tried following solutions but they are related to magento 1
CatalogSearch - exclude child product names from fulltext
https://stackoverflow.com/questions/19907666/magento-search-result-excluding-tthe-child-products
In magento2.3.2 I did not find Mage_CatalogSearch_Model_Resource_Fulltext::_rebuildStoreIndex function.
ofcourse I looked for this inside vendor/magento/module-catalog-search/Model/ResourceModel/Fulltext.php
But I found a similar function that I felt is doing the reindexing part.function is next() It is located in
\vendor\magento\module-catalog-search\Model\Indexer\Fulltext\Action\IndexIterator.php
I tried commenting the following line as suggested in above solutions
// $productChildren = $this->productRelations[$productData['entity_id']];
    // if ($productChildren) {
        // foreach ($productChildren as $productChildId) {
            // if (isset($this->productAttributes[$productChildId])) {
                // $productChildAttr = $this->productAttributes[$productChildId];
                // if (!isset($productChildAttr[$this->status->getId()])
                    // || !in_array($productChildAttr[$this->status->getId()], $this->statusIds)
                // ) {
                    // continue;
                // }

                // $hasChildren = true;
                // $productIndex[$productChildId] = $productChildAttr;
            // }
        // }
    // }

cleaned cache, reindexed, but still getting results based on child products. Any suggestion how I can achieve this.


texts:
I am building a custom reports module. I need to add a column which will represent a percent based on the corresponding sale column and total for that column.
Bellow is the select I am using for getting all needed data.

public function addTotalSalesByDepartment($frm = '', $to = '')
{
    $qtyOrderedTableName = $this->getTable('sales/order_item');
    $qtyOrderedFieldName = 'qty_ordered';

    $productIdTableName = $this->getTable('catalog/product');
    $productIdFieldName = 'product_id';

    $productEntityIntTable = (string)Mage::getConfig()->getTablePrefix() . 'catalog_product_entity_varchar';
    $eavAttributeTable = $this->getTable('eav/attribute');

    $frm = date('Y-m-d G:i:s', strtotime($frm));
    $to = date('Y-m-d G:i:s', strtotime($frm . '+' . '1 day'));

    if ($frm != '' && $to != '') {
        $dateFilter = " AND `order`.created_at BETWEEN '{$frm}' AND '{$to}'";
    } else {
        $dateFilter = "";
    }

    $this->getSelect()->reset()->from(
      array('order_items' => $qtyOrderedTableName),
      array('ordered_qty' => "SUM(order_items.{$qtyOrderedFieldName})",
                    'base_price_total' => "SUM(order_items.price * order_items.{$qtyOrderedFieldName})",
                    'sms_dept_id' => "pei.value",
                    'sale_percentage' => '**THIS IS THE VALUE I NEED TO CALCULATE**'
   );

   $_joinCondition = $this->getConnection()->quoteInto(
       'order.entity_id = order_items.order_id AND order.state<>?', Mage_Sales_Model_Order::STATE_CANCELED
   );

   $_joinCondition .= $dateFilter;

   $this->getSelect()->joinInner(
       array('order' => $this->getTable('sales/order')),
       $_joinCondition,
       array()
   );

   $this->getSelect()
       ->joinInner(array('e' => $productIdTableName),
           "e.entity_id = order_items.{$productIdFieldName}")
       ->order('pei.value ASC')
       ->group('pei.value')
       ->having('SUM(order_items.qty_ordered) > 0');

   $this->getSelect()
       ->joinInner(
           array('pei' => $productEntityIntTable),
           "e.entity_id = pei.entity_id",
           array())
       ->joinInner(
           array('ea' => $eavAttributeTable),
           "pei.attribute_id=ea.attribute_id AND ea.attribute_code='sms_dept_id'",
           array());

    Mage::log('SQL: '.$this->getSelect()->__toString());
    return $this;
}

EDIT: I put as you can see in my comment. How can I deal with undefined index warning for my custom columns when trying to sort after these fields? It is related to my original question and I hope it is fine to put it here.


texts: I am using a package for my language but not everything is translated

texts:
I am using: http://www.magentocommerce.com/magento-connect/magento-core-modules-french-language-pack.html

for the translation of my website to french. But the bottom menu is in english for some reason.

Why? And what can I do to change this?


texts:
I have added the following to local.xml file

<?xml version="1.0"?>
<layout version="0.1.0">
    <contacts_index_index translate="label">
        <label>Contact Us Form</label>
        <reference name="head">
            <action method="setTitle" translate="title" module="contacts"><title>Contact Us</title></action>
        </reference>
    </contacts_index_index>
    <customer_account_forgotpassword translate="label">
        <reference name="head">
            <action method="setTitle" translate="title" module="customer"><title>Forgot Your Password</title></action>
        </reference>
    </customer_account_forgotpassword>
    <checkout_onepage_success>
        <reference name="head">
            <block type="core/template" name="cj_udo" template="app/design/frontend/base/default/template/cj/udo.phtml" />
        </reference>
    </checkout_onepage_success>
</layout>

location:

/app/design/frontend/base/default/local.xml

then I added udo.phtml here:

However I get this error on my system.log

  2014-08-10T11:51:36+00:00 CRIT (2): Not valid template
  file:frontend/base/default/template/app/design/frontend/base/default/template/cj/udo.phtmlt


texts: Magento 2: unable to set payment Transaction Id after successful payment processing (solved by myself)

texts:
I am unable to set payment transaction id after successful payment processing...

I have got payment confirmation transaction details by payment gateway on my controller action. Now I need to save the payment transaction id in \Magento\Payment\Model\InfoInterface $payment
by using setTransactionId method of above interface.

But unable to use the \Magento\Payment\Model\InfoInterface

Using code

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$payment = $objectManager->get('\Magento\Payment\Model\InfoInterface');
$payment->setTransactionId(htmlentities($transaction_result->id))
                ->setIsTransactionClosed(0);

Getting error as: Cannot instantiate interface Magento\Payment\Model\InfoInterface

Please suggest way to get payment instance for save/update order transaction in custom method of model.

I am in return url page of payment

As I have redirected  payment gateways after payment done or failed at payment on a controller action.

On the url's at controller, I need to get current order/payment and then update truncation id to that order/payment object.

I have just tried below solution:

protected $_checkoutSession;
public function __construct(
   ...
    \Magento\Checkout\Model\Session $checkoutSession,
    .....
) {
    $this->_checkoutSession = $checkoutSession;
}

 public function execute(){
    $order = $this->_checkoutSession->getLastRealOrder();
    $payment = $order->getPayment();
    $payment->setTransactionId(htmlentities($transaction_result->id));
    $payment->setIsTransactionClosed(0)
            ->setTransactionAdditionalInfo(
                    "some text",
                    htmlentities($transaction_result->id)
                );
}

But $this->_checkoutSession comes with empty array...
It means after coming back from payment gateway session get flushed... but how and why.. then how to get order object?

I have got order Increment id... Now how to get order object with order increment id?

I have also used below links:

Magento 2.1.1 How to load Order with Increment ID using OrderRepository object

https://github.com/magento/magento2/issues/3534#issuecomment-227413082

for get order object by order increment id but don't found order object yet for get payment object.

Update:

When i am coming back from payment gateway as redirect url on my module controller execute function i am not getting object manager or session object or order object... I dont know much about dependency injection... please elaborate if i have to create and put any code in the di file in etc folder...

below code are not working in my module controller execute function:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$payment = $objectManager->get('\Magento\Payment\Model\InfoInterface');

It return null/empty

And if I am using below  code:

protected $_checkoutSession;
public function __construct(
   ...
    \Magento\Checkout\Model\Session $checkoutSession,
    .....
) {
    $this->_checkoutSession = $checkoutSession;
}

 public function execute(){
    $order = $this->_checkoutSession->getLastRealOrder();
    $payment = $order->getPayment();
    $payment->setTransactionId(htmlentities($transaction_result->id));
    $payment->setIsTransactionClosed(0)
            ->setTransactionAdditionalInfo(
                    "some text",
                    htmlentities($transaction_result->id)
                );
}

then this also not working...

Please help to resolve the issue...