texts: Most bough items block porto theme: addition of a stock check

texts:
A client is using Magento 2.1.3 with the Porto theme. The homepage of that site has a div which has tabs of different categories with the most bought items. Per category it loads a block in the following way:
{{block class="Smartwave\Filterproducts\Block\Home\BestsellersList"
 name="nachtmode_product" category_id="5" product_count="4"
 column_count="4" move_actions="1" aspect_ratio="0" image_width="250"
 image_height="250" template="grid.phtml"}}

It makes use of a BestSellersList.php. Its primary function is returning a $collection, which has the products that are relevant. What it does, just before returning is a query on the DB in the following way (ive tried to separate the parts for an easy read):
        $collection->getSelect()
->joinLeft(['soi' => $connection>getTableName('sales_order_item')], 'soi.product_id = e.entity_id', ['SUM(soi.qty_ordered) AS ordered_qty'])

->join(['order' => $connection->getTableName('sales_order')], "order.entity_id = soi.order_id",['order.state'])

**->join(['quantity'=> $connection->getTableName('cataloginventory_stock_item')], "quantity.product_id = e.entity_id")**

->where("order.state <> 'canceled' and soi.parent_item_id IS NULL AND soi.product_id IS NOT NULL AND **quantity.is_in_stock = 1"**)

->group('soi.product_id')

->order('ordered_qty DESC')

->limit($count);

The bold parts are what I have added so I can also filter if a product is in stock, which almost works (at least for simple products).
Here is the problem: The items shown on the frontpage are mostly configurable products. Somehow these products are always in stock (so 1 instead of 0), even when their child products have a quantity of 0 and are marked as out of stock.

So my questions:

Does Magento not mark a parent product as out of stock when their child products are 0 and out of stock? Or is there a specific setting
for this?

If the above is not available, does anyone have a good addition to the query above OR has a good approach on how I can also make sure the
configurable products that are out of stock are not shown on the
frontpage?

I thank you kindly for any helpful responses!


texts: Auto-generated reset password is empty string in reset password email

texts:
So we have a Magento webshop and we suddenly discovered that when you use the "forgot password" funtion, it sends an email with an empty password string.

Now I've looked through a lot of forums and questions but alas, I could not find anything.

I've looked in app/locale/nl_NL/template/email/password_new.html
And I saw the {{htmlescape var=$customer.password}} string.
This one is empty. I've tried some things which were logical to me:

{{htmlescape var=$user.password}}
{{htmlescape var=$password}}

Also, I'm starting to think it might be something else. Or some other template which handles this.

So my questions is, how do I fix this? Where do I look?
I am experienced with PHP so programming related answers are welcome!


texts: Exception Log main.CRITICAL: The element "category.product.type.details.renderers" can't have a child because in Magento 2

texts:
[2021-05-24 18:35:49] main.CRITICAL: The element "category.product.type.details.renderers" can't have a child because "category.product.type.details.renderers" already has a child with alias "configurable". {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): The element \"category.product.type.details.renderers\" can't have a child because \"category.product.type.details.renderers\" already has a child with alias \"configurable\". at /var/www/developmentweb.com/vendor/magento/framework/Data/Structure.php:625)"} []
    [2021-05-24 18:35:49] main.CRITICAL: Unable to get content for 'frontend/bs_drexel/bs_drexel1/en_US/Magento_Swatches/css/swatches.min.css' {"exception":"[object] (Magento\\Framework\\View\\Asset\\File\\NotFoundException(code: 0): Unable to get content for 'frontend/bs_drexel/bs_drexel1/en_US/Magento_Swatches/css/swatches.min.css' at /var/www/developmentweb.com/vendor/magento/framework/View/Asset/File.php:187)"} []

I am getting error in exception log.
Does anyone know this error?
Please suggest me how to resolved these


texts:
I would like to organise some courses in Magento for my team. i'm searching about free online courses or ressources and test sample

In advance thank you


texts: Modify existing prototype js validation method

texts:
I'm having a little bit of difficulty trying to do this cleanly, and the majority of docs/posts I've seen about this typically involve adding a new custom validation method. I want to just add an extra piece of functionality to the existing validate() method to capture when form validation is failed. If I extend the class, it seems like I would have to duplicate the full validate() function (I may be wrong here but that was the result I was getting). I could just do that but I'm sure it can't be the best way to handle this.

It looks like what I'm after is wrapping the existing function with the additional functionality I want to add. However this is throwing an error.

My code is currently:

Validation.prototype.validate = Validation.prototype.validate.wrap(function(parentMethod){
    parentMethod();

   // I want to add some logic here when validation errors have been triggered
});

The above code generates the following error: prototype.js:429 Uncaught TypeError: wrapper.apply is not a function

Any help much appreciated!


texts: How do you add a Paypal "Buy Now" for order emails processed from backend?

texts:
We are using magento CE 1.9. PayPal integration has been done for the front end.

When an is order created from the back end, the customer receive an email. I was looking to put a pay now PayPal button in the email body.

1.Sales person receive call from customer.
2. Sales person logged in to the back end, creates a quote. Sends to customer.
3. Customer replies back via email, quote accepted.
4. Sales person converts quote to order. Sends order to customer from the back end via email.

Requested feature : when customer receives email with order, a "pay now"  PayPal button should be in the email body. Client clicks on "pay now" goes to PayPal page with order information and totals. Pays for order. Information return to back end that order has been paid.

I would appreciate any help :)

Thank you


texts: hide pop up box with controllers help if user enter correct email id and password

texts:
in pop up box, we are displaying login form. once user enter wrong email id or password, we are displaying message : Invalid login/pw , but once they enter correct details and click on login button, than user will be logged in.

but issue is pop up box will remain until we close the pop up manually with help of close button as in below image, but i want to hide the pop up box if login is successfull.

we are calling below function once login button clicked.

controllers

protected function _createProduct()
 {

   try {
         if(isset($login) && (is_array($login) && !empty($login)) || ($login!="")){
         $session->login($login['username'], $login['password']);
         $result['redirect'] = $this->_getRefererUrl() ? $this->_getRefererUrl() : Mage::getUrl('customer/account', array(
         '_secure' => true
          ));
                $result['success']  = true;

                $customerId         = Mage::getSingleton('customer/session')->getCustomerId();
         }
         else{
          $customerId = "";
         }

         if ($doSave)
           $product->save();

        return $product;

         }
       catch () {  }
}

  update

i called the javascript file once user credentials are correct as : Mage::app()->getLayout()->getBlock('head')->addJs('js/hide/here.js');

& in here.js file , i add the code to hide complete pop up using class as :

jQuery(".ajaxlogin-window").hide();

  html

<div class="ajaxlogin-window" id="something">
<form>
// email id and password code
<button>Login</button>
</form>


texts: How to override a xml file and phtml in magento 2?

texts:
How to Do? this i was trying to override the default.xml.can anyone tell how to do this.
Thanks In advance


texts:
I am developing a Store in Magento 2. I created an Admin Account at the time of installation of Magento 2. Later I tried to create another User (Who can only add product in the store) from Admin Panel and a User Role (Which has only product entry access). In this time I assigned Admin User to that specific role (Product entry).

Then I install a Magento 2 in local host and replaced all the data of admin_user , authorization_role, authorization_rule table of database to regain access of Admin User. But when I tried to login using that Admin User I am getting a Message  You need more permissions to access this. I attached a screenshot below. How can I get previous Admin User with previous Access?


texts:
I have a website with two different store views (dutch and french). I would like to have an "under construction" message at the french site.
http://development.safety4you.eu/webshop/?___store=fr

How could I accomplish this?

Thanks in advance.


texts: "Unknown module(s)" error from Magento2 cli module:enable

texts:
I am brand new to Magento. I have read the thread at Magento2 CLI module:enable gives error "Unkown module(s)" which details essentially the same issue, though that hasn't exactly helped me in my situation. One of the answers looks potentially useful, mentioning auto-loading via composer json files, but I am unfortunately not finding that information to be clear.

I am wondering if (part of) my issue is path related.

Here is a look at the module I've created, the registration.php, and the command I ran to enable the module.

Again, I am brand new to Magento. I'm not even 100% what I expect to happen upon enabling this test module, though I'd like to get past this particular error. Help is greatly appreciated; please let me know if I can provide more information.

root@magento-1gb-nyc3-01:/var/www/html/magento# cat /var/www/html/magento/vendor/magento/magento2-base/app/code/Training/Test/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="Training_Test" setup_version="2.0.0">
    </module>
</config>
root@magento-1gb-nyc3-01:/var/www/html/magento# cat /var/www/html/magento/vendor/magento/magento2-base/app/code/Training/Test/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Training_Test',
    __DIR__
);
root@magento-1gb-nyc3-01:/var/www/html/magento# pwd
/var/www/html/magento
root@magento-1gb-nyc3-01:/var/www/html/magento# php bin/magento --clear-static-content module:enable Training_Test
Unknown module(s): 'Training_Test'


texts:
I have a bundle product with a number of bundled items all with default amount 1.

For some reason, Magento is only showing 1 (the first one) of my bundled items in the cart!

I have a local Magento installation with the exact same files though not the same database, and the products show fine on my local installation?

Why won't Magento show all my products?  I tried Disabling/Re-enabling, in-stock/out-of-stock, refreshing index and cache...


texts: How to override the bundle product special price in magento2

texts:
I'm edit the file but not updated any change in admin side.can anyone please tell me which is correct file for edit bundle product special price.

vendor/magento/module-bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php


texts: Magento - Last order date to customer grid

texts:
I currently use XTENTO Enhanced Order Grid to add fields to the customer grid which works perfectly.

I need to however put in a column for the customers last order date.

I have searched however the only code I found also added in total number of orders and didn't specify the files I needed to edit.

Does anyone have any advice on how I can create / populate this field when an order is placed so I can show it in my grid?

Thanks!


texts: How to apply github commit patches in Magento 2 using composer?

texts:
I've created a new module with a composer.json file:

  "extra": {
      "composer-exit-on-patch-failure": true,
      "patches": {
          "magento/framework": {
              "TransportBuilder doesn't add 'to' email-addresses, if given in an array": "https://github.com/magento/magento2/commit/be5455a58240b57e4dc0c44a5cea2bb5a2e01c57.diff"
          }
      }
  }

And what I want to achieve is to apply that change from that commit to this file: vendor/magento/framework/Mail/Template, when i install my module .

By doing a composer require mymodule, my module is installed, but the patch is not applied. I also use this package: cweagans/composer-patches as the docs suggested. What do i miss ?

[UPDATE] - Same If i change the url from ....diff into

https://github.com/magento/magento2/commit/be5455a58240b57e4dc0c44a5cea2bb5a2e01c57.patch

I am getting:

    https://github.com/magento/magento2/commit/be5455a58240b57e4dc0c44a5cea2bb5a2e01c57.patch (TransportBuilder doesn't add 'to' email-addresses, if given in an array)
patch '-p1' --no-backup-if-mismatch -d '/Users/attilanaghi/Development/local/vendor/magento/framework' < '/var/folders/rd/rg6xy_fs00bgwvmbpw2myyrr0000gn/T/5e1716d50d06b.patch'
can't find file to patch at input line 15
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
.....

[UPDATE] . I am trying to use the extra/map. See: https://github.com/magento/magento-composer-installer . But so far without any luck. Any ideas how can i apply my patch ?

  "type": "magento2-module",
  "extra": {
    "magento-force": true,
    "map": [
        [
            "patches/github_issue_25453.patch", "patches/github_issue_25453.patch"
        ]
    ]
  }


texts:
I have created a configurable product "bag" with the color attribute.
color:blue,red.

 i missed out to add the price while creating the product itself.

So the front end price not changing while i change the colors in option.

Please anyone help me to solve it by codes..


texts: Apply specific tax only if products price more than 110

texts:
Is there any way to create tax rule based on  cart total product unit price? I need to implement  New York 4% state tax for purchase price over $110. Thanks.

A little clarification. Tax should be apply based on unit price, not total price.


texts: rest api to return categories information

texts:
I know that there is an api that returns me category information, but it doesn't return category image. I need build my own api to return category image with the information that is returned from the already build.
how can I do so


texts: Cache Storage Management - Should these be enabled?

texts:
Apologies in advance if this is a silly question as I'm new to Magento. I have a feeling these should all be set to enabled but wanted to get confirmation from someone before I go ahead.

Thanks! :)


texts: How to create store view or store programmatically and do it right in Mage 2?

texts:
I want to create store or store view programmatically and I use the followng code (for store view):

    $storeView = $objectManager->create(\Magento\Store\Model\Store::class); // Store - is a store view; Group - is a store (this is confusing)
    $storeView->setName('EN');
    $storeView->setCode('store2_en');
    $storeView->setWebsiteId(1);
    $storeView->setGroupId(2); // GroupId is a Store ID (in adminhtml terms)
    $storeView->setSortOrder(10);
    $storeView->setIsActive(true);
    $storeView->save();

But I see in IDE that save() method is deprecated. There is a repo for Store model (store view in adminhtml terms) - \Magento\Store\Model\StoreRepository but this class has no save() or create() method (v Magento 2.1.0 RC2).

What is the right way to create store/store_views in Magento 2?

Thanks.


texts: After changing file permissions, 403 error forbidden to Admin-Categories

texts:
In Magento 1.7, I just tried accessing Admin -> Catalog -> Manage Categories, and I got a 403 Forbidden error (You don't have permission to accesson -url- on this server.).

Before that, I modified the file and folder permissions, and I wonder if I did something wrong when doing so and that's why now I can't access it.

Which are the appropriate file and folder permissons? Any ideas why I cannot access the Categories section?


texts: Product images not visible in backend product edit (Magento 1.9.1.0)

texts: After installing SUPEE 8788, images are not visible in Product Edit section of backend. They are visible in product-grid and in frontend also.


texts:
When we import Product CSV from Admin it says

  Make sure your file isn't more than 2M.

How to increase this size?  I have 5M file size. Don't want to create multiple CSV files with each 2M


texts: How to add field like 'custom products' in Magento admin form?

texts: I want to add a field like below image in my custom module. My admin form content resides in the block class. How to achieve this?


texts: Magento2: I want to add layered navigation filter on category page

texts:
I have already added a layered navigation filter extension. But I want to add a new attribute filter to my extension.

I have a dimension attribute. I want to filter on dimension attribute like the price attribute

Suppose I have a width 150 inch

I want to search filter like below

Under 10
10 - 50
51 - 100
101 - 150
151 - 200
201 - 250
251 - 300

Can anyone tell me? How can I do that?


texts: Magento Admin was hacked and show another page

texts:
my Magento Admin website was hacked and show me a file manager hacked page with an option to upload file, change permissions, delete, rename, etc like the picture:

I tried to change the URL path on database, local.xml, .htaccess and really change but ever show me the file manager hacked page.

The .htaccess contain this code and I renamed the file cause if I don't the website doesn't work:

RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]
</IfModule>

Either, the home page is ok but when I try to access any product or another page show me the 404 error. I tried fixed it changing the web/secure/base_url and web/insecure/base_url with "mydomain.com/index.php/" but all the website stay damaged and without CSS.

  Looking the database, the field admin/url/custom don't exist (only
  "use_custom" and "use_custom_path").

It's ok?

Anybody can help me to fix it, please?

Update Jan 26, 2016: I changed the CAPTCHA row to 0 in the database and now is working the Admin. Either, I changed the Admin URL to protect the access and enable some IPs to access this area. Now, I'm trying to remove the malware.


texts: How to set null attribute value of product in last in sorting on product listing page in Magento 2?

texts:
when I sort product by attribute name (sequence_attribute) on the product listing page then I will get the null value product first, but I need it in last. I have to ignore the null attribute value.
I have tried in gridr.phtml for ASC and DSC but it's not what I want.
Can anyone help me??


texts:
I am having this error in logs every time a customer placing new order from Magento 2.3.2 and now on Magento 2.3.4

report.CRITICAL: No such entity with cartId = "someid"{"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with cartId = "someid" at /mydir/magento/framework/Exception/NoSuchEntityException.php:50)"} []

After some digging it seems that when a customer places new order after success page its cart has the same products which has already ordered.
Magento instead of cleaning the cart throws the error.

I have tested this from magento GitHub but it seems don't work:
Fix

Any help please?


texts: Can Magento have updatable Client Portal

texts: Can Magento be used for a website that provides recurring services? In my situation i need a customer portal on back end that i can update once certain tasks are completed (in a simple table format) , on the front end customer will see what services has been performed.


texts: how to use magento REST api for creating products

texts:
I'm trying to create a product using magento REST api.

I created a OAuth Consumer in magento admin and got key and secret key, I also assigned a OAuth consumer to the user.
(Followed http://help.sweettoothrewards.com/article/363-rest-api-setup )

But, I'm getting "An error occurred. Your authorization request is invalid." error.

I think, there is something wrong with callback url because of that token is not generating but not sure.

I googled, but did not got any working solution.

I followed http://devdocs.magento.com/guides/m1x/api/rest/introduction.html but it did not worked.

<?php

$callbackUrl = "http://magentohost.com/oauth_admin.php";
$temporaryCredentialsRequestUrl = "http://magentohost.com/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://magentohost.com/admin/oauth_authorize';
$accessTokenRequestUrl = 'http://magentohost.com/oauth/token';
$apiUrl = 'http://magentohost/api/rest';
$consumerKey = 'myconsumerkey';
$consumerSecret = 'myconsumersecret';

session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
$_SESSION['state'] = 0;
}
try {
$authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
$oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);
$oauthClient->enableDebug();

if (!isset($_GET['oauth_token']) && !$_SESSION['state']) {
    $requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
    $_SESSION['secret'] = $requestToken['oauth_token_secret'];
    $_SESSION['state'] = 1;
    header('Location: ' . $adminAuthorizationUrl . '?oauth_token=' . $requestToken['oauth_token']);
    exit;
} else if ($_SESSION['state'] == 1) {
    $oauthClient->setToken($_GET['oauth_token'], $_SESSION['secret']);
    $accessToken = $oauthClient->getAccessToken($accessTokenRequestUrl);
    $_SESSION['state'] = 2;
    $_SESSION['token'] = $accessToken['oauth_token'];
    $_SESSION['secret'] = $accessToken['oauth_token_secret'];
    header('Location: ' . $callbackUrl);
    exit;
} else {
    $oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);
    $resourceUrl = "$apiUrl/products";
    $oauthClient->fetch($resourceUrl, array(), 'GET', array('Content-Type' => 'application/json', 'Accept' => '*/*'));
    $productsList = json_decode($oauthClient->getLastResponse());
    print_r($productsList);
}
} catch (OAuthException $e) {
   print_r($e);
}

Please let me know what I'm doing wrong in this? Any suggestions always welcome.

Thanks


texts: how to edit quantity in cart with ajax magento 2?

texts:
I'd like to know how to change the quantity of a product on front using ajax ?

When I change the quantity in the input and them click on the small pencil to apply modification, I'm redirected to the page of the product.

How do I change that ?


texts: Magento 2: CSV Importing issue ,import successfully and did't show any products

texts:
While importing product CSV Magento didn’t give any error and import successfully. but didn’t show any products on customer view.

If products already added it didn’t update the product content.
I also have remove cache, re-indexing, browser cache also use in incognito  but no success.


texts:
I have started using Grunt, but encountered an issue. I am trying to change styles in custom theme via one of the LESS files, but nothing happens. It worked once, but it doesn't now, and I don't know why.

Task: change _grid-col.less
Result expected: style change on front-end.
Current result: style changes on front-end from an earlier customization (but not from the last).

Here's what I've tried:

Set Magento Dev mode;
clear directories var/di/, var/generation/, /var/view_preprocessed/,  , /pub/static/frontend/Codazon/
flush cache
change _grid-col.less
grunt clean:outdoor
grunt exec:outdoor
grunt less:outdoor --force (force because the theme has some errors. That didn't prevent it from working earlier...)

Also, I tried:
- setup:static-content:deploy --theme Codazon/fastest_outdoor lt_LT en_GB
- clear browser cache

Here is my themes.js file for Grunt:

    module.exports = {
    outdoorlt: {
       area: 'frontend',
        name: 'Codazon/fastest_outdoor',
        locale: 'lt_LT',
        files: [
            'css/source/_theme',
            'css/source/_variables',
            'css/source/layout/_blocksidebar',
            'css/source/layout/_footer',
            'css/source/layout/_header',
            'css/source/layout/_slider',
            'css/source/layout/_homestore',
            'css/email-fonts',
          'css/source/components/_modals_extend',
            'css/source/_sources'
        ],
        dsl: 'less'
    },
    outdoor: {
       area: 'frontend',
        name: 'Codazon/fastest_outdoor',
        locale: 'en_GB',
        files: [
            'css/source/_theme',
            'css/source/_variables',
            'css/source/layout/_blocksidebar',
            'css/source/layout/_footer',
            'css/source/layout/_header',
            'css/source/layout/_slider',
            'css/source/layout/_homestore',
            'css/email-fonts',
            'css/source/components/_modals_extend',
            'css/source/_sources'
        ],
        dsl: 'less'
    }
};

  'css/email-fonts',
  'css/source/components/_modals_extend',
  'css/source/_sources' are from parent theme. _grid-col.less is imported via _sources.less

I recently changed the workflow to client-side, but that didn't help.


texts:
I have two queries,

1.

{
    $select = $this->_getReadAdapter()->select()->from(array('main_table' => $this->getMainStoreTable($category->getStoreId())), array('main_table.entity_id', 'main_table.name'))->where('main_table.entity_id IN (?)', array_reverse(explode(',', $category->getPathInStore())));
    if ($isActive) {
        $select->where('main_table.is_active = ?', '1');
    }
    $select->order('main_table.path ASC');
}

And then 2:

{
    $select->joinLeft(array('url_rewrite' => $this->_resource->getTableName('core/url_rewrite')), 'url_rewrite.category_id=main_table.entity_id AND url_rewrite.is_system=1 AND ' .$this->_connection->quoteInto('url_rewrite.store_id = ? AND ', (int)$storeId) .$this->_connection->prepareSqlCondition('url_rewrite.id_path', array('like' => 'category/%')), array('request_path' => 'url_rewrite.request_path'));
}

Now in this join, I want to add use index for join(index). So is it possible to form such queries in Magento some how so that resulting query can look like -

{
    SELECT `main_table`.`entity_id`, `main_table`.`name`, `url_rewrite`.`request_path` FROM   `catalog_category_flat_store_2` AS `main_table` LEFT JOIN `core_url_rewrite` AS `url_rewrite` USE INDEX FOR JOIN (unq_core_url_rewrite_id_path_is_system_store_id) ON url_rewrite.category_id = main_table.entity_id AND url_rewrite.is_system = 1 AND url_rewrite.store_id = 2 AND url_rewrite.id_path LIKE 'category/%'
    WHERE  ( main_table.entity_id IN ( '10', '35' ) ) AND ( main_table.is_active = '1' ) ORDER  BY `main_table`.`path` ASC;
}


texts: Magento 2. Populate New Billing Address Form with default billing address values

texts:
If a customer has a default billing address I would want to populate the checkout > billing step > new address > form with the those values.

I found all the html and JavaScript files that are used to generate the billing step. I would prefer to do this from php.

Where to start. Any advice?


texts: How to login saperately from magento frontend using admin credential?

texts:
I have created users with respective their permissions from Magento admin panel. Now I need to login these users from Magento frontend...

(Kindly note that customer login is different part. I need separate button on Magento frontend for user login)


texts: How to get all the attributes and show in the dropdown field in a backend form in magento 2

texts:
I have created backend form which  has one dropdown field.
How Do I get all the attributes and show it in a dropdown in magento 2


texts:
Fields not getting values in return array.

        $0.00

Please, someone, review my code.

public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total)
{

   global $value1;
   $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   $customerSession = $objectManager->get('Magento\Customer\Model\Session');
   $customerSession->setValue($value1); //set value in customer session
  $vluas= $customerSession->getValue($value1);
  //print_r($vluas);

  //echo $vluas;

    return [
        'code' => 'fee',
        'title' => 'Fee',
        'value' => $vluas
    ];

}


texts: Change product page details for configurable products

texts:
I have these configurable poducts with a single option wich changes just an attribute and maybe the price, but of course the tabs like details, reviews and another custom tab I made does not change whenone of the option. I select
What I want to accomplish is that my custom tab, the details tab and any other tab that I may like changes when changing the selected option. I think it's doable since in the backend each virtual product has its own description and itìs own attributes just like the configurable base one.
I think I may have to create a module with some javascirpt inside.
I hope I explained it well. Thanks in advance to who can help me


texts: Adding an attribute programmatically in Magento 2.1

texts:
I am creating a product attribute for sorting which will be int type :
where I am getting following error:

  PHP Fatal error:
  Uncaught Error: Class 'Magento\Catalog\Model\Resource\Eav\Attribute'
  not found in /opt/bitnami/apps/magento/htdocs/app/code
  /Vendor/Module/Setup/InstallData.php:57

Here is my Vendor/Module/Setup/InstallData.php

<?php

namespace Vendor\Module\Setup;

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

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

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

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

        /**
         * Add attributes to the eav/attribute
         */

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


texts: Demac Canada Post Plugin - "Cannot connect to host"

texts:
On March 10th, 2018, Canada Post changed the way plugins connect to their API.

The Magento plugin - Demac Canada Post Shipping - stopped working and started to show error "Cannot connect to host".

I decided to add solution on Stackoverflow, because Canada Post forum is not a public forum and requires login to see the solutions.

NOTE FROM OTHERS: The solution posted below does not seem to work to fix the backend issue to be able to generate a manifest.

NOTE FROM ME: we dont use the manifest function, so I did not test it. I believe that function was always broken on Demac plugin and was throwing 400 from time to time. If anybody has a solution let me know.


texts: Magento 2.3 Overiding Invoice PDF not working

texts:
I want to edit my Invoice in Magento 2.3. I have copied the file from the core file.

  app\Vendor\Magento\magento-sales\Model\Order\Pdf\Invoice.php

To :

  app\design\frontend{Theme}{Name}\Magento_Sales\Model\Order\Pdf\Invoice.php

Changes I have made in my custom theme PDF file(Invoice.php) it's not reflecting in the PDF.

Please let me know is there anything else I have to change.

Thanks.


texts:
We recently noticed that SOMETIMES we get 404 page when trying to enter some product. And it happens one in 100 times or so. We don't even know where to start to debug this problem. Because system.log and exception.log doesn't show anything.
Anyone have any ideas how to even start to debug this?
Please help!


texts: How to get all products info from database by SQL Query in Magento 2.3?

texts:
I want to get the below data of all products by SQL Query.

SKU
Product name
Website
Attribute set
Quantity per source
Sellable quantity
visibility
Price
Status

I have used this extension:
https://github.com/degdigital/magento2-customreports This
extension has functionality to get the CSV report by SQL query. So I want to
get product reports by SQL Query.

Any Help much appreciated!


texts: When I go to Store settings, among other pages it always redirect to dashboard. no errors browser, no errors in log files, so I dont know how to even get hints. any suggestion on how I can debug this please?


texts:
I am totally new to Magento. Still learning, so I am confused about where to start off when I have to do something new.

I have to add just another input field in the checkout that gets saved in the order and displayed in the back-end.

So can someone give me directions? It can probably be implemented in an existing extension, but I don’t really have a clue. Any help and explanation will be greatly appreciated.

UPDATE:
For example, I need to take the number of the customer (when he places and order/checks out), save this number and display it in the Order view in the back-end.

What I suppose needs to be done is that I have to fetch this number from the front-end, fire an event which will call a function (from the Observer class) that will set the value of this fetched number into the field in the back-end. But before all that I guess I have to install a script to add this "Customer Number" field in the Order view in the back-end.


texts: Magento Design Exceptions - switching back to desktop

texts:
I am using Magento's design exceptions to set the theme as mobile for mobile devices.

Since I am not using a separate store view or website, is it possible to provide to the user a 'Switch to Desktop' link? I guess I would need to override a controller somewhere, would appreciate anyone that can help me out with a starting point.


texts: Magento 2 : get second level categories of parent category except default category by using block?

texts:
Like we have Women category

1.Women
 1.1 Tops
 1.2.Bottoms

I want to display Women and 2nd level of that category.

which libraries used to get subcategory?

My requirement is :


texts: How to add amazon and paypal buttons in the one page checkout module in magento 2?

texts: We have to display Amazon button as a separate block in the checkout page, how can we achieve this?


texts: Changes made in web template do not show on frontend?

texts:
I am using Magento 2.2.3 and I am modifying a template from a custom extension. That path to the template is app/code/Foo/Osc/view/frontend/web/template/container/address/billing/create.html

I am just adding another class or some plain HTML, but after recompiling, redeploying and cleaning caches, the changes are not reflecting on the frontend. I even deleted var/view_preprocessed.

Is there something else that has to be done?

Thanks


texts: Creating shipment programatically issue in Magento 2

texts:
I am facing an issue with creating a shipment programatically. This is my code:
    // Magento\Sales\Model\Convert\Order
    $shipment = $this->convertOrder->toShipment($order);
    foreach ($order->getAllItems() AS $orderItem) {
        if (!$orderItem->getQtyToShip() || $orderItem->getIsVirtual()) {
            continue;
        }

        $shipmentItem = $this->convertOrder->itemToShipmentItem($orderItem)->setQty($orderItem->getQtyToShip());
        $shipment->addItem($shipmentItem);
    }
    $shipment->register();
    try{
         //Magento\Sales\Api\ShipmentRepositoryInterface
         $this->shipmentRepositoryInterface->save($shipment);
    }catch (Exception $exception) {
        $this->logger->error(sprintf($exception->getMessage()))
    }

The script above, works, I got my shipment, but I still have the Ship button:

I would expect that button to be no longer available, once I created a shipment.
Any idea what am I doing wrong ? with my script . Thank you


texts: Cannot create plugin for stock resource model's correctItemsQty

texts:
I want to be able to observe any product's stock changing in any way, without having to do so with database triggers.

In Magento 1.x the lowest level I could find that does this consistently is the Stock Item's resource model correctItemsQty method that actually writes product quantities to the database.

In Magento 2.x, I've tried to create a plugin for \Magento\CatalogInventory\Model\ResourceModel\Stock::correctItemsQty in the form of MyPlugin::afterCorrectItemsQty. The configuration for the plugin is pretty standard:

<type name="Magento\CatalogInventory\Model\ResourceModel\Stock">
    <plugin name="my_stock_item_plugin"
        type="My\Company\Plugin\StockPlugin"
        sortOrder="100" />
</type>

My method just for testing just has a die('plugged in') in it.

After setup:di:compile and clearing cache, this doesn't run when I place an order in the frontend or admin, ship an order, credit memo an order etc. (In Magento 1.x this method does fire).

To eliminate my plugin being the problem I added my die call into the top of the core method in the core magento-catalog-inventory module, but it's still not executing.

Am I missing something here? Has there been a behavioural change that means that this method doesn't get called when you place an order (for example)?

Aside from that, is there a better way that I can observe all product stock changes in Magento 2?

Disclaimer: I've seen this question and this core bug. This code is for a module, so I don't have the liberty to wait for the core fix to be released, or monkey patch it in. I've also checked from my docker container that my changes are syncing through (they are) to ensure it's not a local filesync problem.


texts: Magento 2 : How to put reorder link programmatically? show on particular order

texts:
How to put reorder link in magento 2 programmatically?
I have find record and last column show reorder link how to in magento 2?


texts: Do we need to configure SMTP on our server if using external smtp?

texts:
i'm using mageplaza's SMTP extension for magento 2.

https://www.mageplaza.com/magento-2-smtp/

I have configured the smtp with smtp.office365.com and when sending the test email it is giving following error.

  Could not open socket: stream_socket_client(): unable to connect to
  tcp://smtp.office365.com:587 (Permission denied)

So is this issue on server settings or in magento side ?
Also i have setup the linux server for the magento installation.
Do need to install configure the SMTP for this server also ?


texts: How to Add New Fields on Registration page?

texts: How to add a new field for the registration page in Magento 2?


texts: No images after installation Magento 2.2.2

texts:
I installed the latest version of magento 2.2.2

After this no images displayed and JS no works.

I run some commands but still not work.

php bin/magento setup:static-content:deploy -f

next:

delete folder pub/static without .httaccess

and in app/etc/di.xml change line:

symlink to copy

Still not work


texts: Upgrade magento2.3.0 to 2.4.1- allowed memory error

texts:
I followed below steps:
Part 1:
php bin/magento deploy:mode:set developer
php bin/magento cache:disable
php bin/magento maintenance:enable
composer require magento/product-community-edition 2.4.1 --no-update
composer update

After composer update, got error message
I added memory limit=-1 in php.ini file.
Please advise.


texts: Magento 2.3.0 custom cron job is not working

texts:
Magento 2 custom corn is not working in my custom module.

  app/code/Namespace/ModuleName/etc/crontab.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">

<group id="default">
    <job name="review_reminder_cronjob" instance="Namespace\Modulename\Cron\ReminderEmail" method="execute">
        <schedule>* * * * *</schedule>
    </job>
</group>
</config>

  app/code/Namespace/Modulename/Cron/ReminderEmail.php

<?php
namespace Namespace\Modulename\Cron;

use Psr\Log\LoggerInterface;

class ReminderEmail
{
    /**
    * Write to system.log
    *
    * @return void
    */

    public function execute()
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('Test cron worked successfully');
    }
}

Run below command :

  php bin/magento cron:run

Something is missing or wrong in the code above. can anyone help me to solve out this?

I have already tried below way.

HOW TO SET AND CONFIGURE CUSTOM CRON JOBS IN MAGENTO 2?
Configure a custom cron job and cron

Edit : In my database cron status is Missed or Error

Any help would be appreciated!


texts: Magneto 2 : How to Integrate my Magento store into Jet Marketplace?

texts:
I have Magento Store and looking for integration of jet.com for my product listing page. Is this possible way to do this?  Please suggest me. Other things I have India based website.

I hope that anyone have this solution .

Thank you.


texts: How can I add the %-character in magento 2?

texts:
I'm trying to add some content in a page in my admin panel, but when I am trying to insert the character % this error is displayed:

error: error in [unknown object].fireEvent(): event name: tinymceChange error message: URI malformed

Is there any way to insert the %-character?


texts: Category and Attribute relationships and possible circular logic

texts:
I have a Magento storefront that is selling different colored rubber balls. I have the following categories:

Product
   Ball
      Red
      Green
      Blue

I have the following attributes:

Ball Color
   Red
   Green
   Blue

I also have products:

Ball1
Ball2
Ball3

I've given Ball1 the "Red" attribute, Ball2 the "Green" attribute and Ball3 the "Blue" attribute.

Before I started adding categories to the rubber balls the categories pages were loading fine. Once I've started adding categories however pages with multiple categories has been whitescreening with the following apache error message:

[Tue Aug 11 10:19:43 2015] [notice] child pid 50799 exit signal Segmentation fault (11)

My question is, are categories and attributes somehow complexly intertwined? Is there a circular link between categories and attributes that is causing this crash? My belief is attributes are used as filters on the left navigation pane while the menu is used to see the categories for the product.

Thanks in advance.


texts:
I have added the plugin of conekta, but when you try to enter "Payment Methods" says that there is an error with the 500 error page. In the logs said this:

Error   187.189.50.7    500 GET /index.php/admin/system_config/edit/section/payment/key/9730b5c8b995abc9ded1683acac9ea19/ HTTP/1.0

Warning 187.189.50.7        mod_fcgid: stderr: PHP Fatal error: Can't use function return value in write context in /var/www/vhosts/domain.com/httpdocs/app/code/community/Conekta/Webhook/Block/Adminhtml/System/Config/Url.php on line 36, referer: http://domain.com/index.php/admin/system_config/index/key/70711712bcc676261f6ea32715cafe34/

How do I resolve this?


texts: Magento 2: How to display the list of manufacturers in a drop-down

texts:
i have a dropdown ui-component in which i want to display a list of manufacturers.
In the example below, i have a working drop-down with shipping methods.
<field name="manufacturer_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Shipping\Model\Config\Source\Allmethods</item>
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
            <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
            <item name="disableLabel" xsi:type="boolean">true</item>
            <item name="multiple" xsi:type="boolean">false</item>
            <item name="label" xsi:type="string" translate="true">Manufacturer</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>

Is there an easy way of passing a class instead of Magento\Shipping\Model\Config\Source\Allmethods to get the list of manufacturers?
From this answer, getting the manufacturers is done via product attributes
$om = \Magento\Framework\App\ObjectManager::getInstance();

/** @var \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute */
$attribute = $om->get(\Magento\Catalog\Api\ProductAttributeRepositoryInterface::class)
    ->get('manufacturer');

foreach ($attribute->getOptions() as $option) {
     var_dump($option->getValue() . ' -> ' . $option->getLabel());
}

But how do i assign this data to my drop-down (and in what format?) ?
Thank you.


texts: How to move "The shipping and billing addresses are the same" checkbox to billing step in Magento 2

texts:
In my website,On one page checkout, the "My billing and shipping address are the same" section is showing after the payment method. I want it to show below the Billing address. The payment method will stay at its own place. I just want to move the checkbox into the billing address section.
How can I achieve this?


texts: Invalid Block issue in rewrite Sales Order Grid in Magento 1.8

texts:
I am getting error of Invalid block on Live site but same code is working in Local system. Can anyone help me in getting out from this ASAP.

Below is my code:

Config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Wildnet_Customsalesgrid>
      <version>0.1.0</version>
    </Wildnet_Customsalesgrid>
  </modules>
  <global>
    <helpers>
      <customsalesgrid>
        <class>Wildnet_Customsalesgrid_Helper</class>
      </customsalesgrid>
    </helpers>
    <events>
        <sales_order_grid_collection_load_before>
            <observers>
                <customsalesgrid>
                    <type>model</type>
                    <class>Wildnet_Customsalesgrid_Model_Observer</class>
                    <method>salesOrderGridCollectionLoadBefore</method>
                </customsalesgrid>
            </observers>
        </sales_order_grid_collection_load_before>
    </events>
    <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_grid>Wildnet_Customsalesgrid_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
            </rewrite>
        </adminhtml>
    </blocks>
  </global>
</config>

Grid.php

<?php

class Wildnet_Customsalesgrid_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid {

    protected function _prepareColumns() {

        $this->addColumnAfter('customer_email', array(
                'header' => Mage::helper('customer')->__('Customer Email'),
                'index' => 'email',
                'type' => 'text',
        ), 'shipping_name');

        return parent::_prepareColumns();
    }

}

Observer.php

<?php

class Wildnet_Customsalesgrid_Model_Observer
{

   public function salesOrderGridCollectionLoadBefore(Varien_Event_Observer $observer) {

       /** @var Mage_Sales_Model_Resource_Order_Grid_Collection $collection */
       $collection = $observer->getEvent()->getOrderGridCollection();

       $collection->getSelect()->join(
           array('customer_table' => $collection->getTable('customer/entity')),
           'main_table.customer_id = customer_table.entity_id',
           'email'
       );
   }
}

This code is working fine in local without any issue but in Live it is showing Invalid block error.


texts:
I have this MailChimp embed script (for a subscribe popup) that I want to use on all the pages in my Magento 1 installation, except for one CMS page (because it already contains an embed script for a subscribe popup).

Normally, I would add this script to the 'Miscellaneous Scripts' option in System > Configuration > Design. How can I solve this the right way?


texts: Change product options templates in layout XML (in module)

texts:
I'm trying to change product options templates :

<block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
    <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
    <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
</block>

In my module, I try several methods:

<referenceBlock name="text" template="Vendor_Module::path/to/newfile.phtml" />

--

<referenceBlock name="text">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Vendor_Module::path/to/newfile.phtml</argument>
    </action>
</referenceBlock>

--

<referenceBlock name="text">
    <arguments>
        <argument name="template" xsi:type="string">Vendor_Module::path/to/newfile.phtml</argument>
    </arguments>
</referenceBlock>

This one is really weird

To check, i try with name = "copyright", and it works...

How can I do it with product options templates ?

Note : The changes that will be made in the templates are not for appearance.

Excuse my english


texts: Can anyone tell me in magneto 1.9, How can we configure different prices for same products when it is in two different storeviews of a website?

texts:
Can anyone tell me in Magento 1.9, How can we configure different prices for products when it is in two different store views of a website?
(Please note Single website with multiple store and multiple store views)


texts: Moving 'category-view' div out of 'column-main'

texts:
Using Magento 2.3.2.

I want to move the category-view div out of the column-main div whilst still keeping it under the columns div. So it is a sub-div of columns (like column-main) rather than a sub-div of column-main itself.

I essentially need the sidebar, category details, and product grid as three separate divs that I can order.

At the moment column-main is one entity that I can either place the sidebar before or after in mobile breakpoints.

That is a really convoluted way of saying:
I want to be able to place the sidebar (filter) in-between the category details and the product grid in mobile breakpoints.

Any help would be gratefully received.
Thank you.


texts:
My magento server (live) not sending any emails
I try several methods to fixed this but anything doesn't work
I correctly set Cron on my server its running every 5 minutes.
here is what I do So far

Try Editing cron.php

After the line:

$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;

Add the following:

$isShellDisabled = true;

not working for me.

try instaling AOE scheduler it shows success but not sending any emails

try editing Template.php
Template.php is located in:

/app/code/core/Mage/Core/Model/Email/Template.php

Commenting below code

if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
    /** @var $emailQueue Mage_Core_Model_Email_Queue */
        $emailQueue = $this->getQueue();
        $emailQueue->setMessageBody($text);
        $emailQueue->setMessageParameters(array(
                'subject'           => $subject,
                'return_path_email' => $returnPathEmail,
                'is_plain'          => $this->isPlain(),
                'from_email'        => $this->getSenderEmail(),
                'from_name'         => $this->getSenderName(),
                'reply_to'          => $this->getMail()->getReplyTo(),
                'return_to'         => $this->getMail()->getReturnPath(),
            ))
            ->addRecipients($emails, $names, Mage_Core_Model_Email_Queue::EMAIL_TYPE_TO)
            ->addRecipients($this->_bccEmails, array(), Mage_Core_Model_Email_Queue::EMAIL_TYPE_BCC);
        $emailQueue->addMessageToQueue();
        return true;
    }

also try

app/code/core/Mage/Sales/Model/Order.php

changing lines

//$mailer->setQueue($emailQueue)->send(); Change To

 $mailer->send();

I also check sending simple mail using php mail its working

EDIT
Also checked SMTP data
under ****System > Configuration->Advanced > System.**
also correct details**

I don't no what is the issue.
Also try truncating core_email_queue and core_email_queue_recipients
tables


texts: Can't edit Magento 1.9 product after import. Only showing sidebar

texts:
So i've been tasked with added another variant into our current magento export sheet. After taking one of the products as a test item and making sure all fields and areas were successfully filled i took it to magento to the import tab and got the all clear. However since this alteration to the product, i cannot access anything except the sidebar.

I've looked over the csv and can't find any fault in any empty cells and i'm pretty sure i've filled it out correctly.

The example csv itself can be checked here

If anyone has any ideas, please let me know. I'll be playing with this for the next little while to figure out whats gone wrong.


texts: Magento 2: Recalculate shipping methods when State/Province changes

texts:
On step 1 (Shipping) of the checkout process, some of the fields - such as Zip/Postal Code - trigger re-evaluation of the list of available shipping methods.

I have a custom plugin in place that disables Free Shipping if the user chooses a non mainland-US state. Unfortunately, the "State/Province" select box does not trigger the AJAX call to "estimate-shipping-methods" which is needed to rebuild the list of shipping methods.

Does anyone know how to attach this event to the select box? I DON'T want a hacky answer like using jQuery to trigger onkeyup/onchange on one of the fields that already has the event attached to it.


texts: Get Quote ID from an Order ID or Order Number SQL?

texts:
I need to query the Magento MySQL database to get an image path/name for a file.

What I have:

Order ID
Order Number

What I need:

I need to get the image name/path from this table sales_flat_quote_item_option

From what I can see so far following the foreign keys that lead to this table.  I seem none of them use the order ID or order number as they all descend from the sales_flat_quote table instead of the sales_flat_order table.

Does anyone know of a fancy query I could use to get a value from the sales_flat_quote_item_option table by using what I have, order ID and number?

If I can simply get the Quote ID from my Order ID/Number then I can doing a join SQL query using the Quote ID to get my record from the sales_flat_quote_item_option table.

I have to do this with SQL instead of Magento Models as it will be ran outside of Magento in a separate application.


texts: Costume Redirect Controller to other site not working

texts:
I have written custom redirect controller to for affiliate site but it is not working.

Following is my code:
Helper

namespace Test\AffiliateProduct\Helper;

class Data extends \Magento\Framework\App\Helper\AbstractHelper {

    public function __construct( \Magento\Framework\App\Helper\Context $context) {
        parent::__construct(
            $context
        );
    }

    public function getRedirectUrl(\Magento\Catalog\Model\Product $product) {
        return Mage::getUrl('affiliate/redirect/product', array('id' => $product->getId()));
    }
}

Controller

namespace Test\AffiliateProduct\Controller;

class Redirect extends \Magento\Framework\App\Action\Action {
    protected $affiliateProductHelper;
    protected $scopeConfig;
    protected $customerSession;
    protected $generic;
    protected $catalogProductFactory;
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \OfferDeal\AffiliateProduct\Helper\Data $affiliateProductHelper,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Framework\Session\Generic $generic,
        \Magento\Catalog\Model\ProductFactory $catalogProductFactory
    ) {
        parent::__construct(
            $context
        );
        $this->affiliateProductHelper = $affiliateProductHelper;
        $this->scopeConfig = $scopeConfig;
        $this->customerSession = $customerSession;
        $this->generic = $generic;
        $this->catalogProductFactory = $catalogProductFactory;

    }
    public function execute()
    {
        $productId  = (int) $this->getRequest()->getParam('id');

        $product = $this->catalogProductFactory->create()->load($productId);

        if (($product instanceof \Magento\Catalog\Model\Product)
            && ($product->getTypeId() === \Test\AffiliateProduct\Model\Product\Type::TYPE_AFFILIATE)
        ) {
            if (!\Zend_Uri::check($product->getAffiliateLink())) {
                $this->generic->addError(
                    $this->helper->__('The partner product is not accessible.')
                );

                $this->goBack();
                return;
            }

            return $this->resultRedirectFactory->create()->setUrl($product->getAffiliateLink());

            //$this->getResponse()->setRedirect($product->getAffiliateLink());
            //return;

        } else {
            $this->generic->addError(
                $this->helper->__('Affiliate product not found')
            );

            $this->goBack();
            return;
        }

    }
    protected function goBack()
    {
        $returnUrl = $this->_getRefererUrl();

        if ($returnUrl) {
            $this->getResponse()->setRedirect($returnUrl);
        } else {
            $this->_redirect('checkout/cart');
        }

        return $this;
    }

}

View
Add to Cart phtml

<?php $_product = $block->getProduct(); ?>
<?php $buttonTitle = __('Shop Now'); ?>
<?php if ($_product->isSaleable()): ?>
<?php $helper = $this->helper('Test\AffiliateProduct\Helper\Data'); ?>

        <button type="button" class="button btn-cart" onclick="javascript:window.location.href='<?php
            echo helper->getRedirectUrl($_product);?>'; return false;">
            <?php echo $buttonTitle ?>
        </button>
        <?php echo $this->getChildHtml('', true, true) ?>

<?php endif; ?>

Can someone help in figureing out what is wrong with for Magento 2 redirect controller?


texts:
we get the below error when we install Intercom on Magento 2.3.3 ver problem

https://i.ibb.co/qxSbXSX/2019-12-06-124841.jpg


texts: Magento 1.9 - Discount Breakdown in Multiple Lines

texts:
I am currently looking for a way to display multiple discounts in separate lines in the Magento shopping cart without having to buy an extension..

Currently I have a negative discount applied as "Shipping Insurance" based on cart rules - example - if the subtotal is 2000-2500, add surcharge of $12.60 for shipping insurance.

This part works fine...

Screenshots:
http://imgur.com/a/GoqUH

Now I want to offer the customer a 10% off coupon using code "10OFF"

When applied, i'd like it to show up as a seperate line item and display the discount breakdown, but instead it gets combined into shipping insurance (my discount label)

Is there any way to get it to break out in multiple lines? To show Shipping Insurance as a surcharge on line 1, and the next line show the 10% Off discount calculation?

ex:
Shipping Insurance: $XX.XX
10% Off discount: -$XX.XX

I'm on magento 1.9.1.1 using the RWD theme.

Anyone have experience doing so - any help would be appreciated.

Thanks!


texts:
There are several products of different brands in my Site of Magento 1.8.1.0. If I try to find out products of savina using URL beautycare.com/catalogsearch/result/?q=savina I am getting products of savina. But if I try to find out products of ibd using URL beautycare.com/catalogsearch/result/?q=ibd I am getting a blank page without any product with message Your search returns no results.

Why it is happening ? How can I solve the issue.


texts:
Using cdn77 which does not have the ability to set cross origin on that end so I need to update the htaccess of the store.

I have updated the pub/static/.htaccess to include fonts setting

  Header set Access-Control-Allow-Origin "*"

I intend to limit this to the specific cdn subdomain once I can get the wildcard working properly.

<IfModule mod_headers.c>

    <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$>
        Header append Cache-Control public
    </FilesMatch>

    # set cross origin for fonts
    <FilesMatch .*\.(ttf|otf|eot|woff|woff2)$>
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>

    <FilesMatch .*\.(zip|gz|gzip|bz2|csv|xml)$>
        Header append Cache-Control no-store
    </FilesMatch>

</IfModule>

I have purged all the files from the CDN multiple times and can confirm that they have in fact been purged but I am still receiving the following:

  16:05:34.656 downloadable font: download failed (font-family:
  "icons-blank-theme" style:normal weight:normal stretch:normal src
  index:3): bad URI or cross-site access not allowed source:
  https://xxxxxxx.rsc.cdn77.org/static/version1493759129/frontend/Customdev/themeone/en_US/fonts/Blank-Theme-Icons/Blank-Theme-Icons.ttf
  1 styles-m.css:3298:12

This is being returned for all references of ttf, woff and woff2 fonts embedded by default in Magento 2's blank theme even with the wildcard set for the origin. Any advice on where I am going wrong would be greatly appreciated.

Edit: I wanted to confirm that the file is in place. We can access it via the cdn url and it downloads.


texts: How to save value to custom fields in sales_shipment_item table?

texts:
I have added custom fields in sales_shipment_item table. I just want to save a value in that custom fields on a particular event.
How can I do it?


texts:
I have added multiple currencies for single store and all working good except a issue in drop-down. The currency code displaying the same currency code which is default name.

if default code is EUR then EUR will display in all drop-down and if changed the US will display in all drop-down. Though all working good but name displaying same in drop-down.

Magento version: 1.9.2.2


texts: How to Customise Header for guest and logged in user in magento2 programmatically?

texts:
I want different top header section for guest and login user.

  Guest user header option

  "Hi Guest" + sign-in option

  Login user header option

  "Hi [User Name]"

How do I perform it programmatically?


texts: Can we run magento without doing indexing (for any index) we have large catalog size around (2M)

texts:
We want to use magento store without doing indexing.

Is this possible. Actually issue is that our magento CE is taking much more time in doing re-indexing.

Please suggest on same.


texts: How to send customer password in welcome mail in magento 2

texts:
I know customer's password has been removed from Magento 2 for security reasons but it is requirement.

Default Magento 2 not provide a password with new account email. but we have required password in the welcome email.

Default Magento 2 Mail Template:

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

{{trans "%name," name=$customer.name}}

{{trans "Welcome to %store_name." store_name=$store.getFrontendName()}}

    {{trans
        'To sign in to our site, use these credentials during checkout or on the My Account page:'

        customer_url=$this.getUrl($store,'customer/account/',[_nosid:1])
    |raw}}

        {{trans "Email:"}}
        {{var customer.email}}

        {{trans "Password:"}}
        {{trans "Password you set when creating account"}}

I want: {{var customer.password}}

But the issue is that password is not setting in the mail.

Can you please let me know how I can set customer password in the mail template or any other solution.


texts: Fatal error: Allowed memory size of 536870912 bytes exhausted when importing orders

texts:
we are using this extension : https://www.magentocommerce.com/magento-connect/bulk-import-export-orders-to-csv.html

when we try to import one order , its working fine.

when we trying to import the more orders, we are getting this error :

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 66 bytes) in /var/www/html/sitename/lib/Zend/Log/Formatter/Simple.php on line 103

but exporting is fine.

please help me to find solution


texts: Woo-commerce product attributes via Range Slider in wordoress

texts: How to create attribute range slider?. Please check the screenshot url http://nimb.ws/JGo25i


texts:
I ship world wide and would like to add shipping and tariff charges under a different system.
How can I take an order and leave Shipping to be deterrented. The buyer can pay for the whole order less shipping. We will email shipping Charges and tariffs for customers approval.
This is only on orders not served by UPS.

Can this be done?


texts: How to pass a block with 2 variables (in a CMS page) to a phtml file?

texts:
I have some block in CMS page, I want to move it in .phtml file, but I don't know how to parse these variables(category_id="12", count_products="4"), and from where these variables are coming? from a block right ?

CMS block:

{{block type="products/blocks_products" category_id="12" count_products="4" template="custom/list2.phtml"}}

.phtml:

<?php echo Mage::app()->getLayout()->createBlock('products/blocks_products')->setTemplate('custom/list2.phtml')->toHtml(); ?>


texts: How we can delete Magento 2 order programmatically?

texts: I want to delete orders and associated data from my store programmatically. Share any idea, How can we do that?


texts: Magento redirection to paypal stuck at redirection message page

texts:
I'm working with Magento ver. 1.8.1.0 with this "shopper" theme. I am having a problem with paypal integration. Specifically "paypal websites payment standard" module.

The problem is that my webshop is stucked at the redirection message page and it's not continuing to paypal. Screenshot:


texts: Magento Data MIgration Tool for 1.9.2.2 to 2 - Mismatch of entities in the document

texts:
I'm trying to upgrade to Magento 2, but hit another roadblock. I'm currently getting an error of

  [ERROR]: Mismatch of entities in the document: eav_attribute_group

What is my next step for troubleshooting?

I have very little experience with Magento, please give me the dumbed down version if possible.

Thanks!

I also do have this map file, if it matters.

<group name="ignore">
    <attribute>msrp_enabled</attribute>
    <attribute>group_price</attribute>
    <attribute>umm_cat_label</attribute>
    <attribute>umm_dd_type</attribute>
    <attribute>umm_dd_proportions</attribute>
    <attribute>umm_dd_columns</attribute>
    <attribute>umm_dd_blocks</attribute>
</group>


texts: Copying data between tables via PHP not working?

texts:
I've got a particular need to copy data from catalog_product_entity_varchar into catalog_product_entity_decimal for a particular attribute in Magento

I'm currently running a script in PHP with the following code:

$sql1 =     (" Insert into `catalog_product_entity_varchar` (`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`)

            select `entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value` from `catalog_product_entity_decimal`

            where   `attribute_id` = '230' ");

mysql_query($sql1);

$sql2 = ("DELETE FROM `catalog_product_entity_decimal` where `attribute_id` = '230' ");
mysql_query($sql2);

the statements work if entered directly in MySQL, however when executed via PHP they fail - am I missing something?


texts:
I am facing an interesting issue. I have some custom cronjobs. If I run them manually with magerun2 (n98-magerun), they will be executed with success. If I let Magento to schedule it and execute it, sometimes the cronjob will NOT run. For example, using a tool like Amasty cron tasks, I see that the cronjob is pending. After 2 hours I refresh the page and I don't see any information related to my cronjob (neither in the cron_schedule table or in the var/log/cron.log).
Checking out also the magento.cron.log , I saw the following:
SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to
  get lock; try restarting transaction, query was: DELETE FROM `cron_schedule
  ` WHERE (status = 'error') AND (job_code in ('indexer_reindex_all_invalid',
   'indexer_update_all_views', 'indexer_clean_all_changelogs')) AND (created_
  at < '2021-02-02 08:05:07')

The status from where condition, sometimes is pending, sometimes is success, sometimes, like in the above example is error or
    SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to
  get lock; try restarting transaction

I found this POST from Magento issues and they said that it is fixed in Magento version 2.3.5, after they changed their mind and they said, it is fixed with Magento: 2.4.1  and the last post is saying that it will be fixed in Magento: 2.4.3. Mostly likely, they will say that it will be fixed in version 2.X.X. Currently, I am running on Magento 2.3.4. Any idea what can I do to prevent this deadlock to happen anymore?
Thank you


texts: How to include two submenus of same namespace extension in Magento 2?

texts:
I have two extensions:

ProductPricing

NfusionWidgets

Both extensions are in same namespaces called: Nfusionsolutions

Both extension have some settings in back end so I have created menu on which admin can click and configure settings.
Please see screenshot.

I have put following code in menu.xml file in "ProductPricing" extension to get this result.

 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
    <add id="Nfusionsolutions_ProductPricing::nfusion_solutions"
         title="nFusion Solutions"
         module="Nfusionsolutions_ProductPricing"
         sortOrder="9999"
         resource="Magento_Backend::content"
    />
    <!-- START: new node -->
    <add id="Nfusionsolutions_ProductPricing::product_pricing"
         title="Product Pricing"
         module="Nfusionsolutions_ProductPricing"
         sortOrder="9999"
         resource="Magento_Backend::content"

         parent="Nfusionsolutions_ProductPricing::nfusion_solutions"
         action="adminhtml/system_config/edit/section/nfusionsolutions_productpricing"
        />
    <!-- END:   new node -->
</menu>

Now I want a new submenu should come just below the first submenu for second extension like below screenshot:

I have put this code in menu.xml file in NfusionWidgets extension.

  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
    <!-- START: new node -->
    <add id="Nfusionsolutions_NfusionWidgets::nfusionwidgets"
         title="nFusion Widgets"
         module="Nfusionsolutions_NfusionWidgets"
         sortOrder="9999"
         resource="Magento_Backend::content"

         parent="Nfusionsolutions_ProductPricing::nfusion_solutions"
         action="cms/page/index"
        />
    <!-- END:   new node -->
</menu>

Please note that I have put "Nfusionsolutions_ProductPricing" in parent parameter which is giving result I want.

But problem is that if user has not installed ProductPricing extension then an error comes due to not found "Nfusionsolutions_ProductPricing" id.

How can I show both submenu if user installed both extension

How can I show "Product Pricing" submenu if user only installed "ProductPricing" extension.

How Can I show "nFusion Widgets" submenu if user only installed "NfusionWidgets" extension.


texts: How can I change the language of Magento's frontend calendar? Its a DHTML Calendar so that I can configure it in many ways. But I cant find out any multi-language options. Is there any way?


texts:
So I've updated my Magento install from 2.2.2 to 2.2.5 and now it seems all my product attributes with 'allowed HTML' turned on get escaped.

So the value for the front-end is:

Google

What gets return when opening a product page:

 &lt;a href=&quot;https://www.google.com&quot;&gt;Google&lt;/a&gt;

While the links were working before now they are broken. I've wiped all cache, resaved the product attribute, changed the product attributes, all to no avail.

Anybody got any idea what could be the problem?


texts: Magento 2 Checkout Page billing address dropdown remove show direct billing address form

texts:
Magento 2 I want to Checkout Page  billing address dropdown remove show direct billing address form.
This dropdown i want to remove

And show direct billing address form.This type

THANKS.


texts:
I am attempting to load a CMS Page from my controller.  The community here was kind enough to help me with a CMS Static Block - and now I need a pointer in the right direction for a cms Page.

What is the proper syntax to load a CMS Page by identifier or block id and what factory supports this type of loading?


texts:
I already installed and tested Redis working properly on my server. But when I added Redis required settings cache in my app/etc/env.php then my Magento 2 displays blank page. I also tried to clean cache by running this command php bin/magento cache:clean and I got errors below

  PHP Parse error:  syntax error, unexpected
  ''automatic_cleaning_factor'' (T_CONSTANT_ENCAPSED_STRING), expecting
  ')' in app/etc/env.php on line 101

Below is my env.php config:

'cache' =>
  array (
    'frontend' =>
    array (
      'default' =>
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' =>
        array (
          'server' => '127.0.0.1',
          'port' => '6379',
          'persistent' => '',
          'database' => '0',
          'password' => '',
          'force_standalone' => '0',
          'connect_retries' => '1',
          'read_timeout' => '10',
          'automatic_cleaning_factor' => '0',
          'compress_data' => '1',
          'compress_tags' => '1',
          'compress_threshold' => '20480',
          'compression_lib' => 'gzip',
          'use_lua' => '0',
        ),
      ),
      'page_cache' =>
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' =>
        array (
          'server' => '127.0.0.1',
          'port' => '6379',
          'persistent' => '',
          'database' => '1',
          'password' => '',
          'force_standalone' => '0',
          'connect_retries' => '1',
          'lifetimelimit' => '57600',
          'compress_data' => '0',
          'compress_tgs'  => '1',
          'compress_threshold' => '20480',
          'compression_lib' => 'gzip'
          'automatic_cleaning_factor' => '0',
        ),
      ),
    ),
  ),

I don't know reason why? Did I miss configuration setting in Magento or I had to disable memcached in Magento 2.

EDIT

  PHP Fatal error:  Uncaught exception 'CredisException' with message
  'Connection to Redis failed after 2 failures.Last Error : (13)
  Permission denied' in
  /var/www/magento2/vendor/colinmollenhour/credis/Client.php:448\nStack
  trace:\n#0
  /var/www/magento2/vendor/colinmollenhour/credis/Client.php(444):
  Credis_Client->connect()\n#1
  /var/www/magento2/vendor/colinmollenhour/credis/Client.php(774):
  Credis_Client->connect()\n#2
  /var/www/magento2/vendor/colinmollenhour/credis/Client.php(604):
  Credis_Client->__call('select', Array)\n#3
  /var/www/magento2/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php(144):
  Credis_Client->select(1)\n#4
  /var/www/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(153):
  Cm_Cache_Backend_Redis->__construct(Array)\n#5
  /var/www/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(94):
  Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)\n#6
  /var/www/magento2/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):
  Zend_Cache::factory('Ma in
  /var/www/magento2/vendor/colinmollenhour/credis/Client.php on line 448


texts: Order time not match with store time magento2

texts: I Have select my timezone from magneto admin but when an order is place the order time not matched with store time may be its take server time but i am not sure about it .Can anyone help me in this regard?


texts: "Stop Further Rules Processing" not working on coupons?

texts: I have (3) specific coupons running (eg. A, B, C) with "Stop Further Rules Processing" set to "Yes" for all of them but if you first enter the coupon code for A and then B Magento removes A and processes B?  Isn't "Stop Further Rules Processing" suppose to prevent this behavior?  Also, is it not possible to prioritize coupons in the absence of "Stop Further Rules Processing" ? For example, if coupon B is entered and then coupon A is entered setting coupon A to always replace B but never B to replace A? etc.


texts: Order got deleted automatically after successful payment

texts:
I am using Magento 2.3.3.

One order was automatically deleted after successful payment via authorize.net.

I didn't found order in database in quote table in reserve_order_id column and also not in sales_order table.

I also got confirmation email too.

Is anyone knows why this happened?

And I am using the mage-mojo server and mage-mojo told me request header was too large.

but I want to know that if the request header was large than why payment was successful and why order email was received ?

I have 1 observer

events.xml

<event name="checkout_submit_all_after">
    <observer name="add_terracycle_option_to_order" instance="Vendor\Modulename\Observer\Terracycle" />
</event>

Terracycle.php

<?php
namespace Vendor\Modulename\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class Terracycle implements ObserverInterface {

    protected $_cart;
    protected $_logger;

    public function __construct(
        \Magento\Quote\Api\CartRepositoryInterface $cart,
        \Psr\Log\LoggerInterface $logger
    ) {
        $this->_cart = $cart;
        $this->_logger = $logger;
    }
    public function execute(Observer $observer) {
        $order = $observer->getOrder();
        $quoteRepository = $this->_cart;
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $quoteRepository->get($order->getQuoteId());
        $terracycle_value = $quote->getTerracycle();
        $order->setTerracycle($terracycle_value);
        $order->save();
        $message = "Order Id: " . $order->getId() . " | terracycle_value: " . $terracycle_value;
        $this->_logger->info($message);  //saved in var/log/system.log
    }
}

Is this possible to have some fault with this code ? because as I test this code it is working fine.


texts:
Is it possible to stop Magento reserving stock when an order comes in?

When an order comes in Magento reserves the stock but so does our 3rd party backend inventory system, so the stock ends up becoming reserved twice. This means we have less stock available in Magento than we do actually have available.

Thanks in advance,


texts: Create simple product programatically in magento2

texts:
I have created simple product using following code.almost its working fine, but I'm not able assign product to websites.

Actually I have created two websites. I want to assign product to particular website or both websites.
here

$this->product->setWebsiteIds(1);   $this->product->setWebsiteIds(array(1));

both lines not working.

In Magento\Catalog\Api\ProductRepositoryInterface  there is no information websites (I mean there is no constants,setters,getters).

Anyone have idea?

namespace Kensium\Commands\Console;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
use Magento\Framework\App\State;
use Magento\Framework\App\ObjectManager\ConfigLoader;

/**
 * Command creates simple product by given data
 */
class CreateSimpleProduct extends Command
{
    protected $_productRepository;
    protected $product;
    protected $registry;
    protected $state;
    protected $configLoader;
    protected $objectManager;
    const SIMPLE_PRODUCT_INFO = "simpleproductinfo";
    public function __construct(
         \Magento\Catalog\Api\ProductRepositoryInterface $_productRepository,
                 \Magento\Catalog\Api\Data\ProductInterface $product,
                 \Magento\Framework\Registry $registry,
                 State $state,
                 ConfigLoader $loader,
        \Magento\Framework\ObjectManagerInterface $objectManager
    )
    {
    $this->_productRepository =$_productRepository;
    $this->product=$product;
        $this->registry = $registry;
        $this->state = $state;
    $this->configLoader = $loader;
        $this->objectManager = $objectManager;
        parent::__construct();
    }

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this->setName('kensium:create_product')
            ->setDescription('creates simple product')->setDefinition([
            new InputArgument(self::SIMPLE_PRODUCT_INFO, InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'Simple Product Info')
        ]);

        parent::configure();
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {

    if (!$input->getArgument(self::SIMPLE_PRODUCT_INFO))
        {
            throw new \InvalidArgumentException('Missing Argument ' . self::SIMPLE_PRODUCT_INFO);
        }
        $this->registry->register('isSecureArea', true);
        $this->state->setAreaCode('adminhtml');
        $this->objectManager->configure($this->configLoader->load('adminhtml'));
        $simples=$input->getArgument(self::SIMPLE_PRODUCT_INFO);
        foreach($simples as $simple)
    {
           $arr=explode(":",$simple);
           $data['name']=$arr[0];
           $data['sku']=$arr[1];
           $data['price']=$arr[2];
       $this->product->setName($data['name']);
           $this->product->setSku($data['sku']);
           $this->product->setPrice($data['price']);
           $this->product->setTypeId("simple");
           $this->product->setAttributeSetId(4);
           $this->product->setWebsiteIds(1); //   $this->product->setWebsiteIds(array(1));
       $this->_productRepository->save($this->product);
           $output->writeln('<info>created simple product</info>');
    }

    }

}


texts:
I add this column in my gird and set value 0 but show blank in edit grid

$fieldset->addField('category_id', 'text', array(

'label' => Mage::helper('campaign')->__('Category IDs'),
            'class' => '',
            'required' => false,
            'name' => 'category_id',
            'value' => 0,
        ));


texts: Product not displayed after migartion in magento 1.9.2.4?

texts:
I Migrate magento to 1.9.2.4.
After migration my Product are not displaying on front-end.

I got message :
There are no products matching the selection.

Please suggest what can "I do.


texts: Hide "Grand Total (Excl.Tax)" and "Tax" in order email

texts:
I would ask if there's a way to hide the "Grand Total (Excl.Tax)" and "Tax" sections from the order transactional email.

I've Magento CE 1.9.0.1.

Has someone ever done it?


texts: How to reinstall magento 2 extension properly?

texts:
When using M1 i could reinstall the extension (launch  setup/upgrade) just deleting the extension recording from the core_resource table. During the second magento address (or after cache refreshing) the extension executed all the files properly beginning from the 0 version.

Unfortunately i could not find the detailed information on how to reinstall the extension previously installed on my magento 2. Maybe somebody faced the same issue and knows the plan of actions for reinstalling the extension on magento 2 and could help. Your help will be highly appreciated.

EDIT

Example:

I've got module v. 2.0.0 successfully installed with own tables
I've delete the tables manually from the database
I've got module v. 2.0.0 without tabels

How to reinstall tables without completely uninstalling and installing module?

UPDATE:

bin/magento module:uninstall <VendorName>_<ModuleName>
<VendorName>_<ModuleName> is not an installed composer package

where the <VendorName>_<ModuleName> - is the real vendor name and module name of the my module.

bin/magento module:status
List of enabled modules:
Magento_Store
.....
<VendorName>_<ModuleName>
.....
Magento_Weee
Magento_CatalogWidget
Magento_Wishlist
List of disabled modules:
None

UPDATE 2

My extension has the same name attribute value as in <VendorName> and <ModuleName>, in  app/code/<VendorName>/<ModuleName>/etc/module.xml as it is indicated further:

<module name="<VendorName>_<ModuleName>" setup_version="1.0.0" />

In addition:

vagrant@magento-dev:/var/www/mgn2$ bin/magento module:disable <VendorName>_<ModuleName>
The following modules have been disabled:
- <VendorName>_<ModuleName>

Cache cleared successfully.
Generated classes cleared successfully. Please re-run Magento compile command
Info: Some modules might require static view files to be cleared. Use the optional --clear-static-content option to clear them.
vagrant@magento-dev:/var/www/mgn2$ bin/magento module:enable <VendorName>_<ModuleName>
The following modules have been enabled:
- <VendorName>_<ModuleName>

To make sure that the enabled modules are properly registered, run 'setup:upgrade'.
Cache cleared successfully.
Generated classes cleared successfully. Please re-run Magento compile command
Info: Some modules might require static view files to be cleared. Use the optional --clear-static-content option to clear them.

This bin/magento setup:upgrade goes without any errors.

UPDATE 2:
I’ve found the additional information. Maybe it will be useful for somebody.

mazhalai writes:

  module:uninstall is intended to be used, only if you are absolutely
  certain, that the module wont be used any longer. However, other
  modules may have dependencies on the module that is to be removed.
  Hence we use composer remove, which calculates dependencies and
  removes code of the module from the file system. We cannot uninstall a
  module that is NOT installed via composer, since there is no way for
  us to know about dependencies in such a situation. It is risky to
  remove data and code in such a case. Hence, it is recommended that for
  modules NOT installed via composer, manual clean up of the database
  and filesystem is necessary. In module enable/disable, the code is
  never removed from the filesystem, so that it can be used if required
  at a later time. Hence, it is not removed from the setup_module table.

Link

PS: I am using the Magento 2.0.4


texts: Show discount in cart page even without applying a coupon

texts:
In cart page we can see the discount row only if a customer add a coupon code(?). What I want to do is adding the discount as zero for every cart page even there is not any coupon code applied.
What I see:

Total (Inc VAT)    £42.00
Subtotal (net) £35.00
Subtotal (Inc VAT) £42.00
VAT    £7.00

What I want:

Discount   £0.00
Total (Inc VAT)    £42.00
Subtotal (net) £35.00
Subtotal (Inc VAT) £42.00
VAT    £7.00

This is my design/.../template/checkout/total/default.phtml file for viewing discount with coupon code:

<td colspan="<?php echo $this->getColspan(); ?>" style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right">
    <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><?php endif; ?>
        <?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?>
        <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><?php endif; ?>

<td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right">
    <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><?php endif; ?>
        <?php echo $this->helper('checkout')->formatPrice($this->getTotal()->getValue()) ?>
        <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><?php endif; ?>

The problem I'm having is whenever cart page is loaded, this block won't load, unless there is coupon code applied, obviously. What I want to know is that is there any flag or controller for make the block appear even no coupon is applied so in above block I can check whether coupon is applied or not to customize the above view. Can you give me any suggestions?
PS: here coupons means shopping cart price rules.


texts: Update Minimum Sale Quantity using the api

texts:
I've been trying to update the min sale qty field using the soap api. I can get it to update the qty and manage stock values. But can't get it to update the min sale qty or any other fields.

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <catalogInventoryStockItemUpdate xmlns="urn:Magento"><sessionId>REMOVED</sessionId>
<product>C-M1602</product>
<data>
    <qty>178</qty>
    <min_sale_qty>150</min_sale_qty>
    <use_config_min_sale_qty>0</use_config_min_sale_qty>
</data></catalogInventoryStockItemUpdate>
    </soap:Body>
    </soap:Envelope>

Does anyone know if i'm sending the wrong element name or something else i could try. I 'm hoping it's just something simple that i've missed.

The qty does update, so i know it's updating some of it.


texts: How do I change the default arrangement of the attributes in the upgrade attributes option on the main catalog page?


texts: Magento 1.9 - Attach Custom image from product view page front end

texts:
I am using below code to upload/attach images from product view page frontend, images uploading in directory but not save in quote item & order item table.

    <?php
require_once 'Mage/Checkout/controllers/CartController.php';
class Etheme_Buyshopconfig_CartController extends Mage_Checkout_CartController
{
    public function addAction()
    {
        $data = $this->getRequest()->getPost();

        if (isset($_FILES['options_2_file']['name']) && $_FILES['options_2_file']['name'] != '') {

                foreach ($_FILES['options_2_file']['name'] as $key => $image) {
                    Mage::log('looping');
                    if (empty($image)) {
                        Mage::log('continue');
                        continue;
                    }
                    try {
                        Mage::log('uploading');
                        $uploader = new Varien_File_Uploader(
                                    array(
                                    'name' => $_FILES['options_2_file']['name'][$key],
                                    'type' => $_FILES['options_2_file']['type'][$key],
                                    'tmp_name' => $_FILES['options_2_file']['tmp_name'][$key],
                                    'error' => $_FILES['options_2_file']['error'][$key],
                                    'size' => $_FILES['options_2_file']['size'][$key]
                                        )
                                );

                        // Any extention would work
                        $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
                        $uploader->setAllowRenameFiles(true);

                        $uploader->setFilesDispersion(false);

                        $path = Mage::getBaseDir('media') . DS . 'custom_options' . DS. 'quote' . DS;
                        $img = $uploader->save($path, $_FILES['options_2_file']['name'][$key]);
                        //var_dump($img);exit;
                        //$imagepath = $img['file'];

                        //$saveData['options_2_file'] = $imagepath;

                        Mage::log($img['file']);
                    } catch (Exception $e) {
                        echo $e->getMessage();
                        Mage::log($e->getMessage());
                    }

                }
            }

        parent::addAction();

    }
}

Image name/path not saved in info_buyRequest "sales_flat_quote_item_option" table and  "sales_flat_order_item".

Any help?


texts: I have many products, and I want to update product's price but only specific products with the following attribute:wheels, tires by 12% and 14%.How would you do it?


texts: Magento 2 nested dynamic rows uicomponent

texts:
I want to use nested dynamic rows components.
I have 3 sections.

Items
'Add Item' button to add Item section.

Ingredients (inside Item)
Each Item section can have one or more Ingredient sections with 'Add Ingredient' button

Directions (inside Item)
Each Item section can have one or more Direction sections with 'Add Direction' button.

How can I achieve this functionality?
All sections are dynamic rows.


texts: PHP Build from source .configure for Magento 1 and 2

texts:
I am working on a VPS machine and I want to build PHP 5.5 from source. I am kinda having an OCD of what are the PHP extensions are needed to include so that my .configure so that I will able to run all the functions of Magento 1(CE and EE) and Magento 2 (including Solr, Oauth, Email, Cron and etc).

currently this is my .configuresettings

./configure \
    --prefix=$HOME/tmp/usr \
    --with-config-file-path=$HOME/tmp/usr/etc \
    --enable-mbstring \
    --enable-zip \
    --enable-bcmath \
    --enable-pcntl \
    --enable-ftp \
    --enable-exif \
    --enable-calendar \
    --enable-sysvmsg \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-wddx \
    --with-curl \
    --with-mcrypt \
    --with-iconv \
    --with-gmp \
    --with-pspell \
    --with-gd \
    --with-jpeg-dir=/usr \
    --with-png-dir=/usr \
    --with-zlib-dir=/usr \
    --with-xpm-dir=/usr \
    --with-freetype-dir=/usr \
    --with-t1lib=/usr \
    --enable-gd-native-ttf \
    --enable-gd-jis-conv \
    --with-openssl \
    --with-mysql=/usr \
    --with-pdo-mysql=/usr \
    --with-gettext=/usr \
    --with-zlib=/usr \
    --with-bz2=/usr \
    --with-recode=/usr \
    --with-mysqli=/usr/bin/mysql_config

I hope I can have also a view working .configure of yours :)


texts: Shopping cart is not clearing on the cart page

texts:
After I updated from Magento version 2.2.3 to 2.2.6 the shopping cart stopped clearing after I click "Clear Shopping Cart" on the cart page.

After I click the button, the page reloads but everything remains the same.

I am using Ultimo theme but I have checked and it doesn't overwrite this behavior anyhow.

What could be the possible issue and where should I start my investigation from?


texts: Use Mage::app('admin') in Composer post scripts

texts:
I am creating a post-update-cmd script in which I call some functions.

The file is

  lib\Vendor\Module\CustomClass.php

This is the command:

"post-update-cmd": [
Vendor \\ Module \\ CustomClass :: customfunc
]

and the file:

namespace Vendor\Module;

class CustomClass  {

// .. some stuff for get rootfolder (in this case is /../../../../../../

public static function customfunc() {
  if(file_exists(self::$MagentoRootFolder.'/app/Mage.php') == true){
      $bootstrapFileName = self::$MagentoRootFolder.'/app/Mage.php';
  }
 else{
      die("Mage.php file not found in ./app or parent folder");
  }

try{
      require self::$MagentoRootFolder . '/app/bootstrap.php';
      require_once $bootstrapFileName;
      umask(0);

    }
    catch (\Exception $e){
      die($e->getMessage());
    }

    Mage::app('admin');

}

But when i run composer update the result is this:

  [ErrorException] include (Vendor \ Module \ Mage.php): failed to open
  stream: No such file or directory

How can I include Mage: app to work also within this path?