texts:
We have seen a large increase in "spam" visitors from sites such as the below. Which is impacting our analytics and while I know we can block it from reporting, we are concerned it will affect our rankings and its also hitting our bandwidth. While I am aware we can add these sites individually to htaccess and deny, I am trying to ascertain why A) we are a target and B) if/how we can combat it with a more universal solution than adding sites manually to htaccess.

Any recommendations/experience with this gratefully received.

Site examples:

social-buttons.com / referral
site16.social-buttons.com / referral
semalt.semalt.com / referral
best-seo-solution.com / referral
forum.topic48683315.darodar.com / referral


texts: Not getting subtotal in custom sales quote address total abstract model

texts:
I have override Mage_Sales_Model_Quote_Address_Total_Abstract with my custom model to add and display custom additional fee to user but i am not getting the subtotal value in it.

I have used $address->getSubTotal() and it is returning zero.

Help me to get subtotal.

Thanks


texts: When access to my address http://localhost.com/magento2 i got an error

texts:
At final phase to install Magento 2, When i went to access my address  http://localhost.com/magento2 i got an error cause of index.php file, my address does not read the file as php file
so i got the following error
run($app); * -------------------------------------------- * * Copyright Â© Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ try { require __DIR__ . '/app/bootstrap.php'; } catch (/Exception $e) { echo <<
Autoload error

{$e->getMessage()}
HTML; exit(1); } $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class); $bootstrap->run($app);

and the original file code is
<?php

/*
 * Application entry point
 *
 * Example - run a particular store or website:
 * --------------------------------------------
 * require __DIR__ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 * \/** @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap-createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

try {
    require __DIR__ . '/app/bootstrap.php';
} catch (/Exception $e) {
    echo <<<HTML
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">

        Autoload error

{$e->getMessage()}

HTML;
    exit(1);
}

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

after my researching i got that my address does not read/run the php file as is, it is read/run it as html file, so my question is: how can i let the server run the php file as is ?
additional info : my file is in /var/www/html/magento2/index.php
php version is php 7.4.3


texts: Magento 2.1.6 CE Direct post configure fields sent to authorize.net

texts:
I've configured Authorize.net Direct Post as a payment method in Magento 2.1. This is a fairly restrictive account that requires a lot of fields and requests are failing because some data is not being sent to authorize.net.

In particular, it looks like x_country and x_ship_to_country are never sent. How can I configure the payments module to collect and send this information? I know it's captured in the checkout module.

This is the response from https://test.authorize.net/gateway/transact.dll:

  window.location="https://mywebsite.tld/authorizenet/directpost_payment/redirect/x_invoice_num/000000007/success/0/error_msg/Gateway
  error: Bill To Country is
  required./controller_action_name/directpost_payment/is_secure/1/";

And here's the debug log for one transaction, note that x_country and x_ship_to_country are blank:

[2017-05-30 18:57:54] main.DEBUG: array (
  'response' =>
  array (
    'x_response_code' => '3',
    'x_response_reason_code' => '33',
    'x_response_reason_text' => 'Bill To Country is required.',
    'x_avs_code' => 'P',
    'x_auth_code' => '',
    'x_trans_id' => '0',
    'x_method' => 'CC',
    'x_card_type' => 'MasterCard',
    'x_account_number' => 'XXXX0015',
    'x_first_name' => 'User',
    'x_last_name' => 'Lname',
    'x_company' => '',
    'x_address' => '1234 Sesame St',
    'x_city' => 'Houston',
    'x_state' => 'Texas',
    'x_zip' => '77013',
    'x_country' => '',
    'x_phone' => '1234567890',
    'x_fax' => '',
    'x_email' => 'dummy@data.com',
    'x_invoice_num' => '000000006',
    'x_description' => '',
    'x_type' => 'auth_capture',
    'x_cust_id' => '',
    'x_ship_to_first_name' => 'User',
    'x_ship_to_last_name' => 'Lname',
    'x_ship_to_company' => '',
    'x_ship_to_address' => '1234 Sesame St',
    'x_ship_to_city' => 'Houston',
    'x_ship_to_state' => 'Texas',
    'x_ship_to_zip' => '77013',
    'x_ship_to_country' => '',
    'x_amount' => '46.50',
    'x_tax' => '0.00',
    'x_duty' => '0.00',
    'x_freight' => '7.50',
    'x_tax_exempt' => 'FALSE',
    'x_po_num' => '',
    'x_MD5_Hash' => '706C267F8CA31058A740E0FC4BBCCB93',
    'x_SHA2_Hash' => '',
    'x_cvv2_resp_code' => '',
    'x_cavv_response' => '',
    'x_test_request' => 'false',
    'controller_action_name' => 'directpost_payment',
    'is_secure' => '1',
  ),
)


texts: Connection to remote MySQL Database fails

texts:
We copied our domain, database and filesystem to another server @ rackspeed.
I opened the cPanel and added the ip address of the old server in "Remote-MySQL" so that the old server can connect to the new database. Then I created a second user and added him to the rackspeed database.

Then I connected to the old server and entered the database credentials of the rackspeed server with the new user. But now I get to see the offline site, so the remote connection is not working?

Am I missing something?


texts:
I'm trying to add a new custom image attribute for category, following the guide here "https://webkul.com/blog/add-custom-image-attribute-category-magento-2/comment-page-1/#comment-16835"

However, after I added these files under /app/code/[vendor]/[Module]/

Then run

php bin/magento setup:di:compile
php bin/magento setup:upgrade
php bin/magento c:c c:f

but nothing shows up, and I cannot find the module on the list. Please help


texts: Newsletter block doesn't show on homepage

texts:
My theme have supplied a newsletter theme /frontend/galio/ma_galio1/template/newsletter/subscribe.phtml

I am using this block on my footer PS: This block is pre-supplied with my theme

{{block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"}}

I don't know why the block doesn't show on my site
Here's the footer. Interestingly, I don't see the footer when I turned on template hints.
/frontend/galio/ma_galio1/template/page/html/footer.phtml

            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_static_2')->toHtml() ?>

        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_static')->toHtml() ?>

            <?php echo $this->getChildHtml("footer_links") ?>
            <address><?php echo $this->getCopyright() ?></address>

        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('payment')->toHtml() ?>
        <?php echo $this->getChildHtml("store_switcher")?>


texts: Custom javascript not working/loading correctly

texts:
I am trying to add some custom javascript to my magento shop but keep getting errors like: Uncaught TypeError: Cannot read property 'on' of null. Which makes me think that maybe my file is loaded before jquery is present, or before other important files are loaded.

The way I added my js:

In app/design/frontend/rwd/brezza/layout/local.xml I added the following line:

<action method="addJs"></action>

Then in my root js folder, I added footerblocks.js which is loaded with the following content:

$('.feature-box').on('mouseover', function (event) {
    $('.feature-box').css('height', '1000px');
});

console.log('test');

var Now = new Date();
var CurrentDay = Now.getDay();
// opening time - 24 hours so 9:30am is 9, 30
var OpeningTime = new Date(Now.getFullYear(), Now.getMonth(), Now.getDate(), 11, 36);
// closing time - 24 hours so 5:30pm is 17, 30
var ClosingTime = new Date(Now.getFullYear(), Now.getMonth(), Now.getDate(), 17, 30);
var Open = (Now.getTime() > OpeningTime.getTime() && Now.getTime() < ClosingTime.getTime())
// days 0.sun 1.mon 2.tues 3.wed 4.thur 5.fri 6.sat
// CurrentDay !== 0 && the # is the day to eclude, so if I want to be closed on Sat6, Sun0, Wed3
// CurrentDay !== 6 && CurrentDay !== 0 && CurrentDay !== 3 && Open
if (CurrentDay !== 0 && CurrentDay !== 6 && Open) {
    $('.openstatus').toggle();
}

It already gives an error before it reaches the console log.

What can be causing this? And is this the correct way to add custom JS to a magento installation?

In my footer.phtml there is the following div:

&nbsp;

GRATIS VERZENDEN VANAF €50

We zijn bereikbaar

We zijn gesloten

Addional note:

When I remove the first part of my code the error changes into: Uncaught TypeError: Cannot read property 'toggle' of null.

So toggle and on (two jquery functions if I'm correct) are not working as they should.


texts: How to get particular one database table data in custom php file magento 1.9

texts:
We have 'outofstocksubscription_info' table in database.
We want to it's all data in one custom php file.
How to get it in custom file ?


texts: Magento 2. Sales -> Invoices - How to set Filter in Invoice Grid?

texts: I have invoice id- 0000017 and order id-12 but this order 3 items so we are create 3 invoice like 0000017,0000018,0000019.Invoice grid in I have set filter like display only 0000017 invoice.how to set filter and which file? thanx in advance.


texts: I want to extract sku, quantity, price from a made order for each of the bought items in order using event sales_order_place_after

texts: I can catch the event sales_order_place_after with no problems, but now I have a problem because I can't get Mage::log(var_export($observer->getEvent()->getOrder())); to work because the output is too big. I need sku, quantity and price for each of the items that are in that particular order. How can I do this? I guess if I knew which class ->getOrder() returns this would not be a problem, but I don't. Which class does this method return?


texts: Magento 1.9.22 fresh install with sample data but the landing page not display

texts:
the landing page (static block) of the category not working in Magento 1.9.22 fresh install with sample data, i just installed, but when i click on the category such as women, the related static block is not displayed.

Anyone know what is the issue?

update:

i just disable all the cache and refreshed, but it only displayed "abc"

  {{block type="cms/block" block_id="category-landingpage-women-mainblock"}}
  {{block type="cms/block" block_id="category-landingpage-women-linksblock"}}

  abc


texts: How to get product category ID on product compare page?

texts:
I want to separate attributes according to product category id on product compare page.
means on ../catalog/product/compare/list.phtml

anyone can help me?


texts:
When I export my customer details it redirects to the error page

How can I fix this issue?


texts: Magento 2 - Check if shipping cost in cart is 0,00, then change it into text

texts:
We would like to check in the checkout cart if the shipping cost is 0,00 and then replace it by text: "free".
Therefore I copied the file /Magento_Tax/web/template/checkout/cart/totals/shipping.html to our theme and tried the following below.
Sadly that does not seem to work and it does not display any value, so it seems that it does not load the value as numbers I guess.
How can we check the shipping cost using the knockout code and then display text?


texts: How to add pagination in subcategory collection in magento?

texts:
I have written following code to display subcategories

  <?php
$_categories=$this->getCurrentChildCategories();
if($_categories->count()):
$categorycount = 0;
foreach ($_categories as $_category):
if($_category->getIsActive()):
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$catName = $this->getCurrentCategory()->getName();
?>

 <a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>" class="">
          <?php
                    $imageUrl = Mage::getBaseDir('media')."/"."catalog"."/"."category"."/".$this->getCurrentCategory()->getThumbnail();

                    $imageResized = Mage::getBaseDir('media')."/"."catalog"."/"."category"."/"."resize/".$this->getCurrentCategory()->getThumbnail();

                    if (!file_exists($imageResized) && file_exists($imageUrl))
                    {

                    $imageObj = new Varien_Image($imageUrl);
                    $imageObj->constrainOnly(TRUE);
                    $imageObj->keepAspectRatio(TRUE);
                    $imageObj->keepFrame(FALSE);
                    $imageObj->quality(100);
                    $imageObj->resize(270, 270);
                    $imageObj->save($imageResized);
                    }
                    ?>
          <img src="<?php echo Mage::getBaseUrl('media').'catalog/category/resize/'.$this->getCurrentCategory()->getThumbnail(); ?>" alt="<?php echo $this->htmlEscape($_category->getName()) ?>"/>

 <a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?>

  <?php
endif;

endforeach;
endif;
?>

I want to add pagination in this page, i have tried solutions like following but it does not worked either

parent::_prepareLayout();
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
    $pager->setAvailableLimit(array(15=>15));
    $pager->setCollection($_categories);

    $this->setChild('pager', $pager);

Can anyone have any idea on how to add pagination in subcategory listing page?

Please guide me as i am new to magento development.

Thanks in advance.


texts: How to connect to specific store view through Magento2 REST API

texts:
I found this thread on the main Stack Overflow site indicating how to connect to a specific store view in the Magento 1 REST API.

I'm curious how to do this with the Magento2 API. Looking at the documentation generated by swagger I don't see anything about how to specify a store view in the catalogProductRepositoryV1 section.


texts: Product image url as part of collection load

texts:
Is it possible to have the product image url loaded as part of the product collection?

for examples:

Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');

This doesnt add the image.


texts:
I cannot use my frontend site on a pc browser.
I will get only a grey site and cannot click any Link.
Hope somebody can help me there.
kindly regards for any answer.


texts: Products in cancelled orders become inactive. I need them to remain active.

texts:
Pretty much my title.

I'm running a pretty special store, which only has one of each product, orders take them out of stock, which therefore makes them inactive, but if the order is cancelled, they're in stock again, but inactive.

How can i change this? I need them to reactivate when they are in stock again.


texts: Magento 2 - Luma theme header customization

texts:
Where is located the file of the header of luma theme ?

I want to add some text and facebook icon to header and I can´t find where I do that !

Please Help !

Thanks


texts: How to remove first few digits from order id using order id variable in email template

texts:
I am using a 3rd party plugin for order number customization and the format I am using is-        {order id}-{counter}AB
e.g.   1234-30000AB

In the email template when I include order id variable it is picking the whole order number, i.e. 1234-30000AB
whereas I only want to include the first four digits, i.e., 1234.

Is there a way I can create a string filter to remove last the last 7 digits

Thanks


texts: Bundle product: Add to cart instead of select option

texts:
I want to add add to cart on product detail page instead of select option, how can it be done?

As of now it shows select option on product detail page , but i want add to cart button that will just add item to cart with all available options

Please guide me way to do this.

Will adding below code work?

onclick="productAddToCartForm.submit(this)"


texts:
How do you replace a default JS component using requirejs in a custom theme? I have tried following the example at devdocs.magento.com but I can't seem to get it to work.

To keep things simple I have a new theme, which is a copy of the magento-blank theme, and has no parent theme.

I am trying to replace the default menu.js, I have copied /lib/web/mage/menu.js to <theme-dir>/web/js/menu.js and added a simple console log to the _create function so I can tell the difference between them when I check the browser.

As suggested in the devdocs my requirejs-config is as follows

Path: vendor/<vendor-name>/new-theme/requirejs-config.js

var config = {
    "map": {
        "*": {
            "menu": "js/menu"
        }
    }
};

Unfortunately I'm not seeing my new console message show up when I refresh the browser, and I also can't see this config being combined with others in the generated requirejs-config.js in the browser.

I checked the theme is active and tried the following:

bin/magento dev:source-theme:deploy
bin/magento cache:flush
Flush Javascript/CSS cache
Flush Static Files Cache
clearing my browser cache

What am I missing, some other examples in the devdocs show adding an initialisation, but I'm not changing the markup at this time, so the
data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}' is still present, in the template, my understanding is that "menu" definition refers to the component name in requirejs-config, so am I correct in thinking it should work?


texts: ERR (3): Notice: Array to string conversion in /app/code/core/Mage/Catalog/Block/Product/View/Attributes.php on line 66

texts:
I spent all of yesterday trying to get to the bottom of this error that appears every time you access a product page on our Magento store (CE edition 1.9.0.1):

  2015-07-24T12:20:09+00:00 ERR (3): Notice: Array to string conversion in /[Path to Magento]/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php on line 66

It's this block of code in the attributes.php file:

if (!$product->hasData($attribute->getAttributeCode())) {
    $value = Mage::helper('catalog')->__('N/A');
} elseif ((string)$value == '') {
    $value = Mage::helper('catalog')->__('No');
} elseif ($attribute->getFrontendInput() == 'price' && is_string($value)) {
    $value = Mage::app()->getStore()->convertPrice($value, true);
}

specifically this:

} elseif ((string)$value == '') {

I've googled the issue and can't find it anywhere else.
I assumed it's something to do with product attributes so I deleted
all of the    custom product attributes we'd created one by one.
I disabled all extensions one by one.
I reverted the design templates back to the default Magento ones.

And still the error kept popping up...

I'm pretty much a novice when it comes to all of this stuff, so my trial and error fixes haven't helped me out... Has anyone got any ideas or can point me in the direction of how to troubleshoot this error a little more?


texts: Hide out of stock price from category Magento 1.9

texts:
I want to hide out of stock product price from category but I want to remain the product on same category but only hide price when the product come back to store then it will show price.

Can anyone give me a suggestion?


texts: Magento 2: Can we call one observer in another observer?

texts:
I already have 1 observer on checkout_cart_product_add_after .

Before end of $this I woule like to call another observer which is located in different module

magento\app\code\Custom\Module\Observer\AnotherObserver.php

Both are executing on same event. But both files do different functionality that's why want to make it in separate files.

Don't want to merge code of 2 files in 1 file


texts:
good Morning,
I performed the update from ver. 1.8.1.0 to 1.9 of my website (Gadget Personalizzati e Articoli Promozionali bestpromotion.it
But now everything is in English instead of Italian even if wherever is specified the Italian


texts: Product name in Magento order confirmation email subject

texts:
(Magento 1)

I'd like to add the name of the product in the order confirmation email subject. How do I do that?


texts: where do I set width for product details after removing sidebar block

texts:
Using Magento 1.9.0.1

On product details page (1 column layout) on the left I have the product image, in center the product title, desciption, attributes, buy button and on the right there is another block space that currently I occupied by a widget Block Product View and in reference it says : block product sidebar right.

when going to static blocks I can make that block not active, but that leaves me with a lot of white space on the product page right side (class = product-view-right hidden-sm hidden-xs col-md-3)

how can I get the product details section to also occupy that space so its class goes from  (product-shop col-md-5 col-sm-6 col-xs-12) to (product-shop col-md-8 col-sm-6 col-xs-12) ?

thanks


texts:
I've been working for the last two years as a Magento developer.I have learned some what of magento's folder structure, rewrite of classes, front end customization etc.

So if any requirement or customisation comes to me now i'm able to finish within deadlines. But suddenly I heard that magento 2.0 is a rewrite of the entire Magento (1) system.

So we need to learn from scratch on wards about the new system?

How much headache will it be to learn new system?

Of course new system will give better performance.

I will close this question asap if i get a little bit of an idea. Thoughts?

please don't down vote if this is not the right place.


texts: Can't login to staging servers without deleting cookies first. Magento 1.9

texts:
We have multiple clones of our main shop at www.mainsite.com for testing and developing.

e.g. test.mainsite.com, fbk.test.mainsite.com and isk.test.mainsite.com,

There is a big issues with the cookies...

Users can't work in all test sites at the same time (Frontend and Backend). They first have to delete all other cookies from the other domains before they can login.

The cookie domain is matching the domain name on every domain, on mainsite.com the cookie domain is mainsite.com on test.mainsite.com the cookie domain is test.mainsite.com and so on...

The cookie path is set to / everywhere


texts: List of products and category with mysql

texts:
I want to ask, how to get a list of all products SKU and there categories
For example

+---------+----------------+----------+-------+------+
|   SKU   |    category    |  image   | price | msrp |
+---------+----------------+----------+-------+------+
| Value 1 | cat1/cat2/cat2 | /123.jpg |   123 |  145 |
+---------+----------------+----------+-------+------+

with Mysql query

edit: What I have tried so far :

  SELECT e.entity_id, e.sku, a.value FROM catalog_product_super_link b
  LEFT JOIN catalog_product_entity AS e ON e.entity_id = b.product_id
  LEFT JOIN catalog_category_product AS cp ON cp.product_id =
  b.product_id LEFT JOIN catalog_category_entity_varchar AS a ON
  a.entity_id = cp.category_id WHERE b.parent_id=368538 group by
  b.product_id


texts: Magento2 : Extra Checkout Step after Review & Payments Section with Place Order Button

texts:
I have added custom checkout step after Review and Payment, all steps are working fine but issue is Place Order button display on Review and Payment.

How to move Place Order button to last added custom step and add continue button to Review and Payment step.

Any help really appreciated.

Thanks in advanced


texts:
First off I just want to say thank you to who ever can help me, I'm currently using the MT Cosmetic Theme, but if I go to /app/design/frontend/base/default/template/catalog/navigation/top.phtml and edit that, nothing changes I've recached the site as well, can anyone help?

Thanks! :)


texts: How to remove the currency symbol from product price? (SEO requirement)

texts:
Based on this link, to follow schema.org formatting, the price must not come with any symblos. How can I remove the currency symbol from price?

Solution:

Thanks for the tips, the SEO solution I applied is

   <?php echo Mage::helper('core')->currency($_product->getFinalPrice(), false, false); ?>


texts: How to send email through programetically in magento 2.0?

texts:
I am sending conformation email while creating new account to the customer using   $customer->sendNewAccountEmail(); in controller it is working fine,
but i am trying for  at a same time, When I want to send another email with another email template to other customer which are already registered,
so that's  why i want to know about send email through Programmatically.


texts:
in my controller, I have this code (I'm getting last order through a form):

...
    foreach($array as $item){
                        try {
                            $product = $this->_productRepository->getById($item['product_id']);
                            $product_id = $product->getId();
                        } catch (NoSuchEntityException $e) {
                            echo $e;
                        }

                        if(isset($product_id)){
                            $param = array(
                                    'product' => $item['product_id'],
                                    'qty' => $item['qty']
                                );

                 }
                }

I want to display a simple message on my view. The exception is way to big, I want only to show 'product doesn't exist'. How can I do that ? I saw that I can achieve this with "message manager", but how can I get the exception from the controller to my view ?


texts: How to Get value in Dropdown (Custom product Attribute).

texts: I want to get value from the database (which is created custom module) in dropdown which is custom product attribute.


texts:
I am trying to add Facebook conversion tracking but i cannot find the following file success.phtml

The right path it should be this one: app/design/frontent/default/default/template/checkout/success.phtml - I couldn’t find.

Any idea?


texts: Magento 2: How to get the product price with currency symbol in PHTML file with help of block

texts:
From the $product object I am getting the collection of product from block and to render the fields. I want to get the price with it's currency code like
$99.00 in product listing.

Right now, I am using the below code to get the price of the product but i need to display the price with currency symbol.

$product->getFinalPrice();


texts: Alternate way to upload the favicon.ico as facing the "we don't recognize or support this file extension type"

texts: Even changing the /vendor/magento/module-catalog/view/adminhtml/web/catalog/base-image-uploader.js to acceptFileTypes: /(\.|\/)(gif|ico|jpe?g|png)$/i did not help with uploading .ico. Is there any other way?


texts:
System cron starts Magento 2 cron every minute:

$ crontab -l
*/1 * * * * /usr/bin/php /home/user/prj/mage2/bin/magento cron:run >> /home/user/prj/mage2/var/log/cron.log

I see new line Ran jobs by schedule. is added every minute into the log.

This is my settings for my task:

<?xml version="1.0"?>
<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="my_own" instance="\Vendor\Module\Cron\Task" method="execute">
            <schedule>...</schedule>
        </job>
    </group>
</config>

These settings run my job every 15 minutes in fact (my own message is added every 15 minutes into the log):

<schedule>* * * * *</schedule>
<schedule>*/1 * * * *</schedule>

This is my log:

...
Ran jobs by schedule.
Ran jobs by schedule.
Ran jobs by schedule.
My own job is started.
Ran jobs by schedule.
...

These are Magento 2 cron settings:

How can I set <schedule> to run my task every 1 minute?


texts: Initialise swatches on product list loaded over ajax

texts:
I have noticed that on my infinite scroll the swatches are not showing for products loaded over ajax.

I'm guessing that similar to ajax add to cart buttons needing to be initialised the swatch renderer also needs to initialise these new products once they are loaded however unsure how this can be achieved?


texts: Migrate products, sales and customer data to upgraded Magento dev site

texts:
I am in the process of upgrading my Magento website. I have started with a clean slate and done a fresh install of Magento 1.9.1 on a dev URL.

I imported my current LIVE database and performed the upgrade, and then began site development on the DEV site.

The LIVE site is still taking new orders, and having new products uploaded to it, as business must continue, of course.

When I am ready to launch the new site, how do I go about making sure the DEV site contains all of the LIVE sites products, customers and sales history, and anything else that is required along those lines.

There are a number of threads out there talking about dropping the DEV database and rerunning the upgrade on the LIVE database (once restored to the DEV database) and then launching - but all my site modifications stored in my DEV database would be lost if I did this!

I imagine there is a way to just copy the relevant data from the LIVE database to the DEV database to bring it up to date, and then I would be able to launch the new site. That being the case, can someone provide a list of the relevant tables that would need to be copied from the old LIVE to the new DEV database.

Sub-question... how do you get around the problem of any differences between the old (1.6.2) database and the new (1.9.1) database tables to be copied?

I hope someone can help.

Cheers,

Rob


texts: Magento 2.3.4 indexer problem. Reindex getting invalid again and again

texts:
I did a migration from Magento 1.7.0.2 to 2.3.4 and I'm keep on getting

One or more indexers are invalid. Make sure your Magento cron job is running.

I ran reindex cammand, php bin/magento indexer:reindex from ssh, which leaves invalid error on Category product and product categories. I have tried changing the "invalid" to "valid" from mysql multiple times but that's gets changed to invalid again after 2 hours(approx).
So far I couldn't find a solution for it. Website is live on server. I'm stuck at this from about 4 days now. Any help would be appreciated.


texts: After add an image to product gallery, how to select that image as product image?

texts:
I add an image to product's image gallery with this code:

// $filePath: image full path
$mediaArray = array(
    "thumbnail"   => $filePath,
    "small_image" => $filePath,
    "image"       => $filePath,
);

$product->addImageToMediaGallery($filePath, $mediaArray, true, false);

$product->save();

After this code, the image will be added to gallery but it is unselected. How can I select this image as "base image" (and/or Small Image, Thumbnail)?


texts: Magento 2 - How to add new tab in Product detail page

texts: I need a new tab in the product view page similar to the description.


texts: Magento 2 .htaccess file missing in pub folder

texts:
I was recently trying to upgrade my Magento 2.2.7 to Magento 2.3.0 and the following message came up in component dependencies

Found non-writable path(s):
/var/www/vhosts/powermyself.com/httpdocs/pub/.htaccess

Upon closer inspection it would seem that the .htaccess file is missing in this folder (although there is still one in pub/static).

Is there any way to get this file back?


texts: How to move recently viewed product in catalog page to bottom of the page

texts:
this is my default.xml file . it
<referenceContainer name="columns.top">

        <referenceContainer name="content">
            <block class="Magento\Catalog\Block\Category\View" name="category.products" template="Magento_Catalog::category/products.phtml">
                <block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
                    <container name="category.product.list.additional" as="additional" />
                    <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
                        <block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
                    </block>
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="category.product.addto" as="addto">
                        <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                               name="category.product.addto.compare" as="compare"
                               template="Magento_Catalog::product/list/addto/compare.phtml"/>
                    </block>
                    <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
                        <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
                    </block>
                    <action method="setToolbarBlockName">
                        <argument name="name" xsi:type="string">product_list_toolbar</argument>
                    </action>
                </block>
            </block>
            <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
                <arguments>
                    <argument name="triggers" xsi:type="array">
                        <item name="compareProductLink" xsi:type="string">.action.tocompare</item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceBlock name="page.main.title">
            <arguments>
                <argument name="id" xsi:type="string">page-title-heading</argument>
                <argument name="add_base_attribute_aria" xsi:type="string">page-title-heading toolbar-amount</argument>
            </arguments>
            <block class="Magento\Catalog\Block\Category\Rss\Link" name="rss.link" template="Magento_Catalog::category/rss.phtml"/>
        </referenceBlock>


texts: Magento 2.3.3 After completing the order as a guest user unable to create a new account

texts:
Recently after upgrading our site to Magento 2.3.3 Version, the guest user can't create an account after successful checkout.

I am getting the below log messages, can someone help me on this.

main.DEBUG: URI '/checkout/account/delegateCreate/'' cannot be accessed with POST method
   (Magento\Checkout\Controller\Account\DelegateCreate)


texts: Custom product option not added in quote (prog)

texts:
Hi I'm creating a quote manualy.

This quote contains a virtual product (so related to a configurable product).

My quote is submitted, but the options from the parent product is not added to the quote.

I've got this :

   $buyRequest = new \Magento\Framework\DataObject();
   $buyRequest->setData([
       'qty' => $qty,
       'super_attribute' => [
             58 => 328,
       ],
       'options' => [58 => 328,]
        ]);
       $quote->addProduct($product,$buyRequest);

This [58 => 328,] refers to the parent product. Is this why my product doesn't have any option when the quote is submitted ?

(58 is the custom option id and 328 is id of the selected value)

any help would be appreciated.


texts: Magento 2 - How to get cron time in controller

texts:
in Magento 2, I want to get value of "Generate Schedules Every" text box location under

  Admin->STORES->ADVANCED->System->Cron (Scheduled Tasks)->Cron
  configuration options for group: default

Want this value in controller. Can anyone tell me how can we get this?

Thank you in advance!


texts: How to set custom value to identity column of a table in Magento 2

texts:
I have a custom table with identity column id and text column otherColumn and I'm trying to add a row into the table with my custom value.

$model->setOtherColumn($otherColumnValue)->save();

Above code works and inserts a row with next occurring value in "id" column.
But when I use below code.

$model->setId($customValue)->setOtherColumn($otherColumnValue)->save();

Row is not inserted in the table.

How to insert custom value in identity column?


texts: Magento 2 : Undefined index error after cloning database

texts:
I created a staging instance of magento 2 from production instance.

Exported DB and imported to newly created staging DB
Copied files from production directory to staging directory
Changed the URL in config_data table

After doing this I have been getting undefined index error, it goes off if define a primary key in that table, but now the error shows with different table with primary key, How to resolve this. Is there a way or a query to set primary key and index for all tables in magento2 ?

Exception #0 (Exception): Notice: Undefined index: PK_CATALOG_CATEGORY_ENTITY in /home/synergo/public_html/staging/magento2/vendor/magento/module-eav/Model/Entity/AbstractEntity.php on line 769


texts:
How to get review form page url in view.phtml in magento
I want to get the Be first to review this product url in view.phtml file


texts:
I am not able to setup a Node for "Press release" - I cannot see the "Add Node" button in Admin->CMS->Pages

Am I missing something?

I went to the configuration->general->content management and I still don't see anything that enables me to Manage Hierarchy

Can anyone help?


texts: How to get all children product from parent configurable product in magento2

texts:
I need to display some custom attribute from children product in checkout, I study for long time to come out a stupid solution

Override Magento\Swatches\Block\Product\Renderer\Configurable
Inject productRepository
Get children product directly from productRepository

$currentProduct = $this->getProduct();
$childrenIds = $currentProduct->getTypeInstance()->getChildrenIds($currentProduct->getId());

$childrenProducts = [];
foreach ($childrenIds[0] as $childrenId) {
    $childrenProduct = $this->productRepository->getById($childrenId);
    $childrenProducts[] = $childrenProduct->getData()['customexxxx'];

}

Anyone know a smart way to do it ?


texts:
I am trying to work out what would be the fastest way to compare user data which has been entered into a form with user data that is already stored in the database.

My plan was to pull all details of a single column into an array i.e. email, then compare them with the value entered, but I think that will get vary slow as the database grows.

My second idea was to use Zend_validate::is($email,'email') but that throws the error 'Validate class not found from basename'. The only information I can find on this error is references to a bug.

My question is: When comparing value from a form and database what would produce the quickest results?

EDIT

This is part of a custom module (my first one)

I am trying to avoid duplications within my table

The module will provide me with a list of people who are not members but want information specific events


texts: Get Finalprice including tax on productpage

texts:
I want to get the Finalprice including tax on my productpage for a meta tag.

I currently have this, but that is the price excluding tax:

<?php echo number_format($_product->getpriceIncludingTax(), '2', '.', ',');?>

How can I display the price including tax for this meta?


texts:
Suppose a product has five attributes.
If you want to update one of the attributes, do you have to reference all existing attributes?
Or will Magento remove attributes from the item if the attributes are not present in the array when you update the one attribute you are working with?


texts: Magento 2: Send custom email programmatically

texts:
I am using Magento 2.2.2

I have one form on my website with the fields "Name" and "Email". Now when the customer submits the form I want to send an email to the email address filled by the customer.

I want to send custom HTML in this email and this HTML includes images. How can I achieve this?

I have used below code:

<form class="form"  method="post" name="form_1" id="form_1" enctype="multipart/form-data">

Custom Form

    Name
    <input type="text" id="name" name="name" required="required" placeholder="Enter Your Name" />

    Email
    <input type="email" id="email_share" name="email_share" required="required" placeholder="Enter Your Email" />

    <input type="submit" id="submit_result" name="submit_result" value="Submit">
</form>
<?php
if(isset($_POST['submit_result']))
{

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$to = "test@gmail.com";
$nameTo = $_POST['txtname'];
$transport = $objectManager->create('Magento\Framework\Mail\Template\TransportBuilder');
$data = $transport
    ->setTemplateIdentifier(7)
    ->setTemplateOptions(['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => 1])
    ->setFrom(['name' => 'Test','email' => 'test1@gmail.com'])
    ->addTo($to,$nameTo)
    ->getTransport();
$data->sendMessage();

}
?>

And below as well:

<form class="form"  method="post" name="form_1" id="form_1" enctype="multipart/form-data">

Custom Form

    Name
    <input type="text" id="name" name="name" required="required" placeholder="Enter Your Name" />

    Email
    <input type="email" id="email_share" name="email_share" required="required" placeholder="Enter Your Email" />

    <input type="submit" id="submit_result" name="submit_result" value="Submit">
</form>
<?php
if(isset($_POST['submit_result']))
{

$to = "test1@gmail.com";
$nameTo = $_POST['txtname'];
$from = "test@gmail.com";
$nameFrom = "test";

$body ="
";
$body.="
Test email
";
$body.="
Name	".$_POST['name']."
";
$body.="
Email	".$_POST['email_share']."

";
$body.="
";

$email = new \Zend_Mail();
$email->setSubject("Test Request");
$email->setBodyHtml($body);
$email->setFrom($from, $nameFrom);
$email->addTo($to, $nameTo);
$email->send();

}
?>

I have tried both logics but they are not working


texts: New url key is not working for product after update in magento 2

texts:
I have product XYZ and URL key for this product is www.mysite.com/xyz

I have updated the value of URL key product from xyz to xyz-new.

When I try to access url www.mysite.com/xyz-new. It gives me 404 error.

I have noticed that product  url_key is updated correctly, but url_path is not updating.

Is this known issue in magento 2.1.x?

Any solution for this?


texts: how to get Grand Total of Wishlish Items in magento?

texts:
i am trying to get grand total of wishlist item. when we update quantity of wishlist item then total will show in price column and display the all item grand total at bottom. anybody knows answer please help me. your help will be appreciated.

app\design\frontend\rwd\default\template\wishlist\item\list.phtml

<?php
$columns = $this->getColumns();
?>

        <?php
            /* @var $column  Mage_Wishlist_Block_Customer_Wishlist_Item_Column */
            foreach ($columns as $column):
                $_blockName = str_replace('.','-',strtolower($column->getNameInLayout()));
        ?>
            <th class="<?php echo $_blockName; ?>"><?php echo $column->getTitle();?>
        <?php endforeach; ?>

    <?php if (count($this->getItems())): ?>
        <?php foreach ($this->getItems() as $item): ?>
            <tr id="item_<?php echo $item->getId();?>">
                <?php
                    foreach ($columns as $key => $column):
                        $_blockName = str_replace('.','-',strtolower($column->getNameInLayout()));

                        /* Override default column title in layout, useful for certain cases like select all box */
                        if ($column->getRwdTitle()) {
                            $_rwdLabel = $column->getRwdTitle();
                        } else {
                            $_rwdLabel = ($column->getTitle()) ? $column->getTitle() : false;
                        }
                ?>
                    <td class="<?php echo 'wishlist-cell'.$key; ?> <?php echo $_blockName; ?>"<?php if($_rwdLabel): ?> data-rwd-label="<?php echo $_rwdLabel; ?>"<?php endif; ?>><?php $column->setItem($item); echo $column->toHtml($item);?>
                <?php endforeach; ?>

        <?php endforeach ?>
    <?php else: ?>
        <td colspan="<?php echo count($columns);?>" class="wishlist-empty"><?php echo $this->__('This quote has no Items');?>
    <?php endif; ?>

   <?php foreach ($columns as $column): ?>
   <?php echo $column->getAdditionalHtml();?>
   <?php endforeach; ?>


texts: How can I import configurable products to Magento 2?

texts:
I'm successfully imported simple products to Magento 2.x, but for configurable products don't know how to prepare the template .xlsx|csv file.

Any suggestions on this, how to prepare the template for configurable products?


texts:
We have a Magento site on a VM with 2GB of RAM.  Right now, both Apache and MySQL are running on that same VM.  Since that's just not enough RAM for this site, I have been tasked with separating the MySQL server onto a separate 2GB VM (which is running on a different host machine in the same datacenter).

Because the network between the two VMs is not secure, I want to use SSL on the MySQL connection between them.  I cannot seem to find how to tell Magento to use SSL.

I know that in PDO directly I would do something like this:

<?php
$db = new PDO(
    'mysql:host=hostname;dbname=ssldb',
    'username',
    'password',
    array(
        PDO::MYSQL_ATTR_SSL_KEY    =>'/path/to/client-key.pem',
        PDO::MYSQL_ATTR_SSL_CERT=>'/path/to/client-cert.pem',
        PDO::MYSQL_ATTR_SSL_CA    =>'/path/to/ca-cert.pem'
    )
);

Where in the config file would I put those SSL options though?


texts: Get category collection from specific store

texts:
With flat tables turned off, how can I get a category collection from a specific store view ?

I have tried the following:

Mage::getModel('catalog/category')->getCollection()->setStoreId(3);

But it only returns the collection for the default store?

What is not correct with my example?


texts: Magento2, placing the custom block in header of order creation page in admin panel

texts:
I tried to add a custom block to header of order creation page in admin panel. Below code in my module did not work!

In file /app/code/MyVendor/MyModule/view/adminhtml/layout/sales_order_create_index.xml:

 <referenceContainer name="page.main.actions">
            <block class="MyVendor\MyModule\Block\Order\Msg" name="msg" template="MyVendor_MyModule::order/msg.phtml" before="page.actions.toolbar"/>
 </referenceContainer>

Edit 1: As requested in comment I share the code but nothing special there, here is block:

<?php

namespace MyVendor\MyModule\Block\Adminhtml\Order;

class Msg extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate
{

 protected function _construct()
    {
        parent::_construct();

    }

    /**
     * Get header text
     *
     * @return \Magento\Framework\Phrase
     */
    public function getHeaderText()
    {
        return __('Hello World');
    }

}

And template file:

<?php echo $block->getHeaderText(); ?>

Edit 2: It works for other part of the page like before item grids but header!


texts:
I have recently move a magento 2.2.5 website to a new server and now when I run an upgrade command or compile command I receive the below error. I have tried deleting any and every folder i can find for this plugin so that i could just reinstall it from scratch but have not had any luck.

I have

deleted the table in the database that the plugin uses
deleted the entry in the "integrations" table that referenced the plugin
deleted all folders in app/code/mageplaza and lib/mageplaza
edited composer.json to remove the link that referenced the plugin
I tried to recompile redeploy with no luck?

  Autoload error: Module 'Mageplaza_SocialLogin' from /var/www/html/.com/app/code/Mageplaza/SocialLogin' has been
  already defined in
  /var/www/html/.com/vendor/mageplaza/magento-2-social-login

I also removed it from the setup_table and now when I try to run the upgrade command

  PHP Warning:
  require(/var/www/html/******.com/vendor/composer/../mageplaza/magento-2-social-login/registration.php):
  failed to open stream: No such file or directory in
  /var/www/html/******.com/vendor/composer/autoload_real.php on line 70


texts: Contact us form showing invalid form key?

texts: When I submit contact us form I am getting invalid key error.It is not hitting the controller file.Please can anyone tell what can be the problem?


texts: Magento-2 : How to update cart total on check-box checked/unchecked

texts:
Magento2 - in checkout page, I have one check-box just before the payment method on the checkout payment step. I need to update cart total on check-box check/unchecked.

Currently system is working like once I clicked on check-box, my custom action is call and get an Ajax response with some amount. How can update this amount to cart total after complete this action?

You can share your code/reference here. Any help would be greatly appreciated.


texts: How to resolve .htaccess not working on localhost?

texts:
I copy all files of my website for to run it on my PC, but when I want to see pages it doesn't work and show me the phpinfo(). I have .htaccess in root and this is the code of it but it doesn't work and I also can't see backend page!

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

Where is the problem?


texts: How to reorder input billing address in Magento 2

texts:
I want move this input to this, it is suffix input. I use this code but it not work in billing address. I created module and followed https://inchoo.net/magento-2/frontend/reorder-input-fields-shipping-billing-step-magento-2/ but it not work for me.

Please help me.

My code in checkout_index_index of my theme

<item name="shipping-step" xsi:type="array">
    <item name="children" xsi:type="array">
        <item name="shippingAddress" xsi:type="array">
            <item name="children" xsi:type="array">
                <item name="shipping-address-fieldset" xsi:type="array">
                    <item name="children" xsi:type="array">
                        <item name="prefix" xsi:type="array">
                            <item name="sortOrder" xsi:type="string">1</item>
                        </item>
                        <item name="suffix" xsi:type="array">
                            <item name="sortOrder" xsi:type="string">2</item>
                        </item>
                    </item>
                </item>
            </item>
        </item>
    </item>
</item>


texts: How to get product ids from $observer->getEvent()->getOrder()

texts:
When using

$order = Mage::getModel("sales/order")->loadByIncrementId($OrderNo);

I can access product ids by

foreach ($order->getAllItems() as $item)
{
    if ($item->getParentItemId() != NULL) continue;

    echo $item->getProductId();
}

But when I access the order via an event observer this method fails.

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

How do I get product ids in this case?


texts: Solr Search in EE - Search Configurable product by child SKU

texts:
I am using EE-1.14.1 with Solr search enabled, and need to set it up so that users can search for the SKU of a simple product, and get shown the configurable product that it is associated with.

These simple products are not visible in search.

For example, if I have the following product:

Product Name         Type            SKU
--------------------------------------------------------
Chair Red/Green      Configurable    Chair-95
 - Red Chair         Simple          CH95-R
 - Green Chair       Simple          CH95-G

...then a search for CH95-R should return the parent product (Chair-95) on the search results page.

Can anyone point me in the right direction?


texts: Before modifying the website code please make sure it is not used in index.php in Magento 2

texts:
I am working on creating the multistore website when I editing the store configuration I got the below notification.

  Before modifying the website code please make sure it is not used in
  index.php

what is it means?

Can you explain more with any examples if possible?


texts: How to add cutom class for specifed menu id in main top menu?

texts:
Am new to magento 1.9 using custom theme,How to add custom class for particular Topmenu id for playing it with css without disturbing other menu ids.

 to

I dont know which file to edit? I saw top.phtml,searched on google but no use for me.I want to OFFERZONE on some differnt colour.Any help pls..


texts: How can I remove the SKU from the compare page in Magento 1.9?

texts:
I'm trying to remove the SKU from the frontend but keep it in the backend. It's used to process orders but it's not something the customer needs to see in this case. All is well except I'm stuck on the compare list page (site.com/catalog/product_compare/index/).

In /app/design/frontend/rwd/default/template/catalog/product/compare/list.phtml on line 112 it calls the SKU grouped together with the other attributes:

<?php echo $this->helper('catalog/output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?>

I'm honestly not sure where to go from here since it's grouped with the other attributes and it's just calling them all :/


texts: Magento 2: Programmatically create, activate and authorize a 'New Integration'

texts:
I have to create, activate and authorize a 'New Integration' programmatically. And then return it's 'Access Token'.
I followed the guide: http://devdocs.magento.com/guides/v2.0/howdoi/webapi/integration.html but unable to solve.


texts: remove all other shipping method if there's a method having shipping amount zero

texts:
Could it be possible to remove all the shipping methods except the one having shipping amount 0?

There may be a promotion rule which will return the amount 0 for shipping, so it must not be removed.


texts: Source Model not found for design attribute

texts:
I have looked at similar answers for this question and non seem relevant to me as I haven't incorrectly named anything.

I have downloaded a sql from my live site and imported it into my local wamp server.

Now, when I try to edit a product in the backend of Magento 1.6.1 I get this error.

Source model "catalog/entity_product_attribute_design_options_container" not found for attribute "options_container"

I've looked at my tables and it doesn't seem like anything is missing.

Could something of happened during the export/import of the sql?


texts:
there I'm trying to create a file upload attribute for a product this is what I have so far.

InstallSchema.php

    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'my_attribute_image',
        [
        'type' => 'varchar',
        'backend' => 'Vender\module\Model\Attribute\Product\Image',
        'frontend' => '',
        'label' => 'My Attribute Image',
        'input' => 'image',
        'class' => '',
        'source' => '',
        'group' =>'My custom group',
        'visible' => true,
        'required' => false,
        'user_defined' => false,
        'default' => 0,
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => true,
        'used_in_product_listing' => true,
        'unique' => false,
        'apply_to' => ''
        ]
    );

Model\Attribute\Product\Image.php

use Magento\Framework\App\Filesystem\DirectoryList;

class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
{

protected $_uploaderFactory;
protected $_filesystem;
protected $_fileUploaderFactory;
protected $_logger;
protected $httpFactory;

public function __construct(
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\Filesystem $filesystem,
    \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory,
    \Magento\Framework\HTTP\Adapter\FileTransferFactory $httpFactory
    ) {
    $this->_filesystem = $filesystem;
    $this->_fileUploaderFactory = $fileUploaderFactory;
    $this->httpFactory = $httpFactory;
    $this->_logger = $logger;
}

public function afterSave($object)
{

    $attributeCode = $this->getAttribute()->getAttributeCode();
    $image_name = $_FILES["product"]["name"]["my_attribute_image"];
    $path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('ProductAttributes');

    // add image name as attbute value
    $object->setData($attributeCode , $image_name);
    $this->getAttribute()->getEntity()->saveAttribute($object, $attributeCode);

    try {
        $uploader = $this->_fileUploaderFactory->create(['fileId' => $image_name]);
        $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
        $uploader->setAllowRenameFiles(true);
        $result = $uploader->save($path);
    } catch (\Exception $e) {
        if ($e->getCode() != \Magento\MediaStorage\Model\File\Uploader::TMP_NAME_EMPTY) {
            $this->_logger->critical($e);
            echo "ERROR";
        }
    }

    echo "<pre>";
    print_r($_FILES);
    echo "</pre>";

}

}

$attributeCode is returning the correct value

$image_name is returning the correct value

$path is not including the domain name but is from home/public_html/pub/media...

The image name is correctly stored in the database in catalog_product_entity_varchar

But the image doesn't save in the folder or anywhere I can see.
No errors are thrown if i select an image but if i leave it empty error is echo

Please help


texts: How to override the model class in magento2

texts:
i am trying to override \Magento\Payment\Model\Method\AbstractMethod class method assignData method in my custom class but its not working.

Model class

 namespace Vendor\Module\Model;
class PaymentCustomData extends \Magento\Payment\Model\Method\AbstractMethod {

    public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Payment\Model\Method\Logger $logger, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = array()) {
        die(__METHOD__);exit;
        parent::__construct($context, $registry, $extensionFactory, $customAttributeFactory, $paymentData, $scopeConfig, $logger, $resource, $resourceCollection, $data);
    }
    public function assignData(\Magento\Framework\DataObject $data) {
        var_dump($data->getData());
        exit;

     return $this;
    }

}

di.xml

   <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <preference for="Magento\Payment\Model\Method\AbstractMethod" type="Vendor\Module\Model\PaymentCustomData" />
    </config>


texts: create event observer for new attribute save action of product

texts: I want to create an event observer  when admin create a new attribute or save existing attribute from admin panel. I have not found any suitable event observer.  Please can help me??


texts: Change default selected country based on GeoIP

texts:
I have changed the default country of store by below setting.
Admin -> System Configuration -> General -> Countries options -> Default country
But, now I want to change the country selected based on Customer GeoIP.
How can I do this?


texts: Product information tabs are not displaying fully for newly adding product. General, price etc., are missing in magento in 1.9.3.2

texts: Product information tabs are not displaying fully while adding New Product. From Inventory its displaying. General, price, Images etc., tabs are not displaying. Anyone give the solution about how to enable those things. Is there anyway to check in database or in codes?


texts: Add a check box to interact with sales_order table magento 2

texts:
I'm still new in Magento2. I need to add a checkbox named "Do you want to ship all items at once?"(if there are multiple items) underneath the Shipping Method section. I know in the sales_order table has a field name called "can_ship_partially", however, it is not exposed in the front end. So my goal is this:

If the customer checks the box, it should write to the quote or remember it somewhere else.
When the customer placed the order, the value "can_ship_partially" should reflect accordingly.

Thanks a lot in advance.


texts: Widget/block code in product custom attribute not rendering at front-end magento 2.2.5

texts:
I have created custom attribute of Input Type "Text Area" with WYSIWYG option Enable.

After that add widget code in that product custom attribute input at store back-end.

Its showing same code instead of widget value at store front-end product detail page.

Code in template file.

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

Please guide me, why widget/block code not rendering at front-end ?


texts: Parent category is showing products in subcategories, even though product was not assigned to parent category

texts:
Let's assume I have a category, Clothing and this category have a sub-category, T-shirts.

Now I add a product to the T-shirts category (by checking the box in the add product screen), but I don't check the Clothing category. So, I assumed this meant that the product would only appear in the T-shirts category on the front end, and not in the  parent category Clothing.

However, the product appears in the Clothing and T-shirt categories.

This is a problem because the T-shirt category is an "Include in navigation menu" > No category, i.e. It is supposed to be hidden. All the products in the category have visibility of catalog, so they don't appear in search results.

I've investigated this quite deeply so far and have found that the problem is with the Magento catalog indexing. Running the Category Products indexer from System > Index Management rebuilds the index, running Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Indexer_Product::reindexAll().

This function SELECTs various data from several category-related tables and pipes it into the catalog_category_product_index table, which is the table used to generate the products collection for the category pages.

Does anyone have any suggestions as to how to hide/prevent products from sub-categories appearing in their parent categories?

I'm using Magento 1.4.1.0. The Clothing category is set to Anchor and the T-shirts category is not. Use flat category is set to yes.


texts: magento 2 - Actions column link to external URL such as google.co.uk?

texts:
I have the below code for a Action column option:

$item[$name]['view'] = [
    'href' => 'www.google.co.uk',
    'target' => '_blank'
    ),
    'label' => __('View')
];

What I'm trying to do is add an external URL to an action column such as google.co.uk. It should open a new tab and displays Google's home page.

Currently, the code provided appends www.google.co.uk to the Magento page URL.

Could you please let me know where I'm going wrong?

Thank you.


texts: sorting and filtering not working in custom admin module

texts:
I am trying to implement an admin module in magento which has a grid in the first page and grids in the tabs while editing the grid entities.

The main grid works fine, but the grids in the tabs are not working fine.

The problem I found while I debugged the code is that, I am loading the collection in the grid with field filtering, ie I am filtering the collection with filter that is the user id. I did this because I need only data of a single user from the table. This made the entire problem, the data in the grid is coming correctly, but the filtering,sorting and searching feature inside grid is not working and returning a 404 not found error page. I tried removing the field filter I added while getting the collection, then it works fine but all the data in the table is coming which is the opposite to my requirement. Is there any possible solution to this. Here is the way I am trying to do:

protected function _prepareCollection() {
    $collection = Mage::getModel('merchant/subscriptions')->getCollection()->addFieldToFilter('user_id', Mage::registry('merchant_data')->getId());
    $this->setCollection($collection); //Set the collection
    return parent::_prepareCollection();
}

UPDATE:

There has been a development in the issue. I came to know about some changes to be made in the code. I changed the _prepareCollection() to the following:

protected function _prepareCollection() {
    $regData = Mage::registry('merchant_data');
    if (isset($regData)) {
        $regData = $regData->getId();
    } else {
        $regData = $this->getRequest()->getParam('user_id');
    }
    $collection = Mage::getModel('merchant/subscriptions')->getCollection()->addFieldToFilter('user_id', $regData);//Getting the collection from the model. Here this is pointed to transactions table.
    $this->setCollection($collection); //Set the collection
    return parent::_prepareCollection();
}

and getGridUrl() to the following:

public function getGridUrl() {
    return $this->getUrl('*/*/subscriptiongrid', array('user_id', Mage::registry('merchant_data')->getId(), '_current' => true));
}

Now no 404 error shows, but when searching, filtering and sorting no records are shown. It's returning null values. I have subscriptiongridAction in my controller. Following is the action:

public function subscriptiongridAction() {
    $this->loadLayout();
    $this->getResponse()->setBody(
            $this->getLayout()->createBlock('merchant/adminhtml_merchant_edit_tab_subscriptiongrid')->toHtml()
    );
}

Any idea what could solve this issue?


texts:
I want to set my shipping cost depending on the product  weight.
if weight<=5kg, shipping cost=5AED
if weight>5kg, then shipping cost will be increased by 2AED for each 1kg.


texts: How to upgrade website in Magento 2.0 to Magento 2.3

texts: Currently my client's website in Magento 2.0 (running on PHP-5.6). Now we want to upgrade it to Magento-2.3. Please help me in upgrading the website.


texts: How to boost number in /order_id/375/ URL or how to hide this part in URL?

texts:
On fronted when customer clicks on "Vew my order" he gets URL like this:
domain.com/sales/order/view/order_id/375/

when he clicks on "print order" the URL will be:
domain.com/sales/order/print/order_id/375/

By looking at the "375" people can know the number of actual orders site has.

How can I boost that order_id/375/ to a longer number
for example order_id/1537615/. Where is this info stored in the database?

or, is it possible to hide this part of URL  (view order  and print order at customer account)
or do something that will hide the actual amount of orders on site.
What file do I need to edit to replace  /order_id/" in that URL  and use a different word instead , for example "/transaction/

I use Magento 1.9.2.2


texts: Magento 2: Is it possible to add a Price attribute to Customer entity?

texts:
I'm trying to add a custom field called minimum order amount to the Customer entity.

The input field should be appropriate for dollar amounts, so the best option I found is price.

Here is my code:

        // minimum order
        $eavSetup->addAttribute(
            'customer',
            'minimum_order_amount',
            [
                'type' => 'decimal',
                'backend' => 'Magento\Catalog\Model\Product\Attribute\Backend\Price',
                'label' => 'Minimum order amount',
                'input' => 'price',
                'visible' => true,
                'required' => false,
                'system' => false,
                'position' => 152,
            ]
        );
        $a = $this->eavConfig->getAttribute('customer', 'minimum_order_amount');
        $a->setData(
            'used_in_forms',
            ['adminhtml_customer']
        );
        $a->save();

There are no errors when I run magento setup:upgrade, but the field does not appear in the admin area.

If I use text instead of price, then the field shows up.  But it shows up with 4 decimal places and no validation.  For example entering $500 into the field will result in saving '0' to the database.

Is there a way to use a price attribute attached to the Customer entity?  Or is there an alternative to validating this field as a dollar amount?


texts: Magento 2.How to get cart product collection in product view page

texts:
I got cart product collections by following code

    $quoteId = $objectManager-> create('Magento\Checkout\Model\Session')->getQuoteId();
    $cartData = $objectManager->create('Magento\Quote\Model\QuoteRepository')->get($quoteId)->getAllVisibleItems();
    $cart = $objectManager->get('\Magento\Checkout\Model\Cart');
    $items = $cart->getQuote()->getAllItems();

But once i delete product from cart it doesn't return exact value,
i can get the correct answer after i refresh the cache.

What is the issue in it and how to get the solution for this problem.?


texts: Apply fee for Paypal Payment only for a customer group

texts:
i would like to apply a 3% Fee if customer selects Paypal as payment method and if customer is a reseller.
If the customer is a normal customer(and not a reseller) the fee should not be applied.
Have you got suggestions on how to do so? Could i start from an existing plugin?


texts: Magento PWA: Which to use venia or vue storefront

texts:
I am looking for better options to implement PWA with my M2.3 store. Searched and found that we have 2 options (Venia and Vue) right now which provide a basic structure to start with PWA. While Vue have much features and options in it.

I am confused with which i should use ? I dont have experience in either React or Vue and On my store i have various custom pages and forms that i have built for client requirement using Using Custom Extensions which need to implement in PWA theme as well.

Can you suggest me which to follow ? which will be good in development and future secure ?


texts: Magento : How to Solve Fatal Error SetDateRange()

texts:
When I try to filtering report by date range in admin, It show me error like this.

  Fatal error: Call to a member function setDateRange() on boolean in
  app/code/core/Mage/Reports/Model/Report.php
  on line 50

Any one have idea?


texts:
I have created a custom category attribute using this tutorial http://gauss-development.com/blog/tutorials/adding-custom-category-attributes-magento/.

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

I have checked that the attribute is stored in eav_attribute table normally, but I can't get it's value.

$category = Mage::registry('current_category');
if ($category){
   $value = $category->getData('cat_extra_title'); //value is empty
}

Any ideas?


texts: Add test on the new custom attributes magento 2

texts: I added 3 new attributes: Personnal Contact must be just with letter else an exception will be displayed and Website must be valid and Tel must be Numerique so how to do that please


texts: While loading site it show all menus for seconds

texts: While loading my site it show all menus for some seconds and then it disapears and all is normal. How can I solve this issue? I searched for it and read something about preloader.


texts: Is there an Extension In Magento to automaticaly take a colour from a product image to produce a colour swatch for that product image

texts:
My client wants a way for a color swatch that takes the color automatically from the product image. For example I have an image of a a woman in a green dress, is there a way to get the color from say the dead center of that image and create a swatch from it automatically? There doesn't look like there is a way but my client is really insistant as she wants the color swatches from all the products to be an exact match to the product without having to upload different color/images for each one or pick a color from a swatch.

Any help on this would be amazing. Thanks


texts: Invalid Form Key when users login to my site

texts:
I'm relatively new to Magento, and I need some help.
We're on Magento2, and we just upgraded from Magento 1.x.
Whenever our users come to our site and click login they are taken to a subsite for registered customers.
(e.g. mysite.com --> dealer.mysite.com)
When they enter their credentials they get an Invalid Form Key error.  They can ignore the error, re-enter their credentials and successfully, login on their 2nd try.
This is driving a ton of calls to our help desk, and the team is struggling to figure out how to resolve it.
I've looked up the error, and everything points to admins getting it, not the customers.  I'm having no problem with it when logging into our admin site.
We also have a staging site on our domain, and it isn't having the problem.
Like I said, I'm relatively new to magento, so detailed guidance is most appreciated


texts: Magento 2.2 showing error on order place "no such entry for orderid="

texts:
In Magento 2.2 When i click on place order, i am getting this error

  no such entry for orderid=

Please anybody can sugguest me how can i solve it.

Thank you


texts: How to remove the visibility for customer address attribute field while creating order in magento backend

texts:
I wish to delete customer  address attribute  in create order section in Magento backend
I have tried to override the following file to unset the attribute before rendering. For testing purpose, I have edited the core file and unset the attribute from
protected function _prepareForm()

vendor/magento/module-sales/Block/Adminhtml/Order/Create/Form/Address.php
It works fine in core file, but when I override this file using preference, I am unable to override the file, can anyone suggest me to override this
I have tried based on this How to Hide Field from Order Create From Back-end Magento 2


texts:
When I have products in categories ( I have sub-categories in this category) I don't have sort by category just sort by price. I want to add sort by category with sort by price.

For example :

if i have computer category and i have laptop and Desktop sub-categories. I have many products also in computer category. When i am in computer catalog i wish to show also in navigation layer :

Sort by
 Category :
   Laptop(1)
   Desktop(2)

What is the problem ?


texts: Can't set product's stock - default stock: 0

texts:
I have issue on Magento 2.3.2 - Every product I add has Salable Quantity -- Default Stock: 0 -- therefore all the time out of stock.

It happens to every product I add. I tried reindexing, clearing cache, going into production mode, setup:upgrade, setup:di:compile.

Any suggestions please?


texts:
After PHP upgrade site got fatal error, which led to be icon v extension missing in on the server so after adding this now pages is missing footer and not displaying products properly? s our page is kiernans.ie anyone have any ideas what it could be?

Code: Call to undefined function mb_substr() in /home/foodpack/public_html/app/design/frontend/default/theme281k/template/catalog/product/list.phtml on line 136


texts:
I am working on magento 1.9.2.2 and with latest version of chrome 46.0.2490.71 but it is showing

  http://xyz.xyz.xyz/xyz/skin/adminhtml/default/default/media/uploader.swf
  403 (Forbidden)

uploader.swf was present in adminhtml/default/default/media  folder
and permission provided is 777


texts: Magento 1.9.2.2 Patches onward - What is the list?

texts: I have an installation of Magento 1.9.2.2 and I am lost of how to know what security patches I need to install. I have not installed any since I first installed this installation. I checked the directory app/etc and no file for installed patches is there.


texts: How to checked customer is login or Not using customer Id or email using REST API

texts: How We can checked customer is login or not using Customer Data,


texts:
Based on this post I could pass some data to the window.checkoutConfig, this is great.

My problem is, that my data is dynamic and my plugin runs later when magento collects the payment methods. I want to add some extra information (shipping date) to my template file.

How can I do this, how can I access data from my plugin?

In my template file:

    <input type="radio"
           name="payment[method]"
           class="radio"
           data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>


texts:
I have a couple of customers who are facing issues while login through the front end. It keeps loading where other customers are able to log in.

if I remove that account and create a new one then it's working fine. I wanted to debug what's exactly wrong with that account?

No logs no exception are generating, As soon login request sent to the server it keeps loading infinitely. If anyone have an idea do suggest.  Thanks


texts: My Magento command for compile is stuck What should I do and what is the problem??


texts: Magento 1.9.x : Newsletter Subscription Event

texts:
Is there an event in Magento 1.9.x for Newsletter Subscription from the Profile page?

How do I find out when a user updates their newsletter subscription preference from this page?

I tried controller_action_predispatch_newsletter_manage_save and newsletter_subscriber_save_after events. Although not getting any subcriber data through either of the following:

$event = $observer->getEvent();
 $isSubscribed = $event->getRequest()->getParam('is_subscribed');

or

$subscriber = $observer->getEvent()->getSubscriber();
$data = $subscriber->getData();


texts:
I am getting below error when I am redirected from payment gateway to merchant page. Tried to google for solution but din't find any solution for this.

  Fatal error: Call to a member function getMethodInstance() on boolean
  in
  /home/website/public_html/website/homedir/public_html/app/code/core/Mage/Payment/Helper/Data.php
  on line 119

public function getInfoBlock(Mage_Payment_Model_Info $info)
{
    $blockType = $info->getMethodInstance()->getInfoBlockType();
    if ($this->getLayout()) {
        $block = $this->getLayout()->createBlock($blockType);
    }
    else {
        $className = Mage::getConfig()->getBlockClassName($blockType);
        $block = new $className;
    }
    $block->setInfo($info);
    return $block;
}


texts: Resize and Crop to set width/height without stretching

texts:
I am trying to get magento 2 to resize my images to a set width and height then crop them to the correct dimensions. I am trying to do this via view.xml and php but both are running into the same problems

I have looked around at a few different guides and similar questions. http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-images.html has instructions on what options I can change

Aspect Ratio: I do not want my images to be stretched so I set this to the true.

Frame: I do not want a frame around my image so I set this to false.

Constrain: This seems to have no effect on my images and only seems to be for cases where the image is smaller than the desired dimensions.

I have fooled around with different options and started looking into the core code. I can get an image the right size by turning aspect ratio off but the image becomes stretched. I can get an image the right size by turning on frames but that will add frames to the side/top/bottom of my image.

As far as I can tell Magento 2 has no way to remove parts of images with the default image resizer. It seems it can only resize and add frames. This is something that I know other systems can do (as I currently rebuilding a woocommerce site in magento 2) and will be something clients demand.

My current possible solutions to this are:

Crop all images outside magento then re-upload (this is unacceptable
as client will continue to upload images with incorrect dimensions
and we may want multiple aspect ratios within the system)
Hack/extend the core to add the ability to crop images when resizing.
This does not look easy from what I have seen and I am curious if
there is a 3rd party extension/easy solution that I have missed in my
searching.


texts: Magento2: How to enable pdf on wysiwyg to upload attachments to products?

texts: Where can I edit the code to enable the pdf's or how can I do it on Magento 2 for uploading pdf attachments to products?


texts: How to add and display images in subcategory Magento 1.9

texts:
I'm new to Magento and have a few obstacles, maybe someone can handle it here, I want to customize the appearance of my subcategory to be like the following picture.

https://i.stack.imgur.com/byLBg.png

Please help. Thanks in advance..!


texts: render different layout (rather than the default one)in controller

texts: the case is as follow i create a module that save articles in DB and when the the saving is successfull i need to redirect the user to thanks page .the contoller render the default layout in the index method how i render another layout when the saving process is complete in save method ,my module structure is as follow


texts:
Any one tell me how can i study magento2 fully any free material or tutorial is there

Need Help


texts: magento EE 2 Campaign / Promo deactivate

texts:
I want to deactivate particular campaign in staging dashboard in Magento EE 2.1.6  version.
Please suggest.


texts:
my module etc/modules/Minicart_Quick.xml

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

app/code/local/Minicart/Quick/etc/config.xml

   <?xml version="1.0"?>
  <config>
     <modules>
        <Minicart_Quick>
          <version>0.1.0</version>
        </Minicart_Quick>
     </modules>
     <frontend>
       <routers>
          <routeurfrontend>
              <use>standard</use>
              <args>
                 <module>Minicart_Quick</module>
                 <frontName>Quick</frontName>
              </args>
           </routeurfrontend>
       </routers>
    </frontend>
</config>

app/code/local/Minicart/Quick/controllers/minicartcontroller.php

    <?php
class Minicart_Custom_minicartcontroller extends Mage_Core_Controller_Front_Action{

    public function add_to_minicart()
{
    Mage::log("control get",null,"mini.log");
    $this->loadLayout();
    $layout = Mage::getSingleton('core/layout');
    $block = $layout->getBlock('cart_sidebar');
    $html = $block->toHtml();
    $this->getResponse()->setHeader('Content-type',
        'application/json')->setBody($this->_success($html));
    return $this;
}
}

Ajax function

function minicartAjax(){
var url = "<?php echo Mage::getUrl('quick/controllers/add_to_minicart');?>";
alert(url);
jQuery.ajax({
    url: url,
    dataType: 'json',
    success: function(data){
        //Your minicart html
        alert("hii");
    }
});

}

this is my updated code it's not working fine


texts: How to create a swipe megamenu for mobile view?

texts:
I have created a custom module for Megamenu. In desktop view it looks good and working fine. In mobile view, I want to implement a functionality but I'm not sure how to do that.

The functionality which I want to implement is that when a user clicks on mobile menu icon, the menus will be displayed without any issues. In order to close the menus, user needs to click the body of the web page. We want it to make as a swipe one.

When a user swipe the menu, it should be closed.

Could anyone please help me with this?


texts: Google API is not working properly on Magento 2

texts:
We actually work with Magento 2.2.1 and have placed all information into the fields in Stores->Configuration->Sales->Google API. But if we check with Chrome Tag Assistant we get a message "Same web property ID is tracked twice." for Google Analytics.
The AdWords conversion does not work at all. No conversion will be tracked.

Anybody who can help?


texts: Event on entering the zipcode in cart page

texts:
In cart page, on entering the zip code,an event is triggered to send the following data:

{"address":{"region_id":"0","region":"","country_id":"US","postcode":"12345"}}

In response, the shipping method and shipping price will get updated.
Now, I want to get the "postcode" so that I can update my custom shipping price in the block. Any help will be appreciated.


texts: Magento 2 - Cart rule - Buy X get free gift

texts:
Is there any way or extension to set their cart rules?

  Rule 1: buy X > 50 - get free gift A
  Rule 2: buy Y > 100 - get free gift B

If order is made with Y > 100  AND X > 50

  only get free gift B (not both)

And the other cart rules (if has) still kept


texts: Display and Change tax rate according to custom option change

texts: I want to display tax rates and want to change tax rates according to product custom option attribute change in magento product details page, can any one help me about it?


texts: How to create the full page cache (FPC) for the request with custom tag in magento?

texts:
I need to create a cache for the request with tag "WORDPRESS_FPC".
I don't like the option of adding this tag to each block. Does anyone have other options or know how to clear the full page cache for the request?

I've already added cache type:

<!--app/code/local/Mod/Wordpress/etc/config.xml-->
    <global>
        <cache>
            <types>
                <wordpress_full_page translate="label,description" module="mod_wordpress">
                    <label>Wordpress Page Cache</label>
                    <description>Wordpress full page caching.</description>
                    <tags>WORDPRESS_FPC</tags>
                </wordpress_full_page>
            </types>
        </cache>
    </global>

I've already added request to FPC:

<!--app/code/local/Mod/Wordpress/etc/config.xml-->
    <frontend>
        <cache>
            <requests>
                <wordpress>
                    <post>
                        <view>enterprise_pagecache/processor_default</view>
                    </post>
                </wordpress>
            </requests>
        </cache>
    </frontend>


texts: how can I create different attribute set for different category in magento

texts:
How can I create different attributes for different category in Magento.
For example I have categories like Paints and tiles. Since these two are entirely different product category, the attributes will also be different. how can I set different attribute for this. Please suggest me the best method to do this, thanks in advance.


texts: Magento2 How to add new field in One step checkout shipping section/delivery options, when flatrate is selected?

texts:
I need to add a new checkbox field when flat rate shipping is checked. saying
'I give permission to leave items unattended'.
& then pass it value accordingly


texts: Qty for item status to become out of stock negative value malfunction

texts:
When on the Inventory tab whilst editing a product there is the option to set Qty for Item's Status to Become Out of Stock.

I've enabled Backorders on the product & would like to set the out of stock value to a negative number, thus only accepting a limited amount of backorders.

However, Magento doesn't seem to set the product to out of stock once that negative stock level is reached. Is this functionality not natively supported by Magento?


texts: Base Image, Small Image, Thumbnail Image are not selected after product images csv import

texts:
I have successfully imported product images using csv file but Base Image, Small Image and Thumbnail Image columns in Images tab, are not selected. No Image is selected by default. So products images are not displaying in front end.

Can someone please help in it, how they gets selected after product images csv imported


texts: Magento 2.1.9 PayFlow pro - Transaction Declined issues

texts:
I configured PayFlow Pro on Magento 2.1.9 and I tried Test mode which seems to work fine, however when switching to Live mode, I'm getting the following Result from the debug log.
'RESULT' => '12',
'RESPMSG' => 'Declined',
'HOSTCODE' => '58', (or) '57'

I've gone through with the following link from PayPal to go through with the issue but I feel everything fine (IDK if I need to check with Card Issuer (I also tried using Different Cards))
UPDATED:
This issue is only related to Australian based PayFlow Pro setup. which uses the processor PayPal Australia in your Payflow account.
Cause:

Payment Processor: PayPal Australia didn't accept $0 Authorization which is sent by Magento 2 as default.

How to Resolve This?
I have answered it. please review and put your comment if you have a better idea


texts: How to add select menu to shipping method and display the inserted text in the Admin Panel

texts:
I know my question is not clearly correct, but i want to ask.

I am using Magento 1.9.0.1.

I am working on a custom shipping method module and i've created it without any problems.

When i go to the checkout page i can select it and when the order is submitted i can see that this shipping method is chosen. Everything works just fine.

However i've decided to add an select menu with the account addresses.

I've succeed to display the select menu with actual account addresses with this line of code:

echo $this->getAddressesHtmlSelect('shipping');

Yes it is very simple to display it. But the problem comes that in the admin panel i can not see the selected result.

I know i miss a lot of things to make it happen, but at this time i have no idea how can i save this choice.

Everything that i am asking for is:

How can i make the selection for this shipping method to be shown in the order view page in admin panel?

Right now i can only see that this shipping method is chosen, but i can not see the selection choice.

P.S.

Right now my getAllowedMethods() function has the following code:

public function getAllowedMethods()
{
    return array('bestway' => $this->getConfigData('name'));
}

Thanks in advance!


texts: Show custom product price in listing page

texts:
I am developing an extension where I need to show discount prices of specific products on listing page. That products would be selected from admin end.

To display custom listing I have to replace the base file with below file of mine

app/design/frontend/default/default/template/mytheme/catalog/product/list.phtml

The list.phtml file is same as in base, but i have added some conditions for price display.

How could I achieve this ?

Thanks


texts: Magento REST Api error "Request does not match any route."

texts:
create new rest api using magento 2

app/code/AlanKent/CalculatorWebService/etc/module.xml
app/code/AlanKent/CalculatorWebService/etc/di.xml
app/code/AlanKent/CalculatorWebService/etc/webapi.xml
app/code/AlanKent/CalculatorWebService/Api/CalculatorInterface.php
app/code/AlanKent/CalculatorWebService/Model/Calculator.php

then execute
http://mydomain/index.php/rest/V1/calculator/add/2/3

but i got "Request does not match any route."

I am new to magento 2 . Any one can help me


texts: Magento 2 Open Source End of Life Timeline

texts: Does anybody have the timeframe for end of life support for Magento 2 Open Source? All I've been able to find from an official source is this (https://magento.com/legal/terms/enterprise-agreement#support), which is for Enterprise/Commerce editions.


texts:
my custom order action get customer by ID in magento and check condition
order available or not

and how to get dynamically load get customer by ID in magento my custom order
action

so how to achieve this.

  /app/code/local/Modulename/Connect/controllers/CustomerController.php

    $customerId = 23;

    $customer = Mage::getModel('customer/customer')->load($customerId);

    if($customer != '') {
         $cust_id=$customer->getId();
    }


texts: Not valid template file:frontend/base/default/template/catalog/category/page_header.phtml

texts:
This is caused by the following piece of code in app/design/frontend/smartwave/mango/layout/local.xml (such a template in such a location does not really exist in any of the themes):

<action method="setTemplate"><template>catalog/category/page_header.phtml</template></action>

The only one existing template is located in app/design/frontend/smartwave/mango/template/page/html/page_header.phtml

Has someone any ideas on how to correct this issue, without causing any impact on the webshop?

The entire xml code looks like this:

 <catalog_category_default>
     <reference name="root">
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="one_column"><template>page/1column.phtml</template></action>
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="two_column_left"><template>page/2columns-left.phtml</template></action>
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="two_column_right"><template>page/2columns-right.phtml</template></action>
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="three_column"><template>page/3columns.phtml</template></action>
     </reference>
     <reference name="page.header">
         <action method="setTemplate"><template>catalog/category/page_header.phtml</template></action>
     </reference>
     <reference name="left">
         <remove name="tags_popular"/>
         <remove name="catalog.leftnav"/>
         <block type="core/template" name="catalog.category" before="-" template="catalog/category/main_categories.phtml"/>
     </reference>
 </catalog_category_default>

 <catalog_category_layered>
     <reference name="root">
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="one_column"><template>page/1column.phtml</template></action>
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="two_column_left"><template>page/2columns-left.phtml</template></action>
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="two_column_right"><template>page/2columns-right.phtml</template></action>
         <action method="setTemplate" ifconfig="mango_settings/category/page_layout" condition="three_column"><template>page/3columns.phtml</template></action>
     </reference>
     <reference name="page.header">
         <action method="setTemplate"><template>catalog/category/page_header.phtml</template></action>
     </reference>
     <reference name="left">
         <remove name="tags_popular"/>
         <block type="catalog/navigation" name="catalog.category" before="-" template="catalog/category/category_nav.phtml"/>
         <reference name="catalog.leftnav">
             <action method="unsetChild"><child>category_filter</child></action>
         </reference>
     </reference>
 </catalog_category_layered>


texts:
I'm trying override getBreadcrumbPath() in  Magento\Catalog\Helper\Data.

  In di.xml

<type name="Magento\Catalog\Helper\Data">
    <plugin name="Helper" type="XXX\YYY\Plugin\Helper\Data" sortOrder="10"/>
</type>

In plugin

public function aroundGetBreadcrumbPath(\Magento\Catalog\Helper\Data $subject, callable $proceed)
{
echo "hi";exit;
}

But its not working


texts: How to add "httponly" attribute set on existing cookie ? (Magento 1)

texts:
In Magento 1
I can see many of the cookie are without Secure flag and HttpOnly set on website.

Is their any way to set Secure flag and HttpOnly set on all server Cookie ?
I need to make all server cookie secure.
I have tried “Use HTTP Only” option in Magento to add "httponly" flag in cookies.
System > Configuration > General > Web > Session Cookie Management
It works but not for all cookies.
Also i have tried
override isSecure method from Mage_Core_Model_Cookie model, method:

public function isSecure() {

return $this->_getRequest()->isSecure();

}

But, This does not work.
Any thoughts on this ?
Thankyou


texts: Cron job image import issue - Magento 2.3

texts:
In Magento 2.3, I am importing data from the .xml file. The product name, SKU and product description i can import via cron job but I cannot import the product image. Can you help me?

Thanks in Advance!


texts: How to remove the product price for the Payment page in magento 2

texts:
Only i need to show the number of quantity items in the order summary section in payment page.

if any one know the answer please share the exact code and folder structure. since i'm new to magento.

Any help would be appreciated. Thank you!

Payment page order summary section screenshot:


texts: I am currently trying to create a robots dot text file to improve my SEO. I am not quite sure were to start. I have read a few tutorials and stay don't feel comfortable making one. Can someone point me to a good source or explain in their answer where I want the robots to be able too crawl?


texts:
Which class::method() is responsible for Invoice Items Collection in the Invoice to Items Selection in the New Invoice page?
I just want to make some custom filter in this collection.
Can anyone guide me please.