texts: during theme installation im getting error

texts:
during theme installation, I'm getting this error:

Module 'Magento_InventoryCatalog':
[ERROR] Magento\Framework\Setup\Exception: Unable to apply patch Magento\InventoryCatalog\Setup\Patch\Schema\CreateLegacyStockStatusView for module Magento_InventoryCatalog. Original exception message: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'inventory_stock_1' already exists, query was: CREATE
SQL SECURITY INVOKER
VIEW inventory_stock_1
AS
SELECT
DISTINCT
legacy_stock_status.product_id,
legacy_stock_status.website_id,
legacy_stock_status.stock_id,
legacy_stock_status.qty quantity,
legacy_stock_status.stock_status is_salable,
product.sku
FROM cataloginventory_stock_status legacy_stock_status
INNER JOIN catalog_product_entity product
ON legacy_stock_status.product_id = product.entity_id; in /home/X/public_html/demo2/vendor/magento/framework/Setup/Patch/PatchApplier.php:232

Stack trace

how can i solve this error in order to keep the installation process?


texts:
I have configured Wordpress with Magento using Fishpig extension and it works as expected. However, I need to set different template for one particular wordpress category(Id - 8)

<wordpress_category_8>
        <reference name="wordpress_post_list">
            <action method="setTemplate">
                <template>wordpress/post/archive-list.phtml</template>
            </action>
            <action method="setPostRendererTemplate">
                <template>wordpress/post/list/renderer/archive-category.phtml</template>
            </action>
        </reference>
    </wordpress_category_8>

Template is not changing even after adding the above code in local.xml

Any help would be appreciated.


texts: Magento2: How to connect Magento website to an external webservice?

texts:
I have a Magento website that I want to connect to an external webservice to upload and update the website with products from my DB directly, can this be done? if so, please advise how.
Thank you.


texts: magento connect manager not showing installed extensions

texts:
I am unable to see any extension installed in magento in Magento Connect Manager.

Can someone help?


texts: Magento2 : How to check errors in magento store

texts:
In my store when I try to place order, it is not completing order placing process instead it is coming back to Shopping cart page with All products listed.

Server is very slow stated by the google chrome in Console.
I tried to Check the errors using inspect element. But I could not recognise the errors.
than I checked the error logs in {Magento root folder}/Var/log/

Exception.log
Debug.Log
System.log

After I tested the Payment When I check the Logs, I could not find any entries in Exceptions.log & Debug.log. New lines were found in the System.log which looks like this below.

I was not able to understand anything out of it.
Please help me to understand what might be the problem of my store not able to place the order.


texts:
I am planning to take the Certified Developer Plus exam. I have gone through the study guide, but have some questions that one of you might be able to shed some light on.

As stated on the Magento website, the exam is based on both CE and
EE. My question is, for some sections where the EE and CE differ
(like URL rewrites, Indexing) the study guide seems to imply that the
answers will be based on the CE rather than the EE. Is this correct?
Related to question 1, would this mean that the only EE modules that
I will be asked to answer questions on, are the ones specified in
chapter 11 (Enterprise Edition)? In other words, are chapters 1-10
based on CE and chapter 11 on EE?
Chapter 12 - Challenge questions. I have read in a thread that these
must be answered correctly 100%, otherwise one cannot pass the
test. Is this correct?  Do all challenge questions come for sections
that are already covered in the Study Guide?


texts: Erreur 'installation de Magento à l'aide de XAMPP

texts:
Salut à tous,

Je suis nouveau ici et je viens de commencer avec Magento.

J'utilise XAMPP v3.2.4  pour installer Magento v2.3.4 en local. j'obtiens les erreurs suivantes en etape 6 d'installation:


texts: Magento 2.4.1 currency update hourly by cron or change frequency

texts:
I have no problem with manual update currency rate in page
Admin > Stores > Currency Rates
How to create the cron run to update currency per hour?
Here my settings, it's works but not per hour

Now I find the Frequency.php, but I don't know how to add the new frequency "Hourly".

And I already make cron per hour to clean magento cache. It's work fine.
18 * * * * /usr/bin/php -c /etc/php.ini /home/domain.com/public_html/bin/magento cache:flush

Maybe the good way will be just create the new cron job like below, but I can't find the true syntax?
18 * * * * /usr/bin/php -c /etc/php.ini /home/domain.com/public_html/bin/magento currency:update


texts: Magento Cloud Upload changes to master without re-deploy everything?

texts:
On Magento Cloud, we noticed that each time we upload a code change to the master branch, running something like:

git push magento master

It runs some process and commands, and it takes many minutes. Sometimes it takes five minutes, and another take up to twenty minutes. In that time, the site is not accessible.

In some occasions, the changes we upload are minimal, some image or css change, or one line change of one file.

Someone know if is there some way that we could selectively upload these changes without the site being inaccessible for so long? Maybe omitting any of these processes that are executed, only when we don't see it necessary?

Thanks.


texts: Fatal error: Class 'Mage_Mageworx_Customoptions_Helper_Data' not found

texts:
I cannot find where Mageworx dir is...

/app/code/local
/app/code/core/

I didn't install the extension but seems to be called it in my page.. and send an error in the admin page.. in the product details, custom options.

need a help. Thanks


texts: "Requested store is not found" error in Magento 2.2.7 while opening categories from admin dashboard

texts:
I am getting an error while trying to open the categories form catalog in the admin dashboard. I have migrated the data from Magento1.9.2.0 to Magento2.2.7.

Getting this in error log.

  "{"0":"Requested store is not found","1":"#0
  /var/www/html/vendor/magento/module-store/Model/StoreManager.php(167):
  "


texts: Magento 2 : How Can I Update Quote Total

texts:
I am creating functionality for additional donation. I am trying to add donation amount in quote total but it will not reflect.

This my code portion of that part :

    <?php

    namespace Yogesh\Donation\Controller\Index;
    class Index extends \Yogesh\Donation\Controller\Index
    {
      public function execute()
      {
         $post = $this->getRequest()->getPostValue();
         $quote = $this->checkoutSession->getQuote();

         $donation = $post['donation_amount'];
         $grand_total = $quote->getGrandTotal();
         $new_grand_total = $grand_total + $donation;
         $quote->setGrandTotal($new_grand_total);
         $quote->save();

         $this->_redirect('checkout/cart');

    }
}

?>

Addition of donation amount not display or reflect on front side. How can I update quote total ?  Please any one have idea about that.

Thanks


texts: Grunt themes.js file overwritten when running composer install

texts:
When running the composer install command the www/dev/tools/grunt/configs/themes.js file is being overwritten and removing the config for my custom theme. When searching online I came across the following GitHub issue:

https://github.com/magento/magento2/issues/7196

See below the changes I tried based on the issue above:

Copy www/dev/tools/grunt/configs/themes.js to www/dev/tools/grunt/configs/local-themes.js and specify the custom theme as so:

module.exports = {
        custom_theme: {
            area: 'frontend',
            name: 'Custom/theme',
            locale: 'en_GB',
            files: [
                'css/styles-m',
                'css/styles-l',
                'css/petlandia',
                'css/email',
                'css/email-inline'
            ],
            dsl: 'less'
        },
    }

Rename grunt-config.json.sample -> grunt-config.json.

This method so far hasn't worked and the custom theme can not be found when running grunt exec:custom_theme. Is there anyway I can extend the themes.js file so that when running composer install or composer update my custom theme config is not removed?


texts: Magento 2 - Add a new product attribute with values from DB

texts:
I'm looking for creating a custom attribute for products, already have a CRUD module, with name and descriptions fields, so the names from my DB should be options of that attribute.
How do I need to correct this code, so it will get values from my DB? Thanks everyone!

class Material extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{
    /**
     * Get all options
     * @return array
     */
    public function getAllOptions()
    {
        if (!$this->_options) {
            $this->_options = [
                ['label' => __('Cotton'), 'value' => 'cotton'],
                ['label' => __('Leather'), 'value' => 'leather'],
                ['label' => __('Silk'), 'value' => 'silk'],
                ['label' => __('Denim'), 'value' => 'denim'],
                ['label' => __('Fur'), 'value' => 'fur'],
                ['label' => __('Wool'), 'value' => 'wool'],
            ];
        }
        return $this->_options;
    }
}


texts: Why Products Image Divided when i hover the images?

texts: When i try to hover the products images its getting divided, how can i solve this error,


texts: Magento 2 - setup:di:compile (general question)

texts:
This is a general question about the magento 2 cli, and what the setup does. Every time i want to install or uninstall a module I have to run the following command.

setup:di:compile

What does this do? Does it take all the new modules and compile them? And what is the difference between this and:

setup:di:compile-multi-tenant


texts: Magento 2: how to check if there is a role in site

texts:
I used the following code in magento 1 to check role is avilable or not.

$role = Mage::getModel('api/roles')->load('my new role', 'role_name');
if(!$role->getId())

I want to know, How can I archive this in Magento 2.

Thanks for the help..


texts: Error stack trace always finishes on 'Class 'Mage' Not found'

texts:
I'm having an issue when debugging Magento errors. All stack traces related to errors finish with a 'Class 'Mage' not found' and it doesn't provide any other information.

PHP Fatal error:  Class 'Mage' not found in ***app/code/core/Mage/Core/functions.php on line 244, referer: http://***/catalogsearch/result/?q=jeans

In addition, the error is not logged by exception.log or system.log, but by the server error log.

The problem is that there is an actual error, but it's not being logged by Magento and Apache is logging something that is not complete.

Any idea? Is it probably a problem on the PHP configuration?


texts:
How to get all image of a single product in magento and also click on download
button to its download

http://foo.com


texts: cron update log filled with "There was an error in previous Update attempt"

texts:
My var/log/update.log is filled with this:

[2017-03-16 14:50:02] update-cron.INFO: There was an error in previous Update attempt. [] []
[2017-03-16 14:51:01] update-cron.INFO: There was an error in previous Update attempt. [] []
[2017-03-16 14:52:01] update-cron.INFO: There was an error in previous Update attempt. [] []
[2017-03-16 14:53:02] update-cron.INFO: There was an error in previous Update attempt. [] []
[2017-03-16 14:54:01] update-cron.INFO: There was an error in previous Update attempt. [] []
[2017-03-16 14:55:01] update-cron.INFO: There was an error in previous Update attempt. [] []

If I go back in the log to the point that I see something other than this error message, I see the following:

[2017-03-13 18:10:03] setup-cron.INFO: Cleaning generated files... [] []
[2017-03-13 18:10:04] setup-cron.INFO: Complete! [] []
[2017-03-13 18:10:04] setup-cron.INFO: Clearing cache... [] []
[2017-03-13 18:10:04] setup-cron.INFO: Complete! [] []
[2017-03-13 18:10:04] setup-cron.INFO: Job "setup:module:disable {"components":[{"name":"IWD_OrderManager"}]}" has been successfully completed [] []
[2017-03-13 18:10:04] setup-cron.INFO: Job "setup:cache:enable ["config layout block_html collections reflection db_ddl eav customer_notification full_page config_integration config_integration_api translate config_webservice"]" has started  [] []
Changed cache status:
                        config: 0 -> 1
                        layout: 0 -> 1
                    block_html: 0 -> 1
                   collections: 0 -> 1
                    reflection: 0 -> 1
                        db_ddl: 0 -> 1
                           eav: 0 -> 1
         customer_notification: 0 -> 1
                     full_page: 0 -> 1
            config_integration: 0 -> 1
        config_integration_api: 0 -> 1
                     translate: 0 -> 1
             config_webservice: 0 -> 1
[2017-03-13 18:10:04] setup-cron.ERROR: An error occurred while executing job "setup:cache:enable ["config layout block_html collections reflection db_ddl eav customer_notification full_page config_integration config_integration_api translate config_webservice"]": Could not complete setup:cache:enable ["config layout block_html collections reflection db_ddl eav customer_notification full_page config_integration config_integration_api translate config_webservice"] successfully: Warning: ltrim() expects parameter 1 to be string, object given in /var/www/miridiatech/shop/vendor/magento/framework/Code/Generator/EntityAbstract.php on line 152 [] []
[2017-03-13 12:11:02] update-cron.INFO: There was an error in previous Update attempt. [] []
[2017-03-13 12:12:01] update-cron.INFO: There was an error in previous Update attempt. [] []
[2017-03-13 12:13:02] update-cron.INFO: There was an error in previous Update attempt. [] []

Can anyone please help me track down how to get the updater working again?

Thanks!


texts: Magento 2 catalog search not working when letters combine with numbers

texts:
Magento 2.3.5-p1 version
Suppose the product name is "Super M2" when we search "m2" then it is not showing results on the search page
but when the product name is "Super M21" when we search "m21" then it is showing results on search page.
Can anyone know how to solve these issues?


texts: customers cancel return products in my account page- Magento 2

texts:
My requirement is adding cancel and return option in customer  account page.

add cancel option after place order.
add return option after delivered.

I am wondering it is a very essential option but magento does not provide default.

I hope someone handled the situation already.

Please share the hints or steps to achieve this in a proper magento way.


texts: Magento2: How can i override UI componet

texts:
I want to override this file :

  vendor/magento/module-catalog/Ui/DataProvider/Product/Form/NewCategoryDataProvider.php

How can i do this?
just want to change 'include_in_menu' => 1, to 0 .

registration.php:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Customwork_Menuvalue',
__DIR__
);

module.xml

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

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Ui\DataProvider\Product\Form\NewCategoryDataProvider" type="Customwork\Menuvalue\Ui\NewCategoryDataProvider" />
</config>

NewCategoryDataProvider.php

<?php
namespace Customwork\Menuvalue\Ui;

use Magento\Ui\DataProvider\AbstractDataProvider;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Framework\UrlInterface;

/**
 * DataProvider for new category form
 *
 * @api
 * @since 101.0.0
 */
class NewCategoryDataProvider extends \Magento\Catalog\Ui\DataProvider\Product\Form\NewCategoryDataProvider
{
    public function getData()
    {
        $this->data = array_replace_recursive(
            $this->data,
            [
                'config' => [
                    'data' => [
                        'is_active' => 1,
                        'include_in_menu' => 0,
                        'return_session_messages_only' => 1,
                        'use_config' => ['available_sort_by', 'default_sort_by']
                    ]
                ]
            ]
        );

        return $this->data;
    }
}


texts: Captcha Helper method override not working in Magento2

texts:
Need to override method getImgUrl() from vendor\magento\module-captcha\Helper\Data.php but not success

  app/code/YourCompany/YourModule/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Captcha\Helper\Data" type="YourCompany\YourModule\Helper\Data" />

Override helper method code

namespace YourCompany\YourModule\Helper;
class Data extends \Magento\Captcha\Helper\Data
{
    public function __construct() {
        echo "Helper Rewrite Working"; die() // working till here
    }

    public function getImgUrl($website = null)
    {
        return $this->_storeManager->getStore()->getBaseUrl(
            DirectoryList::MEDIA
        ) . 'testhelper' . '/' . $this->_getWebsiteCode(
            $website
        ) . '/';
    }
}


texts: Magento 2 - Entity Type empty in import /export pages

texts:
I am new to Magento. I want to develop a site in Magento 2 and the old site is in opencart. I want to import its products to Magento 2 via CSV file so I add some products to Magento 2 store with categories but in import/export pages no entity type in dropdown so please help me coz I am unable to import or export data.

Here are the screenshots of both pages below:

Import page

Export page

PLEASE tell me why it's not showing the options such as products, categories etc..

i will be very thankful to u for this kindness


texts:
i have some problem with grid in backend.
[1]: https://i.stack.imgur.com/Oocnu.png
I dont see any field of filter @@ any idea to fix or debug! tks very much


texts: I am new to Magento 2, I am trying to make a web service, for the communication of an e-commerce in an ERP system, I already have the ERP communication in Magento (example: I insert a product from the ERP system, and it is also done in commerce ), with the help of its API Rest (API rest), but now I require that if any change is made in e-commerce (for example an order) the change is also made in the ERP system thanks


texts: Magento2 blank Checkout Page with JS errors

texts: Since a few months the Checkout Page show blank except of the logo. In the Browser console there are several JS errors. There are a few threads about this error but nothing helped. I did try fixing it by static-content:deploy and other command, but nothing really works as a solution.


texts: Referencing store config values in phtml templates

texts:
I am attempting to modify the frontend output for Print Invoice/Print Order to comply with ATO requirements.

The template in question is app/design/frontend/base/default/template/page/print.phtml

I need to display two fields from the store configuration in the page header, the paths are:

'general/store_information/phone'and'fontis_australia/business/abn'

Both paths are defined and work correctly in transactional emails using markup tags, but in this script I always get null when using getStoreConfig().

<?php echo $this->__('Tel') ?><?php echo $this->escapeHtml($this->getStoreConfig('general/store_information/phone')) ?><br>
<?php echo $this->__('ABN') ?><?php echo $this->escapeHtml($this->getStoreConfig('fontis_australia/business/abn')) ?>

I have tried a few variations of these 2 lines, but I am new to both magento and php so i would appreciate any help I can get.

thanks
Tom


texts: get grand total with shipping & shipping (incl. tax) in custom controller

texts:
I have a custom controller which can also update the cart:

namespace Vendor\Module\Controller\Index;

class Index extends \Magento\Checkout\Controller\Cart\UpdatePost
{
    public function execute()
    {
        if (!$this->_formKeyValidator->validate($this->getRequest())) {
            return $this->resultRedirectFactory->create()->setPath('checkout/cart/');
        }

        $this->_updateShoppingCart();

        $quote = $this->_checkoutSession->getQuote();
        $quote->collectTotals()->save();

        $address = $quote->isVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();

        $grandTotal = $address->getGrandTotal();
        $subTotal = $address->getSubtotalInclTax();
        $tax = $address->getTaxAmount();
        $shipping = $address->getShippingInclTax();

        // …
    }
}

Judging by this code I thought it should be easy to get the correct amounts for the grand total (incl. tax), sub total (incl. tax), the total tax itself and the shipping (incl. tax).

However, with this code:

the grand total is always without shipping
the tax amount is always without the shipping tax
the shipping amount is always zero

The cart of Magento itself shows the correct values for grand total, tax & shipping. But how can I get to these values myself in my custom controller?


texts: Magento2: How to generate warehouse report

texts:
I need to generate a magazine report for the product selection.

Product name, sku, quantity, price etc. for selected products. How can this be done?


texts: How to add products in cart which products are in the CSV file Magento 2?

texts: How to add bulk product to cart using csv file in magento2.


texts:
I have many categories and sub-categories. In any sub-category i have many products with attributes.

I want to change my advanced search style like this :

  My categories are displayed as dropdown.

  My sub-categories are displayed too as dropdown.

  Only product's attribute are displayed according to category.

For example :

I have computer category (parent) and in this category i have many other sub-categories like laptop , device .... (child) and in laptop i have many laptop's product and any laptop i assign to it many attribute like (Processor, Cache Memory, System Memory (RAM) ...)

I want to change my advanced search style like that :

when i select computer categories in dropdown, the sub-categories dropdown must display me laptop,device ... and when i select for exemple laptop i want that to display me Processor, Cache Memory, System Memory (RAM) fields for my search.

Any ideas or informations can help me to realize that?
Thanks


texts: Add field to billing information step of one page checkout put process input in checkout_submit_all_after_handler

texts:
I want to add a new field to the billing information step of the one page checkout, then process the customers input in a handler responding to the checkout_submit_all_after_handler event.

I'm able to add the HTML to display my new field in the billing information step. If I use an observer responding to the controller_action_predispatch_checkout_onepage_saveBilling event, then I can get the data the customer added to the new field by using:

Mage::app()->getFrontController()->getRequest()->getPost()

However I want to process the customers input in response to the checkout_submit_all_after_handler as Magento has done some house keeping by this point, such as creating the customer. If I use the above code to get the post data in response to checkout_submit_all_after_handler, it only contains payment information data (which is what you'd expect as that's the last step in the checkout process).

How do I get the custom data the user filled out in an earlier step (billing information), but right at the end of the checkout process.


texts: Magento 1.9.2.1 Product Upload Via .csv file does not generate url rewrites

texts:
I uploaded products via .csv file but the URLs does not get created/generated. I wonder if anyone can tell whether this is the expected behavior or there is a bug?

Updated Question I have uploaded a product with "url_key" called test-url the product get uploaded without errors but url rewrite doe not get generated!

Thank you.


texts:
I upgraded Magento from my Magento 1.6 to 1.9 last night, and it's going error 500 Server Internal Error then my magento can't be opened.
so what i'm do is chance user permissions of index.html on root folder to 644 and index.html on downloader to the same permissions and delete all file n folder in Magento cache, but it can't chance anymore.
and i'm wanna to trying access the admin panel and cannot be shown and error likes this

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'group' in
  'where clause', query was: SELECT COUNT(*) FROM m2epro_config AS
  main_table WHERE (group = '/wizard/') AND (key =
  'status')

please help me to fix it out..


texts: Checking for the matched product and category Id

texts:
I am using below code to check and display products for certain allowed categories only in Magento admin panel product grid, but Magento returns with error

$collection->getSelect()->join(
                array('cp'=>'catalog_category_product'),
                'main_table.entity_id = cp.product_id AND cp.category_id IN (' . $where . ')',
                array()
            );

I have tried using another table also

$collection->getSelect()->join(
                array('cpi' => Mage::getSingleton('core/resource')->getTableName('catalog/category_product')),
                'main_table.entity_id = cpi.product_id',
                array()
            );

May any body suggests the solution for the same


texts:
How to get excluding product price by subtracting incl price.
Please find the attached screenshot.


texts: What is the correct way to override / replace the custom options container?

texts:
Background

I am developing a module that creates a few custom entities which relate/impact the options available for a particular product.  Here's how it works:

When a product loads, a query is performed on my custom entities using two of the product's attributes.

I use the result of the query and present it in a 2-step fashion, like this (the customer's first selection impacts the options available for their second):

The Challenge

Here's what I know I need to accomplish on the frontend:

1. Override two pieces of logic in Product view.phtml:

--- First:

<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

... you'll notice enctype="multipart/form-data" only gets added if $_product->getOptions() is true, and my products won't actually have them (so this would return false).

--- Second:

 <?php if ($_product->isSaleable() && $this->hasOptions()):?>
    <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
 <?php endif;?>

... also because my products won't actually have custom options, so $this->hasOptions() would return false and prevent rendering of container1.

2.  Replace/overwrite/override 'container1' -- the child block (is it a block?) that "contains" the html for the custom options, as shown here:

I've read a few posts that claim that copying view.phtml and editing it directly is not the correct way to do this, but what's the alternative?

Second, I've read I can either remove or unSet the container1 piece -- which method should I use, and then how do I correctly substitute my own container1?

Thank you very much!


texts:
I would like to challenge the template structure of Magento 2 loader which is declared in the lib/web/mage/loader.js but I can't find where this widget is calling by Magento to override the javascript ?

I mean, I'm able to extend the widget with this code :

define(['jquery','jquery/ui','mage/translate'], function ($) {
'use strict';

$.widget("custom.loader", $.mage.loader, {
    options: {
        icon: '',
        texts: {
            loaderText: $.mage.__('Please wait...'),
            imgAlt: $.mage.__('Loading...')
        },
        template:
            '
' +
                '
' +
                    '<img alt="<%- data.texts.imgAlt %>" src="new path">' +
                    '
<%- data.texts.loaderText %>
' +
                '
' +
            '
'
    }
});

return $.custom.loader; });

And to call it from the Magento_Theme module in app/design but I still have the native one (loading-mask class)


texts:
I need to programitcally re order an Item.

I have achieved this by

Cancel the current order
Get the cancelled order quote
Ammend the Qtys
Recalulate the shipping

This is all fine... now I need to calculate if any coupons were applied are now still valid for the new order? Forinstance a rule would be that a coupon is only valid if an order is over £10.00 - I re order from the old quote but now my order is only £9.00 which means the coupon is not valid.

How can I check whether the coupon that is assigned to the quote is now valid for the new order totals?

Thanks in advance..


texts: Magento Pager is not showing custom attributes in product products-list.phtml

texts:
I'm facing a coding problem using Magento. I want to display the detail of a product in a recently bought template from TemplateMonster. I have created two numerical custom attributes in my product table in the database (namely PP and PR). The scope of the attributes is global in admin panel. I just can't display those two attributes on my page.
I'm using the following code, above the price display:

<?php /* @escapeNotVerified */ echo $_item->getAttributeText("pp") ?>
<?php /* @escapeNotVerified */ echo $_item->getAttributeText("pr") ?>

The attributes don't appear anywhere. I don't know what am I doing wrong?


texts: Fatal Error on admin page After upgrading from magento connect

texts:
after upgrading extensions and some modules from magento connect and trying to reconnect to admin panel i got this message below:

Fatal error: Call to undefined method Zend_Date::toString_shamsi() in app\code\core\Mage\Core\Helper\Data.php on line 184

i try to fix it with replacing zend folder in app/code/core but it doesnt work,please show me the way!

Thank you


texts: What is the attribute_id for tier_price used for in the catalog_product_entity_decimal table?

texts:
In the Magento 2.2.9 database, what is the 'tier_price' attribute used for in the 'catalog_product_entity_decimal' table? This seems to give some kind of error while trying to save new product tier_prices.

My database has entries with the attribute_id of the tier price entry here but tier_price values are stored in the 'catalog_product_entity_tier_price' table.


texts: How to refresh sales order grid by calling \Magento\Sales\Model\ResourceModel\Grid::refresh method

texts:
How to call \Magento\Sales\Model\ResourceModel\Grid::refresh method

I am following this link: blog.sivaschenko.com

<?php
 namespace Vendor\OrderGridSync\Controller\Index;
 class Sync extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
protected $_postFactory;

/**
* @var \Magento\Sales\Model\ResourceModel\Grid[]
*/

protected $grids;
/**
 * @param array $grids
 */
public function __construct(
        \Magento\Sales\Model\ResourceModel\Grid $grids,
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory
        )
{
        $this->grids = $grids;
        $this->_pageFactory = $pageFactory;
        return parent::__construct($context);
}

public function execute()
{
    /**
     * Refresh grids list
     *
     * @param int $orderId
     * @return $this
     */
    foreach ($this->grids as $grid) {
    /**
     * @var \Magento\Sales\Model\ResourceModel\Grid[]
     */
    $grid->refresh(81, "affiliate_information");
    }
    exit;
}
}

Getting

1 exception(s):
Exception #0 (BadMethodCallException): Missing required argument
$mainTableName of Magento\Sales\Model\ResourceModel\Grid.


texts: how to show multiple discounts for same product Magento 1.9.3.3?

texts:
There are same products which are new and some of them have discounts depending on their state of usage.

So, for  1 week used product get 5%  discount, and  2 weeks 10% etc.

Obviously it's the same product (SKU) but how can I show these products with their discounts on  one Discounted Products page ?

If I have a Product X new (full stock) but also one with 5% off and 2 with 10% off

How can I get those with the discounts listed in one list?


texts: Display Some text if is there is no reviews

texts:
We are using this code to display Ratings & Reviews as below:

If suppose there is no review for a product, then we want to display text "No rating Available".

app/design/frontend/rwd/theme/template/review/product/view/list.phtml

<?php $_items = $this->getReviewsCollection()->getItems();?>

<?php if (count($_items)):?>

            <?php echo $this->__('') ?>

            <?php
        //  echo count($_items);
            ?>
            Ratings & Reviews

        <?php echo $this->getChildHtml('toolbar') ?>

    <?php foreach ($_items as $_review):?>

        <?php $_votes = $_review->getRatingVotes(); ?>
            <?php if (count($_votes)): ?>

                <colgroup>

                    <col class="review-value" />
                </colgroup>

                    <?php foreach ($_votes as $_vote): ?>

                        <?php echo $this->escapeHtml($_vote->getRatingCode()) ?>

                                <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;">

                    <?php endforeach; ?>

            <?php endif; ?>
            <a href="<?php echo $this->getReviewUrl($_review->getId()) ?>">
                <?php echo $this->escapeHtml($_review->getTitle()) ?>

            <?php echo nl2br($this->escapeHtml($_review->getDetail())) ?>

                <?php echo $this->__('Review by %s', $this->escapeHtml($_review->getNickname())) ?>
                /
               <?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?>

    <?php endforeach; ?>

    <?php // echo $this->getChildHtml('toolbar') ?>
<?php elseif($this->getParentBlock()): ?>
    <?php echo $this->getParentBlock()->getReviewsSummaryHtml($this->getProduct(), 'short', true)?>
<?php endif;?>
<?php echo $this->getChildHtml('review_form') ?>


texts: Keep notice message without Ajax Cart Pro

texts:
I'm using Ajax Cart Pro. The usual behavior of the module is to show a modal with all the messages.
This modal is triggered by :
me.fire(response.redirect_to, parameters, observer);

The file is js/aw_ajaxcartpro/ajaxcartpro.js
What I'm trying to do is if I have a notice message, I don't want this modal to show but instead the page should reload with the notice messages.
So basically what I am doing is that
me.msg = response.msg;
var messageQuantity = 'Message 1';
var messageQuantityTooBig = 'Message 2';
//Prevent ACP from firing the modal
var found = false;
me.msg.forEach((message) => {
    console.log(message);
    if(message['text'] === messageQuantity || message['text'] === messageQuantityTooBig){
        found = true;
    }
})
if(!found){
    me.fire(response.redirect_to, parameters, observer);
}else{
    window.location.href = response.redirect_to;
}

I try to redirect with javascript. It works, but he looses the notice message (actually he prints me a notice message but it's none of the two message I have here).
Is there a way to redirect in javascript by keeping theses messages ? Or may be, a way to tell ajax cart pro, not to fire the modal but to keep the native behaviour ?
This is the full method
fire: function(url, parameters, observer) {
    var me = this;
    this.ui.observer = observer;
    this.ui.beforeFire();

    var parameters = parameters || {};
    parameters['block[]'] = [];
    Object.keys(me.config.targetsToUpdate).each(function(k){
        if (me.config.targetsToUpdate[k].updateOnActionRequest) {
            parameters['block[]'].push(k);
        }
    });
    this.connector.sendRequest(url, parameters,
        function(response) {
            var isResponseHasBlock = Object.values(response.block).without(null).length > 0;
            if (isResponseHasBlock) {
                var isSuccessUpdate = me.callUpdaters(response.block);
                if (!isSuccessUpdate) {
                    document.location.reload();
                    return;
                }
                me.stopObservers();
                me.startObservers();
                return;
            }
            if (response.redirect_to) {
                me.msg = response.msg;
                var messageQuantity = 'Message 1';
                var messageQuantityTooBig = 'Message 2';
                //Prevent ACP from firing the modal
                var found = false;
                me.msg.forEach((message) => {
                    console.log(message);
                    if(message['text'] === messageQuantity || message['text'] === messageQuantityTooBig){
                        found = true;
                    }
                })
                if(!found){
                    me.fire(response.redirect_to, parameters, observer);
                }else{
                    window.location.href = response.redirect_to;
                }
                return;
            }
            me.update(function(json){
                document.location.reload();
            }, {
                actionData: Object.toJSON(response.action_data)
            });
        },
        function(json){
            observer.fireOriginal(url, parameters);
        }
    );
}

The notices messages are setup this way
public function addAction()
{
    $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml('Message 1'));
}

public function addNotice($message)
{
    $this->addMessage(Mage::getSingleton('core/message')->notice($message));
    return $this;
}

/**
 * Adding a new message to message collection
 *
 * @param   Mage_Core_Model_Message_Abstract $message
 * @return  Mage_Core_Model_Session_Abstract
 */
public function addMessage(Mage_Core_Model_Message_Abstract $message)
{
    $this->getMessages()->add($message);
    Mage::dispatchEvent('core_session_abstract_add_message');
    return $this;
}


texts: Unable to Install New Theme. Dashboard goes blank

texts:
I m running a magento site with default theme and products loading at the main page. Now i m trying to get new theme for which i copied app/themename directory to app/design/frontend/default and skin/themename to skin/frontend/default, also did i copy app/code/local to app/code/ and other stuff like etc/modules/* and js/* to magento site appropriate directory.

Now i went to System -> Design and selected the theme which i copied. Then i cleared the cache and logged out. The next time i login into the admin panel, my panel goes blank and the error msg is get from apache logs is Class 'Megnor_Framework_Helper_Data' not found in app/Mage.php. Not only that my site doesn't load images with grid/list, but css is good.

Then i did some trial by removing local and followed the same procedure. Now i m back with my admin panel but my site still doesn't load images and this time my apache logs gives me this Class 'Mage_Framework_Helper_Data' not found in app/Mage.php

Not knowing further what to do


texts:
If I have a checkbox on the contact form how do I pull these values into the email template.

My form looks like

    Contact Method

       <input type="checkbox" name="contact_method[]" value="Telephone"> Telephone

       <input type="checkbox" name="contact_method[]" value="Email"> Email

However if I do

Contact Method: {{var data.contact_method}}

The value comes out as array


texts:
I know how to check what the parent category id is, but what I am trying to do is find out if the current category is a child of a specific category, up to 2 levels deep.

For example: if user is browsing child2 in category1/child1/child2, detecting if child2 is a child of category1

Is there a function that handles this?

Or

should I create a helper with an iterator that climbs up the tree?


texts: "/pub/media/styles.css" not generated and some category images are not displayed

texts:
Good Morning

I have been developing the following project that has the purpose of automating the construction of Magento2, in order to facilitate the evangelization of the platform

https://github.com/mozgbrasil/deploy-magento2#install

The installation of Magento works as expected by displaying all images from the "sample data"

But at the time of re-deploying the magento, it is that problems occur

https://github.com/mozgbrasil/deploy-magento2#deploy--re-deploy

Images of some categories are not displayed and the file "/pub/media/styles.css" that should be generated on the home page is not displayed

-

I even did the following test

delete the magento folder

I used the composer to download and install the magento

Access and test where it worked as expected

I renamed the magento folder

Then

I used the composer to download and redeploy the magento due to the presence of the database

This is where the problem happens

But if I rename this last deployment folder and use the previous one it works

-

To whom I can contribute with the project, I thank you

-

I have a deployment at AWS EBS in

http://304674501456-test-webapp014.us-west-2.elasticbeanstalk.com/

The magento is in

http://304674501456-test-webapp014.us-west-2.elasticbeanstalk.com/magento/

and the backend in

http://304674501456-test-webapp014.us-west-2.elasticbeanstalk.com/magento/admin/

You can access how

admin / 123456a

-

See that you already have this link and the cache is disabled

-


texts:
I have a problem with magento 2 forma validation translation.

Not all fields are translated. (The Geburtsdatum and E-Mail field)

In my translation file de_DE.csv

"Please enter a valid email address (Ex: johndoe@domain.com).","Bitte gib eine gültige E-Mail an."

But this doesn't work. Anybody an idea what's wrong?

EDIT:

With language pack it works, but i have trouble with date messages.

"Please enter a date.", "Gib bitte ein Datum ein."
"Please enter a valid full date.", "Gib bitte ein gültiges Datum ein."
"Please enter a valid month (1-12).","Bitte gültiges Monat eingeben (1-12)."

"please enter a valid date/year" works.. thats strange


texts: Dynamically created blocks: layout->createBlock() or blockFactory->create()?

texts:
I want to create a block dynamically but not render it within the layout hierarchy (I am going to save the output).

Is there any reason to use Layout::createBlock() in this case or can I instantiate it directly with a factory? Or even inject the block itself as shared instance into the class where I'm using it?

I would prefer to avoiding the unnecessary dependency to the layout and the additional abstraction but I am not sure what might break if the block is not associated to the layout.


texts:
I have product Attribute "Model". Now, I want those product which have model attribute from product Collection

how I achieve that?


texts: How can I duplicate the category programmatically?

texts:
Is there a way to duplicate a product on the admin side but not copy the category?

This would make it so much easier for us. I'm assuming it would be under Product.php but not to sure. Any help is appreciated.

Thanks


texts:
I'm busy with changing the product view.phtml file but I want to do it in a way to override the current view.phtml. This because there might be a possability that the file gets overwritten during an update.

Is there anyone with an example on how this can be done in my custom extension?

Many thanks again.

Br,

Steve


texts: Add Custom attributes to Custom attribute set programmatically

texts:
Hi Could someone help me with this?

I created a custom attribute set and custom attribute as

$installer = $this;
/* @var $installer Mage_Eav_Model_Entity_Setup */
$installer->startSetup();

//Create Attribute set with Based on Default attribute set
//$installer->removeAttributeSet(Mage_Catalog_Model_Product::ENTITY, 'New Attr Set');
/*
$skeletonID=$installer->getAttributeSetId('catalog_product','Default');
$entityTypeId = Mage::getModel('catalog/product')
->getResource()
->getEntityType()
->getId(); //product entity type

$attributeSet = Mage::getModel('eav/entity_attribute_set')
->setEntityTypeId($entityTypeId)
->setAttributeSetName("New Attr Set");

$attributeSet->validate();
$attributeSet->save();

$attributeSet->initFromSkeleton($skeletonID)->save();

//Create attribute new_attr
//$installer->removeAttribute('catalog_product', 'new_attr');
$data= array (
'attribute_set' =>  'New Attr Set',
'group' => 'General',
'label'    => 'New Attr',
'visible'     => true,
'type'     => 'int', // multiselect uses comma-sep storage
'input'    => 'boolean',
'system'   => false,
'required' => false,
'user_defined' => 1,//defaults to false; if true, define a group
'source' => 'eav/entity_attribute_source_boolean',
'default' => 1,
'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
 );

 $installer->addAttribute('catalog_product','new_attr',$data);
 */

This code adds the attibute 'new_attr' to the group 'General' and so the custom attribute are displayed in all the attribute sets such as 'Default' also.

I want to add the custom attibute 'new_attr' only to the custom attribute set 'New Attr Set' under the group 'General'. Is that possible?


texts: Stock for quantities over quantities 100 go up randomly - Magento 2

texts:
I have a problem whereby stock quantities with 3 or more digits (100 or more) go up randomly on my site.

I am not sure what the problem could be. Stock quantity increments are disabled on every level.


texts: one widget different behaviour - magento 2

texts:
Widget-Block: app/code/Gworks/Recentviewed/Block/Widget/Recent.php

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Gworks\Recentviewed\Block\Widget;

/**
 * Reports Recently Viewed Products Widget
 */
class Recent extends \Magento\Reports\Block\Product\Viewed implements \Magento\Widget\Block\BlockInterface
{
    /**
     * Internal constructor
     *
     * @return void
     */
    protected function _construct()
    {
    parent::_construct();
    $this->addColumnCountLayoutDepend('1column', 5)
        ->addColumnCountLayoutDepend('2columns-left', 4)
        ->addColumnCountLayoutDepend('2columns-right', 4)
        ->addColumnCountLayoutDepend('3columns', 3);
    }

}

Widget-Tempalte: app/code/Gworks/Recentviewed/view/frontend/templates/widget/recently_widget.phtml

<?php
/**
 * @var $block \Magento\Reports\Block\Product\Viewed
 */
?>
<?php
if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedProducts()->getSize())) {
    $type = 'widget-viewed';
    $mode = 'grid';

    $type = $type . '-' . $mode;

    $image = 'recently_viewed_products_grid_content_widget';
    $title = __('Recently Viewed');
    $items = $block->getRecentlyViewedProducts();

    $showWishlist = true;
    $showCompare = true;
    $showCart = true;
    $rating = 'short';
    $description = ($mode == 'list') ? true : false;
}
?>

<?php
if($exist)
{
    echo "success";
}
else
{
    echo "unsuccess";
}
?>

Behaviour-1

When I insert widget in cms static block

{{widget type="Gworks\Recentviewed\Block\Widget\Recent" template="widget/recently_widget.phtml" c_recent_count="3"}}

I got unsuccess message

Behaviour -2

When I add through content->widget->add widget set to CMS home page

I got success message.

  I am looking getting success in both of the way.

can anyone suggest me to why it is behave like this?


texts: JS error "Cannot read property 'timestamp'" at checkout after upgrade from 2.3.3 to 2.4.2-p1

texts:
I upgraded Magento 2.3.3 to 2.4.2-p1 and at the checkout it presents this error and just keeps loading the checkout.
Uncaught TypeError: Cannot read property 'timestamp' of undefined
    at UiClass.checkCustomerData (defaultCaptcha.js:60)
    at UiClass.<anonymous> (defaultCaptcha.js:43)
    at Function.each (jquery.js:382)
    at UiClass.initialize (defaultCaptcha.js:38)
    at UiClass.initialize (wrapper.js:109)
    at UiClass._super (wrapper.js:106)
    at UiClass.initialize (loginCaptcha.js:21)
    at UiClass.initialize (wrapper.js:109)
    at new UiClass (class.js:49)
    at Object.initComponent (layout.js:137)


texts: Magento 2 Custom REST API - Error 400 - Specified request cannot be processed

texts:
I've setup a REST API using the following configuration however when I call the endpoint with {base_url}/rest/V1/Company/Product/getProducts using a GET in postman I get a 400 error return with a body of

  {"message": "Specified request cannot be processed."}

I have nothing logged in any of the var/log files (Including my specific log statement. Nothing logged in NGINX or FPM logs.

The following is the only place I can find that error.

  vendor/magento/module-webapi/Controller/Rest/RequestProcessorPool.php

/**
 * {@inheritdoc}
 *
 * @throws \Magento\Framework\Webapi\Exception
 * return RequestProcessorInterface
 */
public function getProcessor(\Magento\Framework\Webapi\Rest\Request $request)
{
    foreach ($this->requestProcessors as $processor) {
        if ($processor->canProcess($request)) {
            return $processor;
        }
    }

    throw new \Magento\Framework\Webapi\Exception(
    __('Specified request cannot be processed.'),
    0,
    \Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST
    );
}

If it is that, its saying it can't find a "Processor", but whats that?

The following are my setup.

  /app/code/Company/Product/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Company_Product',
    __DIR__
);

  /app/code/Company/Product/etc/module.xml

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

  /app/code/Company/Product/etc/webapi.xml

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route url="/v1/Company/Product" method="GET">
    <service class="Company\Product\Api\ProductInterface" method="getProduct" />
    <resources>
        <resource ref="anonymous"/>
    </resources>
    </route>
</routes>

  /app/code/Company/Product/etc/di.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Company\Product\Api\ProductInterface" type="Company\Product\Model\ProductManagement" />
</config>

  /app/code/Company/Product/Api/ProductInterface.php

<?php
namespace Company\Product\Api;

/**
 * @api
 */
interface ProductInterface
{
    /**
     * Get recommended products based on another product
     *
     * @return int Some number
     */
    public function getProduct();
}

  /app/code/Company/Product/Data/ProductManagement.php

<?php
namespace Company\Product\Model;

use Psr\Log\LoggerInterface;
use Company\Product\Api\ProductInterface;

class ProductManagement implements ProductInterface
{
    protected $_logger;

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

    /**
     * @return int Some number
     */
    public function getProduct()
    {
        $this->_logger->debug("--> getProduct <--");

        return 12;
    }
}


texts: Customer group price not showing in product list and view pages but showing in cart page

texts: I assigned customer group to a customer and added price to that group for a product the price not showing in list and view pages but in cart it is showing, the price is less to regular price.


texts: How to customise bundle product options block (change option renderer)

texts:
I've to customise the bundle product options block. The default xml structure used by Magento is:

<action method="addRenderer">
<type>select</type><block>bundle/catalog_product_view_type_bundle_option_select</block>
</action>

Blocks are declared without any names, so I guess the remove tag doesn't work. How to remove a block from the layout xml? I tried to set a name, but it still doesn't work.


texts:
I am wondering how magento determines which page should be secure & which page should be unsecure.

From what i understand, magento only makes the checkout & login page as secure by default & i can make other pages secure by specifying them under the config path frontend/secure_url/.... via my module's config.xml

The admin-side configuration seems to be fine. SSL is enabled in both frontend & backend. The backend is fully over https. In the frontend most pages work fine under http including the homepage, & the checkout & login pages are redirected to https as expected.

But there are a few other url's getting redirected to https that i was expecting to remain on http including a custom module's controller/action.

I need some pointers on how to debug this? Is there any other config i can use to stop them from being redirected?


texts: Magento 2: How to update the store configuration value using Data Patch

texts:
i want to update the store configuration value using Data Patch.
Note: please do not suggest install and upgrade script.
i tried below code but its not working:
   <?php
 /**
  * Copyright ©  All rights reserved.
  * See COPYING.txt for license details.
  */
declare(strict_types=1);

namespace Vendor\Modulename\Setup\Patch\Data;

use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\App\Config\MutableScopeConfigInterface;

class SetupConfigData implements DataPatchInterface
{

const XML_PATH_STORE_TELEPHONE = 'customer/address/telephone_show';

const SCOPE_STORE = 'store';

/**
 * @var \Magento\Framework\App\Config\MutableScopeConfigInterface
 */
private $mutableScopeConfig;

/**
 * @var ModuleDataSetupInterface
 */
private $moduleDataSetup;

public function __construct(
    ModuleDataSetupInterface $moduleDataSetup,
    MutableScopeConfigInterface $mutableScopeConfig
)
{

    $this->moduleDataSetup = $moduleDataSetup;
    $this->mutableScopeConfig = $mutableScopeConfig;
}

public function apply()
{
    $this->moduleDataSetup->startSetup();
    $this->mutableScopeConfig->setValue(self::XML_PATH_STORE_TELEPHONE, 'opt', self::SCOPE_STORE);
    $this->moduleDataSetup->endSetup();
}

public function getAliases()
{
    return [];
}

public static function getDependencies()
{
    return [];
}
}


texts: Shipping methods not showing at checkout on Magento 2.3.4

texts:
I'm creating a e-commerce and installed a shipping method calling Frenet (a famous shipping method on Brazil), describe on this module (https://github.com/FrenetGatewaydeFretes/frenet-magento2).
It's work! But yesterday, all shipping methods stopped showing up at checkout, doesn't even appear the title. just disappeared.
For solution this problem, i checked this shipping codes on backend:

Store > Configuration > General > General
Store > Configuration > Sale > Shipping methods

And those paths are corectly configurated.
Can anybody help me?


texts: in which i have been using amazon s3 bucket to save and retrieve images

texts:
Here is the Thing.

I have been using the Amazon s3 bucket for storing my media Files Uploaded In Magento. and recently my access was changed from public to private to download the Media File. When trying to download I am getting the below error.

<Error>
AccessDenied
<Message>Access Denied</Message>
<RequestId>53B0FB011615A</RequestId>
<HostId>
R7P3oExhw2uIVZRRMIvyZ+mL00fdO/z1KCyACsekDJVtjYzFXU7P6NgPkpy5wTUBVpVk=
</HostId>
</Error>

Can Someone Help me how to download the media files when the owner access was even private? Help must be appreciated.


texts:
I'm trying to get discount price of product. Check below screenshot for more info.

https://prnt.sc/oogqzp

I would like to get red marked value.

$items = $_order->getAllVisibleItems();

foreach ($items as $item) {
   $productSku = $item->getSku();
   echo $item->getBaseDiscountAmount();
   echo $item->getDiscountAmount();

}

Both returns null Any idea what's missing here ?


texts: How to get tax Rate details of sales order in Magento2 using rest api?

texts:
I want to know the tax rate information of particular sales order.
I am fetching the sales order information from Mangento2 rest API using the following URL :

http://magentourl/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=" . $current_date . "&searchCriteria[filter_groups][0][filters][0][condition_type]=lteq

here I am getting the order details and I want to get the tax rate of related to this sales order.

I'm getting tax percentage but I want to know this percentage belongs to which tax type.

Please suggest me any solution if any one knows the answer or any idea?


texts: How to change logo size for invoice PDF?

texts:
When I'm printing a PDF the logo size gets way too big with a size of 360x200px. Instead, I'd like it to be 180x100px.

How and where can I edit this?


texts: How can I replace the Paypal button with a static button image?

texts:
Since Paypal button is loading dynamically and sometimes it doesn't show up, I'd like to replace it with a static image.
I've 2 stores: in one I'm using Magento 2.4.2 and PayPal Express Checkout, in the other I'm using Magento 2.4.2 and Paypal through Braintree.
How can I achieve this?


texts: Paypal error when loged in only "PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts

texts:
AS shown in the title I get an error when trying to use paypal or express checkout as the payment method on my store while Im logged in to any account.

PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details).

For guest however it works perfectly fine so I do not know why its happening.


texts: Magento2 : Best way to load Customer by customer Id

texts:
What is the best way to load Customer by Id? using customer interface or customer factory or another way ?
In most of solutions I found, it is done by directly using objectManager (which should be never be used).


texts: Magento2 - after upgrade to 2.2.5 - Element 'update': This element is not expected

texts:
The strange about this is this error occurs only in developer mode

Looking at some layout files, I've seen a lot with this structure

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <update handle="XXX"/>
    ...
</layout>

Is that structure incorrect in 2.2.5? If that's the case... which could be the valid layout structure?

Maybe <update handle=...> should be only inside <page> sections, and not <layout>? Is that the problem?

Any tips to debug this?


texts: adding static blocks to specific CMS Page via Layout Update XML in Magento 2.1.1

texts: I want to add a static block to left column of a 2 column layout via layout Update XML in Magento 2.1.1


texts: Magento 2 - Event equivalent to checkout_cart_product_add_after for admin

texts:
I am using checkout_cart_product_add_after and checkout_cart_product_update_after events for making customization using observer on front-end this works properly there but in admin side this events are not working.

I guess this events are only for front-end. can any one please tell me how to implement this event observer in admin or any other event which is equivalent to this events.


texts: Magento2: How to get Grand Total and Subtotal in the Observer

texts:
Actually I have made observer as per Below

XML Path:-

app/code/Practice/Observer/etc/frontend/events.xml

XML Code:-

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
   <event name="checkout_cart_product_add_after">
       <observer name="checkout_cart_product_add_after" instance="Practice\Observer\Observer\Alert" />
   </event>
</config>

Observer Path:-

app/code/Practice/Observer/Observer/Alert.php

Observer Code:-

<?php

namespace Practice\Observer\Observer;

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

class Alert implements ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
$item = $observer->getEvent()->getData();
       print_r($item);
       exit();
}
}

It is working perfectly but i cannot get grandtotal using print_r function.


texts: SMTP PRO Plugin - TLS 1.1 - Exception message was: Unable to connect via TLS - Sparkpost

texts:
Sparkpost announced depreciation of TLS 1.0. We use SMTP PRO Magento plugin. It looks like after testing against non TLS 1.0 endpoint, the connection fails.

I'm not sure where to even look to upgrade the plugin. Can anybody point me to articles on what are the difference in code between a TLS 1.0 and TLS 1.1 connections?

UPDATE:

I tried adding:

STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT

In:

 /var/www/html/mysite.com/lib/Zend/Mail/Protocol/Smtp.php:211

// If a TLS session is required, commence negotiation
    if ($this->_secure == 'tls') {
        $this->_send('STARTTLS');
        $this->_expect(220, 180);
        if (!stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT |
                       STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT)) {
            /**
             * @see Zend_Mail_Protocol_Exception
             */
            #require_once 'Zend/Mail/Protocol/Exception.php';
            throw new Zend_Mail_Protocol_Exception('Unable to connect via TLS');
        }
        $this->_ehlo($host);
    }

I'm getting the same response.

UPDATE: Checked if my server supports TLS 1.2

openssl ciphers -v | awk '{print $2}' | sort | uniq

Result:

SSLv3
TLSv1.2

So it must be Zend version that is having issues with TLS. Going to dig deeper.

UPDATE:

Tried connecting directly to the test endpoint from console:

 openssl s_client -connect no-tlsv1-test-smtp.sparkpostmail.com:587 -tls1_2

I'm getting this:

CONNECTED(00000003)
140650349737800:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:s3_pkt.c:339:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 5 bytes and written 7 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
   Protocol  : TLSv1.2
   Cipher    : 0000
   Session-ID:
   Session-ID-ctx:
   Master-Key:
   Key-Arg   : None
   Krb5 Principal: None
   PSK identity: None
   PSK identity hint: None
   Start Time: 1530722868
   Timeout   : 7200 (sec)
   Verify return code: 0 (ok)

UPDATE:

Looking at the server, CURL currently operates daily with TLS 1.2 through Authorize.net - so it's not the server.

My server admin also noticed we are using old version of PHP. So upgrading PHP to 5.6 might resolve the issue.

What we noticed is that old PHP version doesnt have STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT or STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT constants - which both of them are introduced in PHP 5.6 according to:

http://php.net/manual/en/function.stream-socket-enable-crypto.php

So I'm looking to upgrade to PHP 5.6 from what it looks like.


texts:
I have a Magento site and already set up the Google Customer Reviews. Now I want to create a code to get and display Google Product Reviews. The code should pull barcodes of the items in the basket and allow the customer to review the products after checking out.
We need to add this line to the script:
"products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]


texts:
I am trying to customize a theme in Magento but it does not work.
I added my own stylesheet instead of the old one print.css and changed the default-head-blocks.xml and deployed setup Magento and flush all caches but nothing changes, how can I customize my theme, any advice, please?

thank you.


texts: how to Filter the Search by categories in Magento at the search result

texts:
any one can please help , our Magento store is not good with search and i was wondering if there is any way to put categories on the search result page on right side so the buyer can filter what they after.

Thanks in advacne


texts: Select only reviews that have an image using addFieldToFilter

texts:
I'm currently doing the following query to get the reviews from the review table.

$summaryData = Mage::getModel('review/review')->getCollection()
    ->addStoreFilter(Mage::app()->getStore()->getId())
    ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
    ->addFieldToFilter('entity_id', Mage_Review_Model_Review::ENTITY_PRODUCT)
    ->addFieldToFilter('entity_pk_value', $_product->getId());

It works well and get the reviews however I want to add a new filter.

We have the normal setup but in review_detail we have a column called image, how can I filter the results to only get results where the image field has a value?

I've tried the following but it returns nothing, I presume it's looking for image in the review table?

$summaryData = Mage::getModel('review/review')->getCollection()
    ->addStoreFilter(Mage::app()->getStore()->getId())
    ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
    ->addFieldToFilter('entity_id', Mage_Review_Model_Review::ENTITY_PRODUCT)
    ->addFieldToFilter('entity_pk_value', $_product->getId());
    ->addFieldToFilter('image', 'notnull');


texts: Override order_new_guest.html email template in Magento 2

texts:
In my custom module i want to override new order email template which will be sent after customer placed an order, what i've done so far are created the file in

  app/design/namespace/module/Magento_Sales/email/order_new_guest.html

and it's not working at all, and i created the requirejs-config.js:

var config = {
    map: {
        '*': {
          'Magento_Sales/email/order_new_guest.html':
              'Namespace_Module/email/order_new_guest.html'
        }
  }
};

the code above should load Namespace/Module/view/front/email/order_new_guest.html but its still not working at all


texts: Magento 1.9.3 Sign Up front end dosnt work !URGENT PLEASE

texts:
we have this problem

customer cant sign up new account in front end

i  have insert in all register.phtml   the formkey code but no way thats work

Please help me :-( i dont find solution


texts: Magento 2, display gift options in checkout page

texts:
In magento 2, when you switch on the gift option from the backend. It gets displayed on the Cart page.

I need to display this on cart page and checkout page as well, under cart items.

How can i achieve that.

I have tried editing the xml for checkout_index_index adding block for gift in itemsAfter but to no avail.


texts: Magento 2 - How to add short_description to cart item?

texts:
On the /checkout/cart page I like to add the short description attribute to the cart items. But if I look in $item->getProduct()->getShortDescription() I get an empty string, also $item->getProduct()->hasShortDescription() returns false.

I also read somewhere that the short_description attribute isn't loaded automatically and need to add this piece of xml to M2

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="quote_item">
        <attribute name="short_description"/>
    </group>
</config>

But I am unsure of where to add this exactly or that I even need this. So can somebody help me out?


texts: Create a new registration form to customer magento 2

texts:
I want to have 2 different forms according to customer group, so how to do so? And how to call a controller in form:

                <form method="POST">
                    <input type="radio" name="type_profile" value="local" checked> Client Local

                    <input type="radio" name="type_profile" value="export"> Client Export

                    <input type="submit" name="submit" value="create new account " />
                </form>
                <?php
                if (isset($_POST['submit'])) {
                    if(isset($_POST['type_profile']))
                    {
                        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                        $redirect = $objectManager->get('\Magento\Framework\App\Response\Http');

                        if($_POST['type_profile']=="local") {
                            $redirect->setRedirect('http://localhost/Selecta/customer/account/create/');
                            //echo "You have selected : local";
                        }else if($_POST['type_profile']=="export") {
                            //echo "You have selected :export";
                            $redirect->setRedirect('http://localhost/Selecta/customer/account/create2/');

                        }
                    }}
                ?>


texts:
Here is my code (Magento 1.9), but the end result isn't correct. What I would like to achieve is a JSON with all the reviews where I will have User/Customer, review details, rating, sku. So i took products collection, looping trough and pulling reviews if exists, then looping trough reviews creating a list of reviews with all required information. But I messed up something and end result is wrong.
would you please check and let me know what I've done wrong?
<?php
require_once('ack.php');
$date = date_create('now')->format('Ymd');
$obj = new stdClass();
$obj->label = "Product Reviews";
$file = fopen('product_reviews_'.$date.'.csv', 'a+');
$collection = Mage::getModel('catalog/product')->getCollection();
$output = "SKU,Reviews\n";
fwrite($file,$output);
foreach($collection as $product){
    echo '<pre>';
    $productId = $product->getId();
    $reviews = Mage::getModel('review/review')->getCollection()
        ->addStoreFilter(Mage::app()->getStore()->getId())
        ->addEntityFilter('product', $productId)
        ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
        ->setDateOrder()
        ->addRateVotes();
    if($reviews->count() > 0 )  {
        $sku = $product->getSku();
        $reviews_count = $reviews->count();
        $obj->sku = '{' . $sku . '}';
        $obj->reviews = '{' . $reviews_count . '}';
        $output = $sku . ',' . $reviews_count;
        fwrite($file,$output);
        foreach($reviews AS $review) {
            $votes = $review->getRatingVotes();
            $review_detail = $review->detail;
            $reviewer_name = ucfirst($review->nickname);
            $reviewer_id = $review['customer_id'];
            $votes = $review->getRatingVotes();
            $total = 0;
                foreach($votes AS $vote) {
                    $total += $vote->getPercent();
                }
            $avg = $total / count($votes);
            $rating = $avg/20;
            $output = ','.$review_detail.','.$reviewer_name.','.$rating."\n";
            $obj->detail .= array( $review_detail );
            $i++;
            fwrite($file,$output);
        }
        $obj->reviewer = '{' . $reviewer_name . '}';
        $obj->rating = '{' . $rating . '}';
    }
}
echo '<pre>';
echo json_encode($obj);'


texts: Magento 2 Product Alert out of stock notification email

texts:
Does anybody know how does the Product in stock notification email triggers to the subscribers?
I already have the cron job set up and I do see the catalog_price_alert cron being successfully executed in the cron_schedule table.Everytime the catalog_price_alert cron being excecuted, nothing happens. No emails were sent.My SMTP is working fine. All my order and customer emails are going out normally.Please someone help!


texts: How to update multiple rows of a table in a single query?

texts:
I need to update the qty of all products (around 15.000 items) in a cycle, but it takes a very long time. How can I build a SQL script within the loop to run it in a single execution?. I have this code:

This takes more than 40 minutes:

$products_from_erp;//array with product data from ERP system
foreach($products_from_erp as $data_product){
  $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($data_product['product_id']);
  $stockItem->setQty($data_product['qty']);
  $stockItem->setIsInStock(($data_product['qty'] > 0) ? 1 : 0);
  $stockItem->save();
}

This takes 15 minutes:

$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
foreach($products_from_erp as $data_product){
  $bind = array(
      'qty' => $data_product['qty'],
      'is_in_stock' => ($data_product['qty'] > 0) ? 1 : 0
  );
  $where = 'product_id = '.$data_product['product_id'];
  $connection->update('cataloginventory_stock_item',$bind,$where);
}

I also tried this code (It should be much faster) but it takes 15 minutes approx:

$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "";
foreach($products_from_erp as $data_product){
  $qty = $data_product['qty'];
  $is_in_stock = ($data_product['qty'] > 0) ? 1 : 0;
  $product_id = $data_product['product_id'];
  $sql .= "UPDATE cataloginventory_stock_item SET qty = '$qty', is_in_stock = '$is_in_stock' WHERE product_id = $product_id; ";
}
$connection->query($sql);


texts: Magento grid default filter condition exclude certain field value

texts:
I have a custom admin grid that shows grid data from a custom table. One of the fields in this custom table is "status" which is added to the grid with the following values and function.

$this->addColumn('status', array(
  'header'    => Mage::helper('ifactory_schoollist')->__('Status'),
  'align'     =>'left',
  'index'     => 'status',
  'type'      => 'options',
  'options'   => array('1' => 'Draft', '2' => 'Awaiting Approval', '3' => 'Live', '4' => 'Archived'),
  'filter_condition_callback' => array($this, '_filterStatusCondition')
));

If the row is set to "Draft", "Awaiting Approval" or "Live" it should show and be filterable/searchable as normal. However if the row is set to "Archived" I do not want it to show up unless the user has explicity filtered for "Archived" rows.

My first attempt at this was to filter the collection in the _prepareCollection function like this.

$collection->addFieldToFilter("status", array("neq" => '4'));

This hides it correctly but does not let the user see them if they search for archived rows.

I then tried adding a default filter in _prepareCollection

$this->setDefaultFilter(array('status' => array("1","2","3")));

Along with a custom filter_condition_callback for the column

protected function _filterStatusCondition($collection, $column)
{
  $value = $column->getFilter()->getValue();
  if(!$value) {
    return;
  }

  if(is_array($value)){
    $this->getCollection()->addFieldToFilter('status', array('in' => $value));
  } else {
    $this->getCollection()->addFieldToFilter('status', $value);
  }
}

This worked initially only showing the non-archived columns but letting you filter to show any specific status. However whenever you search by another field or reset filters you lose the default filter arrow and archived results show up again.

I tried adjusting the filter_condition_callback function to counter this but it doesn't seem to be being called when you reset filters or leave the status blank.

protected function _filterStatusCondition($collection, $column)
{
  echo "test a";
  $value = $column->getFilter()->getValue();
  if(!$value) {
    // return;
    $value = array("1","2","3"); // if no value given filter default values
  }

  if(is_array($value)){
    $this->getCollection()->addFieldToFilter('status', array('in' => $value));
  } else {
    $this->getCollection()->addFieldToFilter('status', $value);
  }
}


texts: Problem inserting template below add to cart with rwd theme

texts:
I have a template and I inserting it in the product view page. I want to show my template (it is a table) below the add to cart button. It works with the default theme but when I use the rwd theme it puts my template inside a div with a class add-to-cart-buttons and then my template modifies the size of the add-to-cart button (that is also inside this div).

I want to show my template below add to cart button but whitout corrupt the add to cart button size.

This is my xml:

<catalog_product_view>
    <reference name="product.info.addtocart">
        <block type="core/template" name="my.table" template="my/path/table.phtml" after="-"/>
    </reference>
</catalog_product_view>

And this is the add to cart button (named Adicionar ao Carrinho because of my translation) bigger than usual:

I think the problem here is because of the template had been inserted inside the same div of the add-to-cart button, but I don't know why with rwd theme this happens. Anyone  could help me?


texts:
I recently bought a magento site from someone. I am now trying to move it to my own host, but the only thing I get is an error message. Trying to debug it, I googled around and I've seen the error report should b in var/report, but none is created there.

What I have already done

Set rights on var and var/report to 777
Changed development mode in index.php and .htaccess
Renamed local.xml.sample to local.xml in errors folder
Renamed the template folder so these are not loaded
Set all modules to inactive by editing the xmls in app/etc/modules
Deleted the cache folders several times

What more can I do to get my error reports, so I can start debugging?

Thanks for any answer, IJsbrand

Still I get no error reports in var/report and none on the screen either


texts: Possible differences between two environments

texts:
We've got production and staging Magento 2.2.1 setups located on the same server.
MySQL version is 5.7.20.
They basically use the same MySQL instance and the same data (of course copied and filtered from production to staging).

The problem is, when running this query:

SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_flat_1` AS `e`
INNER JOIN `catalog_category_product_index` AS `cat_index` ON
    cat_index.product_id=e.entity_id AND
    cat_index.store_id='1' AND
    cat_index.visibility IN(2, 4) AND
    cat_index.category_id='2'
INNER JOIN `catalog_product_index_price` AS `price_index` ON
    price_index.entity_id = e.entity_id AND
    price_index.website_id = '1' AND
    price_index.customer_group_id = 0
INNER JOIN `cataloginventory_stock_item` AS `at_qty` ON
    (at_qty.`product_id`=e.entity_id) AND
    (at_qty.stock_id=1 and qty > 0)
INNER JOIN `catalogrule_product` ON
    (catalogrule_product.product_id = e.entity_id) AND
    (catalogrule_product.website_id='1' AND
    catalogrule_product.customer_group_id=0)
INNER JOIN `catalogrule` ON catalogrule.rule_id =
    catalogrule_product.rule_id and
    from_date < '2017-11-17 23:59:59' and
    to_date > '2017-11-17 00:00:00'
INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON
    e.entity_id = stock_status_index.product_id AND
    stock_status_index.website_id = 0 AND
    stock_status_index.stock_id = 1
WHERE
    (stock_status_index.stock_status = 1);

Staging and production give pretty different results in terms of time. (250ms vs 1.1s) - these values are the average of 20 runs.

What I researched?

    mysql: show full processlist;

Not much was going on. Low traffic on production.

Now, my question is indeed why? What can there be different between these two environments?


texts: How to add a remove link on product detail page, if it's already added on wishlist in magento2?

texts:
I want to add wishlist remove link if product is already on wishlist in Magento2.

I have tried but it's not working when fullpage_cache is On

1.

2.

3.


texts: Flat Rate Shipping - 'Per Attribute' Type

texts:
I'm currently building a Magento (1.9) webstore for a client who requires a flat rate shipping price to be applied to an order on a 'Per Unique Attribute Value' basis.

The functionality I need is to multiply the flat rate shipping price by the number of different values for the given attribute of the items in the shopping cart.

For example, on a flat rate shipping price of £3, if there were 4 unique values for the 'manufacturer' attribute in the cart, the shipping price would be calculated as £12.

Note that this is not the 'Per Item' type, but I do see the shipping calculation being somewhat similar. Ultimately I'm a relative newbie to Magento and so do not know exactly how to add the functionality I need.


texts: Add same product to quote as a separate item in Magento 2

texts:
I want to add the same product to quote but separately. Here is my code

 $quote = $this->quote->create();
 $quote->setStore($store);
 $quote->setCurrency();

$skuArray = array('EC1','EC1);

foreach($skuArray as $sku){

$item = null;
$item = $this->productRepository->get($sku);
$addedItem = $quote->addProduct($item, 1);

if ($customer->getId()) {
        $quote->assignCustomer($customer);
    }

$quote->collectTotals();
$quote->save();
  }

Every time Magento is adding one item in the quote_item table with two qty in quote table. But I want two items added separately in the quote_item table.

I know if we can add a custom option to each item Magento will treat it as a separate item so i have created observer to add a custom option to cart in 'sales_quote_product_add_after' event

class AddAfterProduct implements ObserverInterface
{
public function execute(Observer $observer)
{
    $items = $observer->getItems();

    foreach ($items as $item) {

        $additionalOptions = array(
             array(
               'code' => 'custom_option',
               'label' => 'Custom Option',
               'value' => rand(0,1111)
           )
        );
        $item->addOption(
            array(
                'code' => 'additional_options',
                'value' =>  serialize($additionalOptions),
            )
        );
    }
}
}

This is also not working. Can somebody help me with this problem?


texts:
this is my code

public function uploadpdf($name)
    {

            $uploader = $this->_objectManager->create(
                'Magento\MediaStorage\Model\File\Uploader',
                ['fileId' => $name]
            );

            $uploader->setAllowedExtensions(['pdf']);

            /** @var \Magento\Framework\Image\Adapter\AdapterInterface $imageAdapter */
            $imageAdapter = $this->_objectManager->get('Magento\Framework\Image\AdapterFactory')->create();

            $uploader->addValidateCallback($name, $imageAdapter, 'validateUploadFile');
            $uploader->setAllowRenameFiles(true);
            $uploader->setFilesDispersion(true);

            /** @var \Magento\Framework\Filesystem\Directory\Read $mediaDirectory */
            $mediaDirectory = $this->_objectManager->get('Magento\Framework\Filesystem')
                                   ->getDirectoryRead(DirectoryList::MEDIA);
            $result = $uploader->save($mediaDirectory->getAbsolutePath('partcenter/product'));
            $a= 'partcenter/product'.$result['file'];
            return $a;

    }

but when i upload pdf its always say disallow file format


texts: Custom Customer attribute not saving Magento 2.3.1

texts:
I have the following code to create a custom customer attribute.

<?php

namespace Vendor\MyModule\Setup\Patch\Data;

use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Customer\Setup\Patch\Data\UpdateIdentifierCustomerAttributesVisibility;

class AddCustomerAccountCode implements DataPatchInterface
{
    private $moduleDataSetup;

    private $customerSetupFactory;

    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        CustomerSetupFactory $customerSetupFactory
    ) {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->customerSetupFactory = $customerSetupFactory;
    }

    public function apply()
    {
        $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]);
        $customerSetup->addAttribute(Customer::ENTITY, 'customer_account_code', [
            'type' => 'varchar',
            'label' => 'Account Code',
            'input' => 'text',
            'sort_order' => 100,
            'position' => 100,
            'required' => false,
            'visible' => true,
            'system' => false
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public static function getDependencies()
    {
        return [
            UpdateIdentifierCustomerAttributesVisibility::class,
        ];
    }

    public function getAliases()
    {
        return [];
    }
}

The custom attribute is added to the admin form however when I populate the field and save the customer, the data is not saved.

Please could someone point out where I have gone wrong


texts: Magento 2 : Is there any way to resize product page image using Phtml instead of view.xml

texts: I just need to change image size which is showing into product page. but whenever i change that image size from etc/view.xml then other image url also changed so Is there any way to resize product page image using Phtml instead of view.xml


texts:
How will Google handle indexing product URL from two stores where the inventory is shared, We are about to set you a second Magento site selling a subsection of our main inventory.
We expect to share the Inventory but are concerned about Google indexing.

Will Google have a problem with the same product under two different URS's
http://www.thewoolshop.ie/magento/index.php/haberdashery/buttons/novelty-buttons/15mm-rainbow-button-x-5-ref-71.html
http://www.buttonsforsale.com/magento/index.php/haberdashery/buttons/novelty-buttons/15mm-rainbow-button-x-5-ref-71.html


texts: dropdown menu is not working in magento admin panel.I got error of js as follows

texts:
dropdown menu is not working in magento admin panel.When I check in console i got this error

http://www.ethnicfashionboutique.com/skin/m/1399474730/js/prototype/prototy…minhtml/product.js,/js/calendar/calendar.js,/js/calendar/calendar-setup.js Failed to load resource:

Please give me any solution for this


texts: magento admin, edit products, tabs on left?

texts:
Is there a way to replace the default accordion style when editing products in the admin area with tabs instead. Example here, https://docs.magento.com/user-guide/marketing/meta-data.html this image shows the products editable fields in tabbed sections on the left. I find references to locations in the code but I have no idea if there's some sort of config or override I'm supposed to be doing.
Thanks!


texts: Magento 2.1.8 Renaming image url after import or save

texts:
Is there anyone that knows a way of renaming product images after import or at save, from the original to the product's url + .jpg? e.g. if the product url is black-backpack.html and the original name of the product image is backpack-b.jpg, then I would somehow like the image to be renamed black-backpack.jpg a.k.a. the url + .jpg

Since I am new to magento 2 programming I would appreciate to get step by step instructions on any solution that you would like to share.

I am using magento 2.1.8 CE

I would really appreciate any comments and solutions to this issue.

/Sabina


texts: Magento 2.3 Unable to override Model: Magento\Reports\Model\ResourceModel\Report\Collection

texts:
Hello I am trying to override below function in below class using di.xml.
Below is my code not working:

  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\Reports\Model\ResourceModel\Report\Collection" type="Custom\Module\Model\ResourceModel\Report\Collection" />
</config>

Below is my model file:

<?php

namespace Custom\Module\Model\ResourceModel\Report;

class Collection extends \Magento\Reports\Model\ResourceModel\Report\Collection
{
    /**
     * From value
     *
     * @var \DateTime
     */
    protected $_from;

    /**
     * To value
     *
     * @var \DateTime
     */
    protected $_to;

    /**
     * Report period
     *
     * @var int
     */
    protected $_period;

    /**
     * Intervals
     *
     * @var int
     */
    protected $_intervals;

    /**
     * Intervals
     *
     * @var int
     */
    protected $_reports;

    /**
     * Page size
     *
     * @var int
     */
    protected $_pageSize;

    /**
     * Array of store ids
     *
     * @var array
     */
    protected $_storeIds;

    /**
     * Set the resource report collection class
     *
     * @var string
     */
    protected $_reportCollection = null;

    /**
     * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface
     */
    protected $_localeDate;

    /**
     * @var \Magento\Reports\Model\ResourceModel\Report\Collection\Factory
     */
    protected $_collectionFactory;

    /**
     * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
     * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
     * @param \Magento\Reports\Model\ResourceModel\Report\Collection\Factory $collectionFactory
     */
    public function __construct(
        \Magento\Framework\Data\Collection\EntityFactory $entityFactory,
        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
        \Magento\Reports\Model\ResourceModel\Report\Collection\Factory $collectionFactory
    ) {
        $this->_localeDate        = $localeDate;
        $this->_collectionFactory = $collectionFactory;

        parent::__construct($entityFactory);
    }

    public function getReports()
    {
        if (!$this->_reports) {
            $reports = [];
            foreach ($this->_getIntervals() as $interval) {
                $interval->setChildren($this->_getReport($interval->getStart(), $interval->getEnd()));
                if (count($interval->getChildren()) == 0) {
                    $interval->setIsEmpty(true);
                }
                $reports[] = $interval;
            }
            $this->_reports = $reports;
        }

        return $this->_reports;
    }
}


texts: Facbook Social login app throws error with code : 191

texts:
I have configure Facebook Social login app In Magento. But when i click to authorize and Get login, it's give me a following error.

Can any one help me ?


texts: how to put link in left side of the Page? through which i want to link temp.phtml page

texts:
i want to put Send Email link in left side of the page. when i press on it, it should be linked with email.phtml page.

i tried 2 or 3 different ways but it not works.

i put below code in mytheme/layout/xyz.xml

<reference name="left">
     <block type="page/template_links" name="policy_contents" as="policy_contents"      template="page/template/links.phtml">
        <action method="addLink" translate="label title">
        <label>Our Commitment To Privacy</label>
        <url>#commitment</url>
        <title>Jump To This Section</title>
        </action>
    </block>
</reference>

above code works mean through which links display. but when i replace block type, template

and other detail which is related mydata it not works.

so, what should i put exact inside .php and .phtml file???

Thanks..


texts:
I've found a strange behavior, something related with the cache, I guess.

When I'm in the checkout just give me the options:

  register
  login

And I'm pretty sure that "Checkout as guest" is enabled.

And when I navigate in private mode I can see the checkout as guest.

Thank you.

EDIT

Checking the file: ../template/persistent/checkout/onepage/login.phtml
and there is a condition

<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>

The really weird thing is that when I'm in private mode (still with that xD) or in a browser with clear cache or in a browser that I've never used that condition is true, but other way is false.


texts:
I'm using PayPal express checkout on my website, and have guest checkout enabled.

When I checkout by signing up or logging in, everything works fine. The shipping methods are displayed.

But if I use PayPal express checkout, then after completing the form on PayPal, I'm being redirected to the following URL

  https://mysite.com/paypal/express/review

and the shipping methods are blank.

Here's the screenshot with template hints on.

Any thoughts on solving this?


texts: Magento swatch is not disabled when configurable product is not on stock

texts:
I have a little problem at my Magento 2.2.5 store. When a combination of a configurable product is not on stock, the swatch should be disabled with a red strike. But at my store no swatch is disabled, as you can see at the following screenshot:

Actually, the Large size and green color isn't on stock. So it should be:

Is somebody know what to do? If i want to select this combination and put it in my cart, i get the error "not on stock"


texts: Can't add PHP-mcrypt and PHP-intl extensions on Mac Os Sierra

texts: I tried to install magento 2.1.3, but during the readiness check i get an error that says that i have to install both PHP-mcrypt and PHP-intl extensions in order to proceed. I install the previous extensions from my terminal using the following commands brew install php56-mcrypt and brew install php56-intl, then i restart the apache and running the classic phpinfo() check to see if the extensions are installed but i can't find them. I am using the default php the came along the Sierra Os. Any suggestions?


texts: bin/magento deleted when upgrading to Magento 2.2.0 using composer

texts:
I am tying to upgrade a Magento 2.1 site to Magento 2.2.0 but it seems to be dropping out during the process and the bin/magento file is removed but not replaced so nothing at all works after this.

I am using these commands:

cd /var/www/html
bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.0 --no-update
composer update

It seems to work nicely upgrading all the files but then it seems to stop (as if it has actually finished) but I get the following and the file bin/magento has completely gone.

I am definitely using the same user account to do the upgrade as was used to install Magento so I don’t think it’s a permissions problem.

 ....truncated lots of updates....
 - Removing theseer/fdomdocument (1.6.5)
 - Installing theseer/fdomdocument (1.6.6)
 Downloading: 100%

 zendframework/zend-session suggests installing mongodb/mongodb (If you want to use the MongoDB session save handler)
 zendframework/zend-session suggests installing zendframework/zend-cache (Zend\Cache component)
 paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
 zendframework/zend-captcha suggests installing zendframework/zend-i18n-resources (Translations of captcha messages)
 zendframework/zend-captcha suggests installing zendframework/zendservice-recaptcha (ZendService\ReCaptcha component)
 ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter)
 ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
 ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
 ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
 ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
 ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
 Package fabpot/php-cs-fixer is abandoned, you should avoid using it. Use friendsofphp/php-cs-fixer instead.
 Writing lock file
 Generating autoload files
 File doesn't exist: bin/magento
 Check "chmod" section in composer.json of magento/magento2-base package.