texts: Adding a customers email address to a PDF invoice (Magento V 2.2.6)

texts:
Has anyone added a customer email address to the PDF invoice in a recent version of Magento, there is a nice example for an older version from Elgentos here:

How do I add a customer's email to the sales invoice?

I am pretty new to Magento, but I can see the module needs registering in a different way etc for recent versions and I am unsure if it can even be taken across.


texts: Add additional select attributes to grouped product's child collection

texts:
I am trying to add additional attributes to the collection that is created when getting a grouped product's associated simple products:

# Magento\GroupedProduct\Model\Product\Type\Grouped

public function getAssociatedProducts($product)
{
    if (!$product->hasData($this->_keyAssociatedProducts)) {
        $associatedProducts = [];

        $this->setSaleableStatus($product);

        $collection = $this->getAssociatedProductCollection(
            $product
        )->addAttributeToSelect(
            ['name', 'price',  'special_price', 'special_from_date', 'special_to_date']
        )->addFilterByRequiredOptions()->setPositionOrder()->addStoreFilter(
            $this->getStoreFilter($product)
        )->addAttributeToFilter(
            'status',
            ['in' => $this->getStatusFilters($product)]
        );

        foreach ($collection as $item) {
            $associatedProducts[] = $item;
        }

        $product->setData($this->_keyAssociatedProducts, $associatedProducts);
    }
    return $product->getData($this->_keyAssociatedProducts);
}

The attributes I would like to add are image-related ('image', 'small_image', 'thumbnail').

I put together a plugin that will redo the collection, but I'm getting an error that I'm passing the wrong type:

Uncaught TypeError: Argument 1 passed to Vendor\\Swatches\\Plugin\\GroupedSwatches::afterGetAssociatedProducts() must be an instance of Magento\\Catalog\\Model\\Product, instance of Magento\\GroupedProduct\\Model\\Product\\Type\\Grouped\\Interceptor given

Here is my (very inefficient) plugin method:

public function afterGetAssociatedProducts(\Magento\Catalog\Model\Product $product, $result)
{
    $associatedProducts = array();
    $collection = $product->getAssociatedProductCollection(
        $product
    )->addAttributeToSelect(
        ['name', 'price', 'special_price', 'special_from_date', 'special_to_date', 'image', 'small_image', 'thumbnail']
    )->addFilterByRequiredOptions()->setPositionOrder()->addStoreFilter(
        $this->getStoreFilter($product)
    )->addAttributeToFilter(
        'status',
        ['in' => $this->getStatusFilters($product)]
    );

    foreach ($collection as $item) {
        $associatedProducts[] = $item;
    }

    $product->setData($this->_keyAssociatedProducts, $associatedProducts);

    return $result;
}

Is this even the right approach for this?


texts: categories link opens with mouseover whereas in mobile menu its works onClick i want a onClick drop down on desktop view as well in side menu

texts:
(function (factory) {
'use strict';

if (typeof define === 'function' && define.amd) {
    define([
        'jquery'
    ], factory);
} else {
    factory(window.jQuery);
}

}(function ($) {
'use strict';
$.fn.swMegamenu = function() {
    $(".navigation.sw-megamenu li.classic .submenu, .navigation.sw-megamenu li.staticwidth .submenu, .navigation.sw-megamenu li.classic .subchildmenu .subchildmenu").each(function(){
        $(this).css("left","-9999px");
        $(this).css("right","auto");
    });
    $(this).find("li.classic .subchildmenu > li.parent").mouseover(function(){
        var popup = $(this).children("ul.subchildmenu");
        var w_width = $(window).innerWidth();

        if(popup) {
            var pos = $(this).offset();
            var c_width = $(popup).outerWidth();
            if(w_width <= pos.left + $(this).outerWidth() + c_width) {
                $(popup).css("left","auto");
                $(popup).css("right","100%");
                $(popup).css("border-radius","6px 0 6px 6px");
            } else {
                $(popup).css("left","100%");
                $(popup).css("right","auto");
                $(popup).css("border-radius","0 6px 6px 6px");
            }
        }
    });
    $(this).find("li.staticwidth.parent,li.classic.parent").mouseover(function(){
        var popup = $(this).children(".submenu");
        var w_width = $(window).innerWidth();

        if(popup) {
            var pos = $(this).offset();
            var c_width = $(popup).outerWidth();
            if(w_width <= pos.left + $(this).outerWidth() + c_width) {
                $(popup).css("left","auto");
                $(popup).css("right","0");
                $(popup).css("border-radius","6px 0 6px 6px");
            } else {
                $(popup).css("left","0");
                $(popup).css("right","auto");
                $(popup).css("border-radius","0 6px 6px 6px");
            }
        }
    });
    $(window).resize(function(){
        $(".navigation.sw-megamenu li.classic .submenu, .navigation.sw-megamenu li.staticwidth .submenu, .navigation.sw-megamenu li.classic .subchildmenu .subchildmenu").each(function(){
            $(this).css("left","-9999px");
            $(this).css("right","auto");
        });
    });
    $(".nav-toggle").off('click').on('click',function(e){
        if(!$("html").hasClass("nav-open")) {
            $("html").addClass("nav-before-open");
            setTimeout(function(){
                $("html").addClass("nav-open");
            }, 300);
        }
        else {
            $("html").removeClass("nav-open");
            setTimeout(function(){
                $("html").removeClass("nav-before-open");
            }, 300);
        }
    });
    $("li.ui-menu-item > .open-children-toggle").off("click").on("click", function(){
        if(!$(this).parent().children(".submenu").hasClass("opened")) {
            $(this).parent().children(".submenu").addClass("opened");
            $(this).parent().children("a").addClass("ui-state-active");
        }
        else {
            $(this).parent().children(".submenu").removeClass("opened");
            $(this).parent().children("a").removeClass("ui-state-active");
        }
    });
};

}));
this is my code i just wante a Onclick dropdown for my desktop view like it works on mobile view instead of mouseover thanks in advance


texts: Solr category search in not working in Magento EE

texts: I have implemented solr search in Magento EE on local server and the category search is not working. I think there is some reindexing issue. I am not able to reindex it from backend. Checkbox option is not available to select and reindex it. Kindly check the attached screenshot.


texts: Custom module URL Rewrites not working after upgrade

texts:
In Magento EE 1.12.0.2 (CE 1.7.0.2 comparable) we had custom URL rewrites for a cusom module. They look like this:

+-------+--------------+------------------+----------------------------------+--------+------+--------+---------+
| store | id_path      | request_path     | target_path                      | system | opts | cat_id | prod_id |
+-------+--------------+------------------+----------------------------------+--------+------+--------+---------+
|     1 | insurance/10 | carinsurance/    | insurance/form/index/sku/car/    |      0 | NULL |   NULL |      10 |
|     1 | insurance/13 | travelinsurance/ | insurance/form/index/sku/travel/ |      0 | NULL |   NULL |      13 |
|     1 | insurance/8  | houseinsurance/  | insurance/form/index/sku/house/  |      0 | NULL |   NULL |       8 |
+-------+--------------+------------------+----------------------------------+--------+------+--------+---------+

Now after an upgrade to EE 1.14.2.4 (CE 1.9.2.4 comparable) the custom URL rewrites no longer work and we are getting a Magento 404 page.

During the upgrade we've followed all the necessary steps regarding URL rewrites (running the shell scripts, re-indexing, etc...)

How can I fix this and get the custom rewrites to work again?


texts: There has been an error processing your request Magento 2.3.4

texts:
{"0":"SQLSTATE[HY000] [2002] No such file or directory","1":"#1 Zend_Db_Adapter_Pdo_Mysql->_connect() called at [vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:410]\n#2 Magento\Framework\DB\Adapter\Pdo\Mysql->_connect() called at ......

What does this error means, it keeps reporting the same again and again. How do i solve this


texts: Import of product via CSV (need to update, not replace, not append)

texts:
I'm having this situation where I need to import around 300 products with different attributes and 4-8 pictures for every products. I have created a valid csv file, within my ERP program (accounting software, which use MSSQL as database). As I said csv file which is created from my locale software is 100% valid and the importation is working just fine. All the attributes and pictures are in it's place.

Now i encountered to another problem, which I don't know how to solve. I have used the function "Replace Existing Complex Data" when import, but this function deletes all the existing data (products which I manually added to for example "Featured" or "Our suggestion" category).

So I tried to fix this with the "Append Complex Data", but this function is not working for me because it duplicates the pictures (append the pictures).

The best scenario would be if it is there a function just to update the complex data, not to replace, not to append.

UPDATED

Could this be done, by setting up that the Magento doesn't apply the import changes for the specific category?


texts: Magento 2 code validation Unescaped output detected warning

texts:
I've created a Magento2 Module, When I validate the PHP code, am getting the  Unescaped output detected.

I got the following solutions from that blog /* @noEscape */ moreover, it's not fixing the problem.

I want to know how to fix this issue, and need some detailed technical explanation of the /* @noEscape */


texts: Activated but still "The requested Payment Method is not available." as registered user only

texts:
I activated several Payment Method and those are getting displayed on the checkout page.
But regardless which option I select Magento always returns:

  The requested Payment Method is not available.

The problem only occurs if I use a registered user. Guest works fine.

Any ideas?


texts: After updating to 1.9.3 images in fronted not loading from cache

texts:
Upgraded Magento from 1.8.0.1 to latest 1.9.3. and all seemed to be fine. The image uploader was broken but managed to fix that by reading the files for the older flash uploader. So basically can add images to products and it works. However, there is some problem with the cache and images on frontend is slowly disappearing. They are loaded from media/catalog/product/cache/etc... but the image is not there. Seems as the caching of images is broken or something. Found several threads on the subject but none with this particular issue. Any ideas how to solve it?

EDIT: Some new info. Also upgraded php on the server from 5.4 to 5.6 and it seems as magento is rebuilding cache fine but only for png images. My assumption is that php_gd is not set to work with jpg. How do activate that?


texts: Need sales data archived for certain period Magento 1.7

texts:
We are working for eCommerce site which have huge traffic and Orders tables like sales_flat_order,sales_flat_order_grid,sales_flat_invoice have more then 3 lakh records.

There are running cron in the system which export the orders to back office support and this cron runs in every 15 min. The problem is that when there are huge traffic in the site the crons become jam. So can anybody help me to suggest that why this happening. Is this need to clean the database or anything else we need to do to overcome this problem.


texts: after run bin/magento setup:upgrade got the error

texts:
I've gotten this notification:

  The following modules are outdated:
  Test_Test schema: current version - none, required version - 2.0.0
  Test_Test data: current version - none, required version - 2.0.0

After running bin/magento setup:upgrade I got the error:

  [Exception]
   Warning: file_get_contents(var/di/setup.ser): failed to open stream: No such file or directory in .vendor/magento/framework/App/ObjectManager/ConfigLoader/Compiled.php on line 28

How can I solve this?


texts: Magento 2: Requested store is not found in product

texts:
I get this message "Requested store is not found" when I want to create a new product or edit it.

Magento 2.2.5

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

This already applies but does not solve

Any other solution?

Below error showing in log file.

  main.CRITICAL: Requested store is not found {"exception":"[object]
  (Magento\Framework\Exception\NoSuchEntityException(code: 0):
  Requested store is not found at
  /vendor/magento/module-store/Model/StoreRepository.php:109)"}

Please help me.


texts: I can't find any record in Reports Orders (reports/report_sales/sales/) even if I tried to place some order from the store.


texts: How get products name magento 2 sql database

texts: I am trying to get products name(value) and when i see my db table catalog_product_entity_varchar but in which in the column of value all base images are given so please tell accurate table or any method to get products name or value


texts: add to cart button not working on catalog page

texts:
The Add to cart button on my site's catalog page isn't working. A few days back I disabled the add to cart button from product page by commenting out the cart from view.phtml file in

public_html/app/design/frontend/default/perfectum/template/catalog/product/view.phtml

But after I removed the forward slashes, button was enabled and working in the product page - but in catalog page, when I click on add to cart button, it keeps on loading and loading.

Can anyone help me with this.

Thanks in advance.


texts: Magento2 Registration Form is not showing State Dropdown

texts:
I want to show Address fields in Registration form of Magento 2.4.0
I have created file in my theme as below.
app/design/frontend/YOUR_PACKAGE/YOUR_THEME/Magento_Customer/layout/customer_account_create.xml

I have set the action method called setShowAddressFields like true by adding below code.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_form_register">
            <action method="setShowAddressFields">
                <argument name="show.address.fields" xsi:type="boolean">true</argument>
            </action>
        </referenceBlock>
    </body>
</page>

I can see address fields after adding this in the layout file, but I could not see state drop-down.
I have attached a screenshot of registration form.


texts: Working Magento 1.4.1.0 and changing Mysql from 5.1 to 5.5

texts:
I have a working stable Magento 1.4.1.0 community website using Mysql 5.1 for many years now with no problems.

If I upgrade Mysql to 5.5 will I have problems with my Magento 1.4.1.0 website? Or should I just stay with Mysql 5.1 and not take a chance of ruining a working stable website?

I know that Mysql 5.1 default engine is MyISam and Mysql 5.5 the default engine is InnoDB. Will this cause problems?

I looked at my present Magento 1.4.1.0 datbase and all but 3 items are TYPE InnoDB, but the default engine is MyISam.

Thanks for helping me!


texts: magento 2 tax rate always 0% and 0,00 € in FE and order

texts:
under orders no matter what tax rate a product has, magento displays it as 0 %. And says that tax is 0,00 €.
Screenshot: https://imgur.com/ttl6zQy
Here you can see that the product does NOT have 0 % tax rate set:
https://imgur.com/ZmZaj6I
I allready tried the options in Sales->Taxes
I am using Magento 2.3.2
Thanks a lot for your help.


texts:
I have made one custom product type. In this I want to allow the admin to add any pdf from admin side which will be allowed for the visitor to download on frontend side.

So please help me how to achieve this.


texts: element 'topic' attribute 'is synchronous' the attribute 'is synchronous' is not allowed

texts:
Good Morning,

Here is my problem and the screenshot link below is self-explanatory:
https://drive.google.com/file/d/1gOoTAzLBuvEjx5pmFFWZUEj-t7oa4icd/view
Can someone help me fix that issue?
Best regards,
Pascal


texts: Module Forms - Store Value of addField to a Variable

texts:
I have something like in my custom module:

$fieldset->addField('orderinfo', 'link', array(
      'label'     => Mage::helper('web')->__('Order Info'),
      'style'   => "",
      'href' => Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id' => $order_id)),
      'value'  => 'Magento Blog',
      'after_element_html' => '',
    ));

And as you can see from the code, I am trying to link that field to the Order Tab in the back-end. I'm having trouble getting the ID though. I'm planning to just save the Order ID in the database and then using the addField I could have the correct URL.

But how can I save an addField value to a variable?
I want to store the value in "$order_id".
Is it possible?


texts: Magento2 - how to configure a widget calendar?

texts:
How to configure a widget calendar ?

I found some solutions, but can not understand clearly How to add calendar in admin configuration options?

Can anyone review and guide me step by step please ?


texts: admin magento connect access to www. domain.com denied in magento1.9.1.0

texts:
we facing there error
"Access to www.domainname.com was denied
You don't have authorization to view this page.
HTTP ERROR 403"
I have writable permission on directory 755 and file 644 but not work
kindly have any solution
and we access any file in downloader directory in any custom file to too same error


texts: Magento2 Restrict Store view to a customer group

texts:
I need to restrict 1 storeview to a customer group and require login.
Any suggestions?


texts:
I have a grid in admin product form. In actionColumns there is a action to edit the row of grid. I would like to open modal when click in the edit.

All examples redirect to other page.

Thanks


texts: Magento 2 Error: Base table or view not found: 1146 Table 'dbname.catalog_category_flat_store_1' doesn't exist

texts:
I started getting this error suddenly and I checked and the table does exist. I'm not sure how to start fixing this issue. I have attached a picture below:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento_e.catalog_category_flat_store_1' doesn't exist, query was: SELECT main_table.entity_id, main_table.name, main_table.path, main_table.is_active, main_table.is_anchor, url_rewrite.request_path FROM catalog_category_flat_store_1 AS main_table
       LEFT JOIN url_rewrite ON url_rewrite.entity_id = main_table.entity_id AND url_rewrite.is_autogenerated = 1 AND url_rewrite.store_id = 1 AND url_rewrite.entity_type = 'category' WHERE (main_table.is_active = 1) AND (main_table.path like '1/2/15/%') AND (level <= 3) ORDER BY main_table.position ASC


texts: Magento 2 - Add custom sort by option in cattegory page and make it default

texts:
I have added custom sort by option "random" for category page. I have used following code to add random option:

I have used plugin .

  app/code/DL/CustomSortOption/etc/frontend/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Config">
    <plugin name="sortby_add_custom_option" type="DL\CustomSortOption\Plugin\Model\Config" />
</type>
<type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
    <plugin name="sortby_extend_default_sort_filters" type="DL\CustomSortOption\Plugin\Block\Toolbar" />
</type>

  app/code/DL/CustomSortOption/Plugin/Model/Config:

<?php
    namespace DL\CustomSortOption\Plugin\Model;

    class Config
    {
        public function afterGetAttributeUsedForSortByArray(\Magento\Catalog\Model\Config $catalogConfig, $options)
        {
          $customOption['random'] = __('Random');
          $options = array_merge($customOption, $options);
          return $options;
        }

    }
?>

  app/code/DL/CustomSortOption/Plugin/Block/Toolbar

<?php
namespace DL\CustomSortOption\Plugin\Block;

use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Select;

 class Toolbar
 {
     protected $_collection;

     public function aroundSetCollection(
         \Magento\Catalog\Block\Product\ProductList\Toolbar $toolbar,
         \Closure $proceed,
         $collection
     ) {
         $this->_collection = $collection;
         $currentOrder = $toolbar->getCurrentOrder();
         $currentDirection = $toolbar->getCurrentDirection();
         $result = $proceed($collection);

         if ($currentOrder) {
             switch ($currentOrder) {
               case 'random':
                   $this->_collection
                       ->getSelect()
                       ->order('RAND()');
               break;

               default:
                   $this->_collection
                       ->setOrder($currentOrder, $currentDirection);
               break;
             }
         }
         //var_dump((string) $this->_collection->getSelect()); You can use this to get a list of all the available sort fields
         return $result;
     }

 }
?>

This new option Random which I added is working fine and appears in sort by drop-down in front-end on category page. I want this new option to be made default so when user opens category page it should be applied by default.

}


texts: magento2 create collection filter in sale order

texts:
I have wirted in menu.xml
<add id="Mageplaza_OrderFilter::completed"
         title="Order with Status 'completed' filter"
         translate="title"
         module="Mageplaza_OrderFilter"
         sortOrder="1"
         parent="Magento_Sales::sales_operation"
         action="mageplaza_orderfilter/completed"
         resource="Mageplaza_OrderFilter::completed"/>

How can i click in this button Order with Status 'completed' filter so the list product will automatically filter the results with 'completed' filter in module sale_order?


texts: how to get product alert email outside magento

texts:
I want to send the product stock alert mail from outside magento app folder.

How will i access the email object for that outside magento?

I have already bootstrapped Mage.php file

$storeId = Mage::app()->getStore()->getId();
$templateId = 'product_stock_alert';

$emailTemplate = Mage::getModel('core/email_template')->loadByCode($templateId);
//$vars = array('user_name' => $userName, 'product_name' => $productName);
//$emailTemplate->getProcessedTemplate($vars);
$emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));

$emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));

    foreach ($emails as $email) {
        if (in_array($email['product_id'], $qty)) {
            $emailTemplate->send($email['email_id'],'Alvaro');
        }
    }

EDIT:Any clue at least where to start checking on this?


texts:
in my website, in template/persistent/customer/form/login.phtml, there's the following line:

echo $this->getChildHtml('persistent.remember.me');

It calls the template/persistent/remember_me.phtml file. But the file content is not actually loaded at all.

I tried to insert the remember_me.phtml contents straight to the login.phtml file, and I'm getting the following error:

Invalid method Mage_Customer_Block_Form_Login::isRememberMeChecked

Why is this happening? What should I do to fix it?


texts: Magento updating database manually not working

texts:
I'm trying to manually update a column "term" in a table named "adyen_subscription" via a primary key "entity_id".

I followed this in calling the table: Mage::getModel('namespace_modulename/tablename')

AJAX:

$('#submit').on('click', function(){
    $.ajax({
        type: 'post',
        url: '/scripts/edit.php?entity_id=' + diaper_size,
        success: function(data) {
            $(".success-subscription-message").html('
Edit Successful
');
        },
        error: function(data, status, error) {
            alert(error);
        }
    });
});

PHP:

$entity_id = $_GET['entity_id'];

$subscription = Mage::getModel('adyen_subscription/subscription')
            ->getCollection()
            ->addFieldToFilter('entity_id',$entity_id);

foreach ($subscription as $item) {

    $item->setData('term', $frequency);
    $item->save();
}

There were no errors, but the database wasn't updated.


texts: Magento 2 : textarea height automatic set large in admin

texts:
In magento 2 admin, I want to expandable textarea height using xml. How to do that?

I tried this code. But, it's not working.

<field name="comment">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Comment</item>
                    <item name="formElement" xsi:type="string">textarea</item>
                    <item name="source" xsi:type="string">comment</item>
                    <item name="dataScope" xsi:type="string">comment</item>
                    <item name="cols" xsi:type="number">200</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>

Actual Result :

Expected Result :


texts: Magento product isSaleable based on country

texts:
I'm working on a new webshop, which will be international orientated. The problem I have is, some products I sell are available for all countries, except for the Netherlands due to new laws and regulations. Ofcourse I can make a specific store view for the Netherlands, and not show those products. But still Dutch customers can go to another view and add those products in their cart.

I think I might need to check the selected coutry of delivery in the cart / checkout. And delete "forbidden" products from the cart. But how?

I hope someone can push me in the right direction.

Regards,

Wouter


texts:
I am trying to space out the line of footer links that are not in the Admin>CMS>Static Block (Site Map, Advanced Search, Search Terms....) on this site: http://silversalesusa.com/magento and I cannot get it to work. Can't even find where these labels are stored so that I can add a few spaces and a | to separate them. Either would work. Any ideas? (See my update below...)

EDIT
OK. Something I did worked somewhat. I have the | character between all except the last two and there is one at the end which doesn't need to be there. Why is the | missing after Orders and Returns? Here's the code:

    <?php $_links = $this->getLinks(); ?>
    <?php if(count($_links)>0): ?>
    <?php ksort($_links); ?>
    <ul class="links"<?php if($this->getName()): ?> id="<?php echo $this->getName() ?>"<?php endif;?>>
<?php foreach($_links as $_link): ?>
    <?php if ($_link instanceof Mage_Core_Block_Abstract):?>
        <?php echo $_link->toHtml() ?>
    <?php else: ?>
        <li
        <?php
            if($_link->getIsFirst()||$_link->getIsLast()): ?> class="<?php if($_link->getIsFirst()): ?>first<?php endif; ?>
        <?php
                    if($_link->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?>
        <?php echo $_link->getLiParams() ?>>
                <?php echo $_link->getBeforeText() ?><a href="<?php echo $_link->getUrl() ?>" title="<?php echo $_link->getTitle() ?>" <?php echo $_link->getAParams() ?>><?php echo $_link->getLabel() ?><?php echo '  |' ?><?php echo $_link->getAfterText() ?>

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

    <?php endif; ?>


texts: how to display multiple products on my created custom module in Magento 1

texts:
Created products subcategory want to display all the products that are listed in the category.

The below snippet gives me single product details, I want all the products listed

<?php
$model = Mage::getModel('catalog/product'); //getting product model

$_product = $model->load($productid); //getting product object for particular product id

echo $_product->getShortDescription(); //product's short description
echo $_product->getDescription(); // product's long description
echo $_product->getName(); //product name
echo $_product->getPrice(); //product's regular Price
echo $_product->getSpecialPrice(); //product's special Price
echo $_product->getProductUrl(); //product url
echo $_product->getImageUrl(); //product's image url
echo $_product->getSmallImageUrl(); //product's small image url
echo $_product->getThumbnailUrl(); //product's thumbnail image url

?>


texts: Magento's REST API responses claiming oauth_callback param is empty

texts:
Working with Magento CE 1.9.

I'm attempting to make use of Magento's API however I keep running into the same error in my response: oauth_problem=parameter_absent&oauth_parameters_absent=oauth_callback

I've referenced Magento's documentation and in order to get this "unauthorized request token", they claim the oauth_callback param "should be present in the Authorization header".

http://devdocs.magento.com/guides/m1x/api/rest/authentication/oauth_authentication.html#OAuthAuthentication-GettinganUnauthorizedRequestToken

I've used multiple REST clients (especially Postman) and random HTTP Request generators that feature OAuth authentication and none of them seem to posess the means to include the oauth_callback param in the Authorization header. I've also attempted to manually include the oauth_callback param into my Authorization header but then it breaks the signature or has other, similar errors.

I've tried POST (what is recommended by Magento's doc), GET (what I've actually seen others using for this step - believe it or not) and I've attempted to tuck the oauth_callback into header, body and parameters without success.

So then, where should the oauth_callback be included if adhering to Magento's documentation for REST API usage?


texts: How to call product new.phtml in admin cms home page magento 2.2.6

texts:
How to call new.phtml file in the home page admin Magento 2.2.6 version?

Please check my screenshot link here http://prntscr.com/lapiu7.

And also check my theme default.xml code.

<referenceBlock name="category.products.list"   >
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Magento_Catalog::product/new.phtml</argument>
    </action>

Then after that, I put the code in my cms home page admin.

{{block class="Magento\Framework\View\Element\Template" name="new_file" template="Magento_Catalog::product/new.phtml"}}

http://prntscr.com/lapk4g

But it's not working.

Please let me know how to implement custom product slider in Magento 2.2.6

http://prntscr.com/lazzuu


texts: magento 2 setup:static-content:deploy memory error

texts:
I am trying to install quick setup of theme also did but css and js is not loading so i run command.
    php bin/magento setup:static-content:deploy -f
    but every time getting error like memory error
and also getting error related to execution time
    is there any solution?


texts: How to override default email templates using Yireo_EmailOverride extension?

texts:
I have read numerous articles suggesting, I shouldn't modify the core email templates. Instead, most articles have suggested to install Yireo EmailOverride to easily create email overrides.I want to create overrides so that emails matches the store design.  I have installed the extension, but I am unable to figure out what to do next.
Should I manually copy the core transactional emails to my template design ie app/design/frontend/galio/ma_galio1/template?

I am trying to follow these steps


texts: How to remove Create an Account button on Success Page in Magento 2?

texts:
I want to remove Create An Account button with "You can track your order status by creating an account." text on success page in Magento 2.
I have removed checkout.registration block from checkout_onepage_success.xml but it is still showing.

<referenceContainer name="content">
       <block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="success.phtml" cacheable="false"/>
       <!--<block class="Magento\Checkout\Block\Registration" name="checkout.registration" template="registration.phtml" cacheable="false"/>-->
</referenceContainer>

Can anyone help? Thanks in advance. :)


texts: unable to add product in wishlist form product detail page more then one in wishlist?

texts:
please anyone help me find this solution

<a href="#" data-post='<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist" id="hasitem-wish">

<a href="#" data-post='<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist">


texts: How to change prices for a bundle of products programmatically?

texts:
I need to change the percentages / prices for products in the bundle programmatically.
That is, when adding a bundle of products, you need to write a module that changes the input data
(in the screenshot, these are percentages: 56, 24, 20)

I need to replace them,
for example, with 25, 25, 50.

Help, please, otherwise I'm new to, magento 2.


texts:
I have added a custom product attribute with yes/no options.
I need to delete products if 'no' attribute option is selected.
I have successfully removed cart item using "controller_action_predispatch_checkout_cart_index" event.
but i face issue in the following scenerio:

First i set product attribute to yes . This will allow customers to add the product in cart. now go to frontend add product to cart, now go back to admin and set the product attribute option as no.
so this will not allow product to cart.
but i face trouble for already added product. so i created observer to automatically remove on cart predispatch.
but what if customer go directly to checkout page .

any ideas what event i must call . so that it will remove all the products already added to cart ?

Edit:

Thank you for your response..

I think Magento\Checkout\Model\Cart 's addProduct() is called only when product is added to cart.. how about already added to cart..

For example I add product in cart .. then admin set conditions and here let added product does not satisfy the conditions.. so this product does not get removed .. Magento\Checkout\Model\Cart 's addProduct() is triggered only while adding product to cart


texts:
What is the use of ifconfig tag inside the block tag in a layout xml file?
What purpose does it serve?


texts:
how can i changed order of items in side bar

current case
1: as of now it shows filter in below order
 shop by , price and then other filter

what to do if u want below order

price, shop by , then other filter

i think there must be some setting or way to do it via admin ,

please tell me way to do it


texts: Magento Most Viewed Products Report empty

texts:
Alright so the issue is that i'm not seeing any records in the dashboard, reports, or database for Most Viewed Products.  I've seen a couple of solutions where there's data in the database but it's not populating the dashboard.  However in my case no data is in the database or the admin area.  The site has been live for a couple of weeks with a lot of traffic so there should be something here.  Any ideas?  Is there a setting where this could have been turned off?

Thanks in advance.


texts: Magento 2 How to Update Tax Logic When change shipping Address

texts:
I am looking solution to dynamically change Tax "Calculation Based On" settings when changing shipping methods from checkout page.
e.g.
There are two shipping methods:

Shipping Test one
Shipping Test two

currently we have set the default shipping calculation based on "shipping origin". Now suppose end user choose "Shipping Test two" method then it should calculate based on "shipping address" not shipping origin .
if anyone have idea please share me.
Thanks,


texts: Magento2 Checkout and Admin net::ERR_INCOMPLETE_CHUNKED_ENCODING

texts:
On this server sometime the Magento 2 admin or checkout will freeze.  I'm working in Chrome and the console will show net::ERR_INCOMPLETE_CHUNKED_ENCODING.

Dedicated server:
CentOS release 6.8
PHP 7.0.7 w/ FPM
nginx/1.11.1
5.6.30-76.3 Percona Server

Similar setup to my local dev VirtualBox which is slow but never has this problem.  Same code different server so I'm assuming there is an issue with the software stack or configuration but have been unable locate.

Guess I'm hoping this issue is familiar to someone.


texts: How do i find the discount amount based on product that matches shopping cart price rule in magento 2?

texts:
I am trying to find the discount amount which match the shopping cart rule based on product. I want to get discount amount that matches my product price rule based on product details(product id, sku). here is the code i am using but its not working.

<?php
$products_id = $_helper->productAttribute($_product, $_product->getId(), 'id');
$_p = $objectManager->get('Magento\Catalog\Model\Product')->load($products_id);
$price_rules = array();
$rules = $objectManager->create('Magento\SalesRule\Model\Rule\Action\Collection')
                       ->load();
foreach($rules as $rule){
  $rule->afterLoad();
}

$quoteId = $objectManager->getSingleton('checkout/session')->getQuoteId();
$real_quote = $objectManager->getSingleton('sales/quote')->load($quoteId);
$product = $objectManager->get('sales/quote_item')->setQuote($real_quote)->setProduct($_p);
$product->setAllItems(array($_p));
$product->getProduct()->setProductId($_p->getEntityId());
foreach($rules as $rule)
{
    if ($rule->getConditions()->validate($product))
    {
        echo ':)';
        echo $rule->getData('discount_amount');
    }
}

?>


texts:
I am facing the below error while migrating from m1.9 to magento 2.3.3 version.
Notice: Undefined offset: 19 in \vendor\magento\data-migration-tool\src\Migration\Step\Eav\Data.php on line 279 while migrating m1.9 to magento 2.3
I am searched in many places, none of the solution worked for me. Please help me to resolve this.


texts: Magento2 - Marketplace showing error but I have checked there is no error

texts:
I am getting below error of Marketplace.

Attached the screen shot of Error.

I have checked with update Production mode and no issue found.


texts: apply catalog promotion rule on tier prices and special prices in magento 2

texts:
I want to apply my catalog promotion price rule for products having tier price as well.
Current magento functionality only checks the price  minimum value and displays the least among the both but I need the percentage rule amount discounted on tier price too.


texts:
I am working on module where multiple quote can be created and you can add custom discount to any quote (this working fine). After adding product when I place order discount become zero mean (order place with actual product price).

What I think I should do
before saving adding product to quote I divide custom discount of quote to quote items and add discount to each quote item, but discount value to quote items is not saving.

here is code snippet
public function itemDiscount($quote)
    {
        $total =  $this->session->getCustomDiscount();
//        var_dump($total);
//        exit();
        if ($total != 0) {
            $total_items = count($quote->getAllVisibleItems());
            foreach ($quote->getAllVisibleItems() as $item) {
                $rate = +$total / $total_items;

                $customAmount = $rate +  ($item->getPriceInclTax() * $item->getQty());
//                var_dump($total_items);
//                exit();
//                $rat = $item->getPriceInclTax() / $total;
//                $ratdisc = $discountAmount * $rat;
                $item->setDiscountAmount($rate);
                $item->setBaseDiscountAmount($rate);
//                $item->setDiscountAmount($rate);
                $item->setPrice($customAmount);
                $item->setCustomPrice($customAmount);

//                $item->setData('base_discount_amount', 9);
//                $item->setData('discount_amount', 89);
//                $item->setData('custom_price', 56);
//                $item->save();
//                $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc) * $item->getQty())->save();
//                $item->setBaseDiscountAmount($rate);
//                $item->save();
            }
        }
    }

I tried all this solution or ways but discount value is not save to quote items.


texts: How to integrate Product Designer Plugin (Built in Magento) to my existing site built in PHP?

texts:
I run an online t-shirt designing company. We've built our site using - Flash Design tool and built the complete site in PHP (Code Ignitor). As the existing design tool is built in Flash, it is less responsive. We want to integrate this tool - http://www.designnbuy.com/all-in-one-designer-html5.html But they wanted us to convert the existing site to magento platform , then only they would be able to integrate.

I've spent good amount of time and energy in building the complete website including the back end framework needed for printing shipping labels to production. I would prefer not to migrate the entire site to Magento. Is there any way I can integrate my existing site built in PHP and the tool built using Magento?

Thanks in advance.


texts: Why is my select query returning no results?

texts:
I’m doing a function that after the user saves the product it updates or inserts the product in a table, but to know if magento has to update or insert I have to verify if the product is in the table, when I do the select query I’m obtaining nothing in my variables

Here’s my code

            $resource = Mage::getSingleton('core/resource');
            $readConnection = $resource->getConnection('core_read');

            $tabla = $resource->getTableName('_destacados_web');

            $querySelect = "SELECT DCOD, DCATEGORIA FROM ".$tabla." WHERE DMARCA = '".$partesSku[0]."' AND DITEM = '".$partesSku[1]."'";

            $results = $readConnection->fetchAll($querySelect);

            $codigo = $results['DCOD'];
            $categoria= $results['DCATEGORIA '];

As you can see, the idea it’s really simple, just obtaining two rows of my table and saving that into the variables, but every time I run the code I get nothing in the variables,

I hope you guys can help me!
Thanks


texts: Create drop-down product attribute for frontend

texts: How to create an drop-down product attribute for frontend programmatically .


texts: Cart updating only after refreshing the page

texts:
Webshop on Magento 1.9.1.1

In the product page, when I add an item to the cart, it is not immediately updated. I can see the product added to the cart only after a refresh of the page.

How can I solve this issue?


texts:
I would like to have some custom links in the dropdown menu, but then on the thirth level.

I now have like:

RootCategory
-> Category1 (eg Baby)
   -> Gender (eg Boy or Girl)
      -> Kind of clothing (eg trousers, shirts ...)

But i want to add an extra 2nd level category "Brands".
On which i want to display some featured brands.
I also have de Amasty Improved navigation extension, so my brandpages have the following url:  www.website.com/brand.html

I would like to have this setup:

RootCategory
-> Category1 (eg Baby)
   -> Gender (eg Boy or Girl)
      -> Kind of clothing (eg trousers, shirts ...)
   -> Brands
      -> Featured Brand 1
      -> Featured Brand 2

But now they get the url: www.website.com/Category1/Brands/brands.html

My Question:
How could i change the link in the navigation to the short url: www.website.com/brand.html

I am using Magento 1.8.1 CE


texts:
UPDATE: this could be a version issue, should I update to the non-stable 2.0.4? currently 2.0.0 I install it using git clone, follow by composer install.

I know this should seem obvious to someone, but clearly it's not.
as state in the documentation

  In Admin, go to Stores > Configuration > Design.

but there is only a robot txt edit as seen in the below screen shot

I track down the issue on github #4251

  All design configurations were moved to Content -> Design -> Configuration

when I get there, my custom theme successfully show up, but no button to change it, as seen below. there is no option to change from the default lumia theme to blank theme neither.

is it just me? or I am blind and missing something really obvious?
my magento version is 2.0.0


texts:
We are building our first M2 site. We noticed that the administration area is running slower than we would expect. This especially causes headaches when trying to create the product catalog. The difference between a 2 second product search, view or edit and a 6-8 second can make catalog management quite a grind.

Just to make sure, I had reasonable expectations, I set out to find some 'demo' Mage 2 implementations for comparison. I found 3 accessible admin interfaces for demo installations.

I ran the several tests on both our test installation and the demos that we found. The results are as follows:

Admin dashboard load: 2-3 seconds
Admin products catalog list load: 5-6 seconds
Admin product load (configurable): 6-9 seconds
Admin product save (configurable, including reloading it following): 9-12 seconds
Admin order listing load: 4-6 seconds
Admin order load: 3-6 seconds

Most of these tests (including our internal test) were on a basic LUMA install with the preset products/orders provided in the seed data.

Before testing, I completed the following optimisations on my test installation:

All caches, indexes on
Production mode on
Redis configured
Logging off
PHP7 used
Enabled flat categories and products
Removed all extensions
Turned on Varnish
Set up memcache

Two questions:

Are my findings on par with expectations? If not, how long should I expect these tests to take if I have a well optimized installation?
What suggestions do you have to optimize admin performance beyond what I have already performed?


texts: Bundled Product "Add to Cart" immediately?

texts:
When I am on the category list of products, and I hit "Add to Cart" on simple products, I get redirected to the cart with the product added to the cart.

However, when I add a Bundled product, even if the bundle has no configurable options, I always get redirected to the product page, where I have to click on "Add to Cart" again.

Is there a way to "fix" this so if I click "Add to Cart" on a bundled product from the category list view, it gets added to the cart immediately?


texts: How to add product image to new order email template

texts:
I need to add a product image to a new order email after successful checkout.

Which file do I need to override to affect only new order email template?

Should I override it in app/code or app/design?

Can anyone suggest a proper way to do it!?


texts:
Where is the code for "buy now" button ?

In which template ?

I want to paste that code in some another page


texts: Ajax.Responders.register's onComplete Executes Before Ajax Complete

texts:
I'm trying to add background colors on the admin orders grid based on the order status in a Magento 1.9 install. I have colors coming fine on page load, but when the grid is reloaded with ajax if any filtering/sorting is done, I loose the background colors because the JS function that I'm using isn't executed again.

I thought I have found a fix with using:

Ajax.Responders.register({
    onComplete: function(transport) {
        $.each(theTable, function (index, row) {
            var sourceRow = $(row).children()[pos].innerHTML.toLowerCase().trim();

            switch (sourceRow) {
                case 'backordered':
                    alert('hello');
                    $(row).css("background", "rgba(250, 54, 54, .5)");
                    break;

            }
        });
    },
});

When I run this code, the alert function will pop up before the ajax request is complete. So the grid elements haven't been built on the page when my code is executed and the background color is not applied.

This doesn't make a lot of sense to me, as you would think that onComplete would hit when the request is complete.

I have tried making the .css call on page elements that are already on the page (anything that isn't coming in on the ajax request) and it works fine to change the color. So I know that things like jQuery not being there or the incorrect use of the .css is not that issue.

Also, when I place an alert in the onSuccess object of the Ajax.Responders.register, it never hits.

Ajax.Responders.register({
    onSuccess: function(transport) {
        alert('hello success');
    }
});

Any ideas on what might be failing here?


texts:
I want to put the header.links into another block.
this is the icon.phtml file:

the menu.phtml file:

    content

This is the layout file:

<referenceContainer name="header-wrapper">
    <block class="Magento\Framework\View\Element\Template" name="icon_account" as="icon_account" template="Magento_Customer::/icon/icon.phtml"/>
    <block class="Magento\Framework\View\Element\Template" name="links-menu" as="links-menu" template="Magento_Customer::/menu/menu.phtml"/>
</referenceContainer>

<move element="header.links" destination="links-menu"/>

The problem is that the header.links are not into the desired destination.
How can I fix it?

Full xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <css src="https://use.fontawesome.com/releases/v5.7.0/css/all.css" src_type="url"/>

        <referenceBlock name="header.links">
            <block class="Magento\Customer\Block\Account\Customer" name="customer" template="account/customer.phtml" before="-"/>
            <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login" template="account/link/authorization.phtml"/>
        </referenceBlock>

        <block class="Magento\Theme\Block\Html\Header" name="header" as="header">
            <arguments>
                <argument name="show_part" xsi:type="string">welcome</argument>
            </arguments>
        </block>
        <move element="header" destination="header.links" before="-"/>
        <move element="register-link" destination="header.links"/>
        <move element="my-account-link" destination="header.links"/>
        <move element="top.links" destination="customer"/>
        <move element="authorization-link" destination="top.links" after="-"/>
        <referenceBlock name="register-link" remove="true"/>

        <referenceContainer name="header-wrapper">
            <block class="Magento\Framework\View\Element\Template" name="icon_account" as="icon_account" template="Magento_Customer::/icon/icon.phtml"/>
            <block class="Magento\Framework\View\Element\Template" name="links-menu" as="links-menu" template="Magento_Customer::/menu/menu.phtml"/>
        </referenceContainer>

        <move element="header.links" destination="links-menu"/>

        <move element="icon_account" destination="header-wrapper" before="minicart"/>
        <move element="top.search" destination="header-wrapper" after="logo"/>

</page>


texts: Cart template $this->getItems() as $_item obtains configurable details not simple

texts:
I'm editing the order in which the cart items appear in the table. I am trying to get the "vendor" super attribute value from each $this->getItems() as $_item. $_item->getProduct()->getId() is returning the simple product's parent configurable product id. I need to obtain values from the simple product in the cart. I'm not sure why $_item->getProduct()->getId() is giving me the parent Id. How do I get the "vendor" value. I have tried the following among other similar methods:

/template/checkout/cart.phtml

foreach($this->getItems() as $_item){
    $currentItemVendorId = Mage::getModel('catalog/product')->load($_item->getProduct()->getId())->getData('vendor');
}


texts: Grand Total Block is not getting displayed in the order emails

texts: I am using magento community version 1.9.2.1 the issue I am facing is that the Grand total block in the order confirmation email is not being displayed. Can anyone please help me out.. thanks in advance..


texts: How to get the substring before & after a seperator?

texts:
The Product name consists of a string - number like:

  Chains-23x10 5R 12

I want to display the substring before - in one line and the substring after - in next line. I tried it with the code:

<?php $str = substr($str, ($pos = strpos($str, '-')) === false ? 0 : $pos + 1); ?>
<?php echo $str; ?>

But only the string after - is getting displayed.

Someone help please.


texts: How to implement a new design from scratch in magento 2.1?

texts: I want to create a custom design by my self in magento 2.1 (without simple data version), how can I create it , with any resources please


texts:
Normally a XML file always needs at least the following starting line:

<?xml version="1.0"?>

The theme.xml files in the official distribution lack this tag, see for example the luma theme's file here:

https://github.com/magento/magento2/blob/2.2-develop/app/design/frontend/Magento/luma/theme.xml

Why does this work, and why is this implemented like this?


texts: How to stop creating product as virtual in magento 2 programatically?

texts:
Some time we forgot to add weight to the product and its become an automatically of type virtual product.

I am trying to generate a product of a type "simple" in case we forgot to add weight ...

I would like to by-pass a condition where product type is set as "virtual".

I have done following workaround for this:

  in the file :
  vendor/magento/module-catalog/Model/Product/TypeTransitionManager.php

under function processProduct() i have tried by commenting following line:

$product->setTypeId($productTypeId);

But it is not working.. How can we handle this programmatically?


texts: How to rewrite url in magento for custom module

texts:
I created a custom module in magento ...
 my  url is

seller/seller/sellercreate

i need to rewrite this url

like

http://example.com/seller

my config.xml is

<?xml version="1.0" encoding="UTF-8" ?>
<config>

    <modules>
        <Webcreon_Seller>
            <version>0.0.1</version>
        </Webcreon_Seller>
    </modules>

    <frontend>
        <routers>
            <seller>
                <use>standard</use>
                <args>
                    <module>Webcreon_Seller</module>
                    <frontName>seller</frontName>
                </args>
            </seller>
        </routers>
     <layout>
            <updates>
                <seller>
                      <file>sellerform.xml</file>
                </seller>
            </updates>
       </layout>
    </frontend>
    <admin>
     <routers>
         <seller>
            <use>admin</use>
            <args>
               <module>Webcreon_Seller</module>
               <frontName>adminseller</frontName>
            </args>
         </seller>
      </routers>
 </admin>
 <adminhtml>
   <layout>
      <updates>
          <seller>
              <file>sellerform.xml</file>
           </seller>
      </updates>
   </layout>
   <menu>
      <customer translate="title" module="adminhtml">

         <sort_order>10</sort_order>
         <children>
             <set_time>
                   <title>Seller List</title>
                   <action>adminseller/adminhtml_index</action>
              </set_time>
          </children>
       </customer>
    </menu>
</adminhtml>

    <global>
        <blocks>
            <seller>
                <class>Webcreon_Seller_Block</class>
            </seller>
         </blocks>
         <helpers>
            <seller>
                <class>Webcreon_Seller_Helper</class>
            </seller>
        </helpers>
              <models>
          <seller>
                <class>Webcreon_Seller_Model</class>
                 <resourceModel>seller_mysql4</resourceModel>
            </seller>
            <seller_mysql4>
             <class>Webcreon_Seller_Model_Mysql4</class>
             <entities>
                 <seller>

db_vendor

                 </seller>
              </entities>
          </seller_mysql4>
        </models>
        <resources>

        <seller_write>
            <connection>
                <use>core_write</use>
            </connection>
        </seller_write>

       <seller_read>
          <connection>
             <use>core_read</use>
          </connection>
       </seller_read>
</resources>
    </global>

</config>


texts: How to add particular product into cart programmatically at admin side

texts:
Many a times you have heard or seen about how to add particular product into shopping cart programmatically at frontend side. But I want to do the same at admin side.

Suppose, I have product 'SLR Camera Tripod'and I have one button say PayNow in my admin area.

I also have pre-defined customer so there is no need to attempt other beginning steps of admin side order creation process.

When I click on this PayNow button Product 'SLR Camera Tripod' should be added into cart automatically and I should directly redirect on order placement page at admin side.

Is there any snippet available for this? Hope you understood my concern and can guide me well.


texts: magento 2 development environment operating system

texts:
I am using Window OS for magento 2 development. Is it better to switch to ubuntu? Is development fast in unbuntu?

Thanks


texts: How can i add icon before shipping method name in magento2?

texts:
I want to add Image before Shipping method name in Checkout page.I have checked in shipping.html but here all data coming from js.I can't find proper way for it. Right now i want to add icon for "Flat Rate" shipping method.

Thanks


texts: Getting Allowed memory size error on sample data deployment magento2

texts:
I am Trying to install sample data on xampp server using below command
php bin/magento sampledata:deploy
And i am getting error like this

  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 40 bytes) in C:\xampp\htdocs\magento v2.0\vendor\composer\composer\src\Composer\ Json\Json File.php on line 259

can any one help me?


texts: What's the difference between flush the cache from admin panel and through command?

texts:
I have seen that we can flush the Magento cache via admin panel System> Cache Management and as well as by running the below command

php bin/magento cache:flush

I would like to know what's the difference between them?

Is both are working the same?

Could anyone please help me to understand it?


texts:
I added sku, country_code and product name in the order grid. All works fine but when I filter Orders by Created at it throws following error

  Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous, query was: SELECT COUNT(DISTINCT soa.parent_id) FROM sales_order_grid AS main_table
   INNER JOIN sales_order_item AS soi ON main_table.entity_id = soi.order_id
   INNER JOIN sales_order_address AS soa ON main_table.entity_id = soa.parent_id WHERE (created_at >= '2017-07-31 23:00:00') AND (created_at <= '2017-08-25 22:59:59')

My code looks like this

di.xml

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <plugin name="sales_order_additional_columns" type="Vendor\Sales\Plugin\AddColumnsSalesOrderGridCollection" />
</type>

view/adminhtml/ui-component/sales_order_grid.xml

<column name="sku">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Sku</item>
                <item name="filter" xsi:type="string">text</item>
                <item name="visible" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="name">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Product Name</item>
                <item name="filter" xsi:type="string">text</item>
                <item name="visible" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>

and
AddColumnsSalesOrderGridCollection.php

public function aroundGetReport(
    \Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory $subject,
    \Closure $proceed,
    $requestName
) {
    $result = $proceed($requestName);
    if ($requestName == 'sales_order_grid_data_source') {
        if ($result instanceof $collection) {
            $collection->getSelect()->join(
                ["soi" => "sales_order_item"],
                'main_table.entity_id = soi.order_id',
                ['sku' => 'GROUP_CONCAT(DISTINCT soi.sku)',
                 'name' => 'GROUP_CONCAT(DISTINCT soi.name)'
                ]
            )->join(
                ["soa" => "sales_order_address"],
                'main_table.entity_id = soa.parent_id',
                ['country_id' => 'soa.country_id']
            )->group("soa.parent_id");
        }
        return $collection;
    }

}


texts: Magento 2.3 Static Content Deployment problem & missing css file

texts:
Running Magento 2.3 i noticed a problem with the static content being deployed, well, I believe it to be that anyway.

I was messing around with Varnish for a few days and had a nightmare getting it installed and running on the server, i decided that i should handle that problem another time so uninstalled it from the server but i am not sure if it has caused this reported problem.

I am using a 3rd party theme and naturally edited the themes css and files over time, when switching from developer mode to production the css breaks, in chrome console it would intermittently show that a custom.css is missing and now (today) the css and js being loaded have a strange URL, examples:

https://www.website.co.uk/pub/static/frontend/Codazon/fastest_hightech/en_GB/css/A.styles-m.css.pagespeed.cf.dZmez_UxRq.css

https://www.website.co.uk/pub/static/frontend/Codazon/fastest_hightech/en_GB/css/A.custom.css.pagespeed.cf.RRyT-2TOAp.css

I have tried the following:

Clearing cache and flush
bin/magento setup:static-content:deploy for different locals so en-GB en-US (i am using GB)
bin/magento setup:upgrade
setup:di:compile
copied a new .htaccess file into pub/static
checked mod_rewrite is on
httpd.confg file seems to be ok
removed everything from var/cache, var/page_cache, generated/code etc
export HTTPS=on and export HTTPS=off

I really need assistance on this urgently.

Update:
Tried reloading the site with: https://www.website.co.uk/?ModPagespeed=off which loaded the files without the Pagespeed rewrites, css is not loading still.

Switching back to developer mode brings the site back perfectly, obviously i cannot leave it on that mode but what is happening on switching?


texts:
I am trying to display the description for each product in the slide down panel. I am using a slider to display product images where I have a on hover buttons first one adds the product to basket and the second one triggers the slide down panel. It displays random products description not the one I click on.

 <?php  $categoryId = 4; // this is the category holding your products
 $category = Mage::getModel('catalog/category')->load($categoryId);
 $products = Mage::getModel('catalog/product')
   ->getCollection()
   ->addCategoryFilter($category);
 $products->addAttributeToSelect(array(
                              'image',
                              'name',
                              'description',
                             'short_description',
     'sku',
     'asin'
              ))
              ->addFieldToFilter('visibility', array(
                             Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                          Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
              ));

 //$products->load();
 foreach ($products as $product)  {
 ?>

 <img  class="lazyOwl" src="<?php echo $localHelper->getImageUrl($product); ?>" alt="img" />
<button type="button" title="<?php echo $this->__() ?>"
 class="addp" onclick="setLocation
 ('<?php echo Mage::helper('checkout/cart')->getAddUrl($product) ?>')">
 <?php echo $this->__() ?></button>
   <button type="button" class="info" data-target='t1'>
   <?php

  $description = $product->getDescription();

  ?>
  </button>

 <?php
  }
 ?>

 <?php echo $description; ?>

I would like to get Description for each products I click on no the same one for all of them.


texts: Magento2 ui_component - form - image file input field

texts:
I'm currently trying to dig deeper into the UI Components but I'am kinda stuck here.

Since it would be a little much to post all code here, I'll just post some relevant github links.

What works is uploading an image and save the file name to the database.

What does not work is loading the file in the file input on the edit form page again.

The image input is defined here: https://github.com/davidverholen/magento2-teaser/blob/develop/view/adminhtml/ui_component/teaser_item_form.xml#L83

The class is currently empty, I tried many things today but nothing seemed too promising and I'm not even sure if i need it:  https://github.com/davidverholen/magento2-teaser/blob/develop/Ui/Component/Form/Element/TeaserItemImage.php

The DataSource for the form is here: https://github.com/davidverholen/magento2-teaser/blob/develop/Model/TeaserItem/DataProvider.php

(also tried to load the image_url here and use this as the field index)

there is also a doc for this and I may be too js stupid to understand how to do this:
http://devdocs.magento.com/guides/v2.0/ui-components/ui-form.html

Any Ideas or anyone who has already done this?

Thx in advance!

Update:

I found this in the media component (which is used for images):
vendor/magento/module-ui/view/base/web/js/form/element/media.js

return Abstract.extend({
        defaults: {
            links: {
                value: ''
            }
        },

I'm new to the whole knockout.js thing, but this seems like the value binding is removed. So there must be another way to set the value?

I also tried to set the binding again in the configuration but without success. Tried this (added the image_path_abs to the datasource which contains the absolute file path):

<field name="image_path" class="DavidVerholen\Teaser\Ui\Component\Form\Element\TeaserItemImage">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="links" xsi:type="array">
                <item name="value" xsi:type="string">teaser_item_form.teaser_item_form_data_source.general.image_path_abs</item>
            </item>
            <item name="label" xsi:type="string">Image</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="formElement" xsi:type="string">image</item>
            <item name="source" xsi:type="string">general</item>
        </item>
    </argument>
</field>


texts: Delete Phone Number validation, Error in Forms

texts:
I want to remove phone validation from this form below, it's not accepting any phone number, the file is smiple_contact.phtml but I am not sure what code to delete. Thanks.

http://www.b2zee.com/b2c/index.php/b2zee-tourism


texts: Missing product ID: Magento tries to add an ID that it has jumped before

texts:
I have to mass import all products of a given website by script using models. My client has made some errors while building the configurables in his ERP and we had to flush all the products using this query:

DELETE FROM `catalog_product_entity` WHERE `catalog_product_entity`.`entity_id` IN (SELECT `catalog_product_website`.`product_id` from `catalog_product_website` WHERE `website_id` = 1);

The we restarted the import task. While runnning the script (max 500 products every 30 minutes, indexation disabled), most of the products are imported nicely but we get many Integrity constraint violation errors like this one:

Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '18433-150' for key 'UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_ID', query was: INSERT INTO `catalog_product_super_attribute` (`product_id`, `attribute_id`, `position`) VALUES (?, ?, ?)

I can see by the given product_id that it is a new product but when I look in the table catalog_product_super_attribute, I don't see this product_id. This ID is not listed in the admin either. We will fix the product creation but where is the missing ID? I see 18431, 18432, and then 18434! That happened quite a few times, but not on every configurable creation.

It's as if Magento has prepared itself to save a new configurable, failed to do so, rolled back, discarded the ID but a reference to this ID lies somewhere.

Have you seen such a behavior? Is there a way to prevent this?


texts:
I'm creating an extension that exposes an API to another web site. My extension will create an API key, and then you'll copy this API key into the other web site, which will let Magento and the other site exchange data.

I've created a system.xml entry for my API key. I'd like for the default value for this config item to be populated by a call to a generateApiKey method defined in PHP code.

In pseudocode, config.xml:

<config>
    <default>
       <my_extension>
            <api_connection>
                <apikey><?php echo $obj->generateApiKey(); ?></apikey>
            </api_connection>
        </my_extension>
    </default>
</config>

I know that that's not possible, but hopefully that conveys what I want to do.

How can I programmatically generate (and save) a default value for something defined in system.xml?


texts:
I still haven't figured how Magento 2 structures the knockout js part.

For example how does the process work (step by step) of fetching the cart summary number.
You can find this in app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml:

The question is how I would find all the code js, php (,html) that is in use to get the summary_count number.

I found a minicart.js but summary_count is nowhere to be seen there. I suspect this is some kind of identifier that is given to a function getCartParam. But I can not find getCartParam too.

Another example would be the onepage checkout for example:
I can find all the templates for the appropriate steps like shipping.html or payment.html. But how do they come together?
Where are they loaded and what defines ie. the order?

I not only seek to find the exact information on these two cases but be generally able to find this information myself. Thus I think to understand how the process works generally would be helpful.

Some enlightenment would be great here!


texts:
I'm using an index.php file under /pub/custom folder, which is used to create custom designs.
This file is completely written in html and javascript.

Is there any way to include current theme header and footer to this file?

For eg: https://example.com/custom/ should include the header and footer from https://example.com

There are so many answers for Magento 1, but I couldn't find anything for Magento 2.
I'm using version 2.1.15. and Porto theme.

Any help would be appreciated! Thanks.


texts: Overriding Custom module's controller in Magento2 giving error

texts:
I am trying to override the controller of an extension in Magento2.

My di.xml file is:-

<?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="Mycustom\Custom\Controller\Adminhtml\Controllerfolder\Fileaction" type="ActualModule\Custom\Controller\Adminhtml\Controllerfolder\Fileaction"/>

</config>

I have cloned the controller file with updated namespaces, and extend the controller to module's file like:-

<?php

namespace Mycustom\Custom\Controller\Adminhtml\Controllerfolder;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;

use ActualModule\Custom\Model\OrderFactory;

class Fileaction extends \ActualModule\Custom\Controller\Adminhtml\Controllerfolder\Fileaction
{
    /**
     * @var OrderFactory
     */
    protected $_modelOrderFactory;

    public function __construct(Context $context, Filter $filter, CollectionFactory $collectionFactory,
        OrderFactory $modelOrderFactory)
    {
        parent::__construct($context, $filter);
        $this->collectionFactory = $collectionFactory;
        $this->_modelOrderFactory = $modelOrderFactory;
    }
    protected  function massAction(AbstractCollection $collection)
{

    die('here');
 }

It should be functional but the issue I get on php bin/magento s:d:c is as follow:-

Errors during compilation:

    ActualModule\Custom\Controller\Adminhtml\Controllerfolder\Fileaction
                Missed required argument collectionFactory in parent::__construc
t call. File: C:/wamp64/www/magento/app/code/Mycustom\Custom\Controller\Adminhtml\Controllerfolder/Fileaction.php
Total Errors Count: 1
Errors during compilation:

I feel like I missed something but not able to catch what.

Just to add var/generation, di etc.. clearing has been done, cache flushed.


texts: Magento 2 : Add custom block in ui form field

texts:
I want to call custom block to call my custom .phtml in ui-form field.

How to do that?

My form field :

<field name="title">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">Title</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="source" xsi:type="string">title</item>
            <item name="dataScope" xsi:type="string">title</item>
        </item>
    </argument>
</field>

I want to add this as html code (Go to stores -> Attributes -> Product -> Edit attribute -> Manage Labels):

Any help would be appreciated.


texts: Cant upload images in magento 1.8.1.0 after applying security patches

texts:
I Cant upload images in Magento 1.8.1.0 after applying security patches. If I create new product and after entering the product details I go to images tab, I upload image after it stuck at uploading and shows an error message:

  Fatal error: Class 'Varien_File_Uploader' not found in
  /chroot/mysite.com/html/releases/3/trunk/app/code/core/Mage/Core/Model/File/Uploader.php
  on line 36


texts: I installed my them, where is it on my menu?

texts: I installed fullpack theme, and i haven't got monster ico, where is it on my left menu?


texts: Get value row data from 'magento_giftcard_amount' table

texts: I am getting 'row_id', I need to get 'value' from 'magento_giftcard_amount' table.


texts:
I managed to format the price without decimals modifyng the following files:

LINE 38 vendor/magento/module-catalog/view/base/web/js/price-utils.js
LINE 19 vendor/magento/framework/Pricing/PriceCurrencyInterface.php

Does somebody knows where are those files?
Example of a thousand 1.000


texts: Magento 2 Search not finding SKU with special chars in it

texts:
if we search for an sku string with hashtag (e.g. "QW49ES#ABD") search results page shows me many many results (i guess all results with hashtag in it).

If i only search for the sku part "QW49ES" i receive the correct single result.

Any ideas how to fix this?

Thanks,
hamipl


texts:
I am newbie to magento.

I am developing e-commerce portal in Magento 2.1.4.

I have to implement template now. Do i need to purchase only 2.1.4 template only or magento 2.x and 2.1.x template are also compatible with magento 2.1.4?

Any best resource for purchasing template online.


texts: How to manipulate special price-- only for frontend in Magento 2

texts:
I want to change the special price when it get displayed on the frontend.
so, if the special price is $25 then I want it to show $(100+25). How can I achieve this. I created a plugin which update the afterGetPrice() (works for regular price only).
Is there any way to change the special Price/tier price on the frontend only. (It must checkout with the updated price-- $125)
my 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">
     <type name="Magento\Catalog\Model\Product">
       <plugin name="change_product" type="vendor\module\Plugin\Model\Product" sortOrder="1" />
     </type>
 </config>

and Plugin/Model/Product.php
<?php

namespace vendor\module\Plugin\Model;

class Product
  {

     public function afterGetPrice(\Magento\Catalog\Model\Product $subject, $result)
     {

       return $result * 2.25;
      }
   }

which display the product with the wanted price but this piece of code does not work if product has special price..I want to do the same for all price types.


texts: Decoding failed: syntax error after save

texts:
I'm experiencing Decoding Failed error on saving few downloadable product (not all) from magento 1.x backend

exception 'Zend_Json_Exception' with message 'Decoding failed: Syntax error' in xxx/lib/Zend/Json.php:97
Stack trace:
#0 xxx/app/code/core/Mage/Core/Helper/Data.php(659): Zend_Json::decode('[object Object]', 1)
#1 xxx/app/code/core/Mage/Downloadable/Model/Product/Type.php(219): Mage_Core_Helper_Data->jsonDecode('[object Object]')
#2 xxx/app/code/core/Mage/Catalog/Model/Product.php(541): Mage_Downloadable_Model_Product_Type->save(Object(Mage_Catalog_Model_Product))
#3 xxx/app/code/core/Mage/Core/Model/Abstract.php(319): Mage_Catalog_Model_Product->_afterSave()
#4 xxx/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(728): Mage_Core_Model_Abstract->save()
#5 xxx/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->saveAction()
#6 xxx/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('save')
#7 xxx/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 xxx/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 xxx/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 xxx/index.php(87): Mage::run('', 'store')
#11 {main}

I really don't know what could be the cause of this issue.
Thanks everyone


texts: How to find which extension is adding a specific  to

texts:
I'm having some extension adding in a script element to the head with a broken URL that keeps on 504'ing. This is occurring on a test server where I don't have full FTP permissions so editing files under app/etc/modules is out of the question. I've tried going through each extension under configuration > advanced > advanced, but still am not able to find the culprit. The script URL is just "domain.com/skin/frontend/[theme]/enterprise" as shown in this screen cap:

If I go under configuration > general > design > themes and set 'Default' to blank (currently set to enterprise), the script link url changes to "domain.com/skin/frontend/[theme-name]/default".

I've tried to grep in the layout directory for 'addJS' and 'addItem', but couldn't find anything helpful..

Is there some code I can add somewhere that adds comments or something that shows which module is loading in the scripts into the head?


texts:
I'm trying to make a WebService, getting in argument shoppingCartId and storeId, to return all shipping method available. I'm also using the Owebia shipping extension.

But my problem is here, I have able 5 shipping methos (flatrate, free, owebia 1/2/3), but I only get the flat and free when I use cart_shipping.list like it :
$resultShippingMethods=$proxy>call($sessionId,"cart_shipping.list",array($shoppingCartId));

So my question is, how can I get magento's default shipping method and also Owebia methods ?


texts:
How do you create comments for fields in a ui_component form?

I can do it like this when building the form with php:

$fieldset->addField(
            'url',
            'text',
            [
                'name' => 'url',
                'label' => __('URL'),
                'title' => __('URL'),
                'required' => false,
                'note' => 'Can be an absolute or relative path.'
            ]
        );

I can't find how to achieve this in an xml form component.


texts: sort filter do not show null or blank value for filter

texts:
i add custom sort filter to product say discount , when i sort this filter by desc order it show products with no discount, i want to add extra condition here to not show product with discount i sort by discount is done how can it be done please guide way .

i checked product listing file and found some function getLoadedProductCollection()

, can we do stuff there to fix it.

config.xml

  <core_collection_abstract_load_before> <!-- identifier of the event we want to catch -->
    <observers>
      <core_collection_abstract_load_before_handler> <!-- identifier of the event handler -->
        <type>model</type> <!-- class method call type; valid are model, object and singleton -->
        <class>sortit/observer</class> <!-- observers class alias -->
        <method>sortit</method>  <!-- observer's method to be called -->
        <args></args> <!-- additional arguments passed to observer -->
      </core_collection_abstract_load_before_handler>
    </observers>
  </core_collection_abstract_load_before>

Observer.php

    class MY_Sortit_Model_Observer  extends Mage_Core_Model_Mysql4_Collection_Abstract
   {

            public function sortit(Varien_Event_Observer $observer)
            {
                $collection = $observer->getCollection()->addAttributeToSort('name', 'ASC');
                $attribute = 'offers';
                $dir       = 'ASC'; //try both ASC and DESC
                $column    = "at_{$attribute}.value";
                $collection->getSelect()->order(new Zend_Db_Expr("ISNULL({$column})"));
                $collection->getSelect()->order(new Zend_Db_Expr("{$column} {$dir}"));

                return $collection;
            }

}

shows error :  Call to a member function getReadConnection() on a non-object


texts: What is the best way to extend a Magento model behaviour?

texts: If I wanted to change the function getPrice for instance? [Edit] Lets suppose that I wanted to change the way that the price is calculated. e.g.: if the customer is from a certain state, the price should be multiplied by 1.12.


texts:
I want to make 2 parent categories and attach to them same sub category
example:

category name:"gift" --> subcategory name:"photo gift"
category name:"gift for dad" -->  subcategory name:"photo gift"

Same sub category in 2 different parent categories.

Can it be done in Magento?


texts: Estimate Shipping section is not retained after Update Basket

texts:
I upgrade my Magento store from 2.1.7 to 2.2.5 and I faced an issue on cart page.

When adding a product to cart and go to /checkout/cart/, In shipping summary section update the shipping country, postcode and state

and click on Update Shopping Basket then address is not retained to and comes in default country .

Can someone help me to get out of this?


texts:
https://theidleman.com/brands/carhartt-1.html
has been generated in addition to our old https://theidleman.com/brands/carhartt.html URL - how can I delete the '-1' and redirect it if the '-1' does not show in Catergories?

Thank you,

TIM


texts: How to check which modules are affected by security patch SUPEE-6788

texts:
On October 27, 2015, Magento has released security patch SUPEE-6788. According to the technical details, 4 APPSEC's that have been fixed require some rework in local and community modules:

APPSEC-1034, addressing bypassing custom admin URL (disabled by default)
APPSEC-1063, addressing possible SQL injection
APPSEC-1057, template processing method allows access to private information
APPSEC-1079, addressing potential exploit with custom option file type

I was wondering how to check which modules are affected by this security patch.

I came up with the following partial solution:

APPSEC-1034: search for <use>admin</use> in the config.xml of all local and community modules. I think this should list all modules affected by this issue.
APPSEC-1063: search for addFieldToFilter('( and addFieldToFilter('` in all PHP files of local and community modules. This is incomplete, as variables can also be used.
APPSEC-1057: search for {{config path= and {{block type= in all PHP files of local and community modules, and filter out all elements from the whitelist. This is incomplete, as it does not contain any template variables added by admins, however.
APPSEC-1079: no idea.

There is also a list of extensions that are vulnerable for APPSEC-1034 and APPSEC-1063 compiled by Peter Jaap Blaakmeer


texts:
I am having issues with the checkout section in Magento 2. I have version 2.1.3 installed in the community version. I bought an extension and the checkout has not been working properly. The developer of the extension has been trying to work on it but also mentioned that even with the default magento chic the same problem is present. I have included the screen shot of the issue and also the url of the site.

No one has been able to help me with this issue.

https://www.freezerworkwear.com/development/

Thanks,
Fred


texts: Magento 2 - How to detect if a script is in the pub directory

texts:
I'm making my software compatible with Magento 2. I need to update a PHP file (bundled with the software) that is required to communicate with Magento.

I've read that the root folder can be either the Magento installation root folder or the pub folder.

If it's in the root folder, we must write:

require __DIR__ . '/app/bootstrap.php';

If it's in the pub folder, we must write:

require realpath(__DIR__) . '/../app/bootstrap.php';

Is there a reliable and elegant way to include bootstrap.php if the script file is in the root folder or the pub folder ?

The code should work in both cases.


texts: sales_order table - increment_id doesn't match entity_id

texts:
I'm unsure whether they should match or not, I haven't been able to find a definitive answer yet.

The start of sales_order table looks fine:

But suddenly the increment_id column stopped matching the entity_id column:

The invoice IDs still match, sales_invoice table:

But maybe that's because we only have 103 invoices, whereas we have 270 orders. The IDs in the order table started to get out of sync at order 173.

Any help is greatly appreciated. We have multiple third party integrations, some of them use entity_id and some increment_id, so it gets very confusing.


texts: Magento 2 Elasticsearch security problem

texts:
When i in /etc/elasticsearch/elasticsearch.yml setting this code:
xpack.security.enabled: true
xpack.license.self_generated.type: basic

and already set user and password , it can on Browser loading http://xx.xx.xx.xx:9200 and then success enter user and password.
But i go back to magento backend to set back the info, it was showing No alive nodes found in your cluster setup , where i getting wrong?
Thank you


texts: what is magento 2 equivalent of version setup files

texts:
In magento 1 it was possible to create different version set up scripts i.e

install-1.0.0.php
upgrade-1.0.0-1.0.1.php
upgrade-1.0.1-1.0.3.php

However in magento 2 there is only one script within a module for

Setup/UpgradeData

I now want to run a second version of the UpgradeData script to add to the previous Upgrade data


texts: Default url for all product listings in magento 2

texts: How to access the root category url or in other words default url for all product listing in magento 2?


texts: How use renderer in XXX_PAGE_FORM.XML magento2,

texts:
string
                    entity
                    Image
                    1
                    true
                    fileUploader
                    ui/form/element/uploader/uploader
                    CNAME_MNAME/image-preview
                    false

How use Renderer it give error, Where i am wrong?


texts:
I need to update one cms page, but I have the same identifier 'home' for three pages in different stores.
How can I update one page with need store.

My script has error: 'A page URL key for specified store already exists.';

Mage::app();
$cmsPage = Mage::getModel('cms/page')->setStore('need store')->load('home', 'identifier');
    try {
        $cmsPage->setRootTemplate('one_column');
    } catch (Exception $ex) {
        echo $ex->getMessage();
      }
$cmsPage->save();
Mage::app()->cleanCache();


texts:
$jsonResult = json_decode($result, true);

        $jsonResult['skus'] = [];
        foreach ($subject->getAllowProducts() as $simpleProduct) {
               $jsonResult['skus'][$simpleProduct->getId()] = $simpleProduct->getSku();
        }

I am getting value of text attribute now I want to get the values of those attribute which is drop down


texts: Setting store to admin results in empty collection

texts:
I'm writing a frontend editor that requires changing the 'All Store Views' attributes for products. (As well as being able to change per store).

I can flick between frontend stores without problem and it shows the correct values, but if I set it to the admin store, then the collection (which contains products for any other store) is suddenly empty.

This is the code I am using:

    $filters = $this->getRequest()->getParams();

    if ($this->getRequest()->getParam('store')){
        Mage::app()->setCurrentStore($this->getRequest()->getParam('store'));
    }else{
        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
        Mage::register('isSecureArea', true);
    }

    $products = Mage::getModel('catalog/product')->getCollection()
                ->addAttributeToSelect('*')
                ->addCategoryIds()
                ->addUrlRewrite()
                ->addMinimalPrice()
                ->addFinalPrice()
                ->addTaxPercents();

    $products->load();

Using the above, if I pass it a store of 1 or 2, then it works and the products are available in the collection. If I don't pass a store, (which should automatically set it to the admin store), or I pass it a store of 0, then the collection is empty

Can anyone advise on why this is, and what I can do to get the 'default' values for editing?

Thanks!


texts: How to turn Magento 2 Maintenance Mode ON or OFF?

texts: I am not able to set Maintenance Mode in 2.0 version. Can someone tell me the steps that how to manage maintenance mode with magento 2.0?


texts:
we need an option in backend > attributes to set "timeout" for each product.

we want to display the timeout in view page.

something as below :

after the timeout ends, automaticlly Product status should become "Disable" in Backend.


texts: Custom Source Model Attribute's Label is Indexed Incorrectly

texts:
I have an int/select attribute with a custom source model. Most things (admin, attribute save/load, indexing option IDs, filtering in layered nav, etc.) work fine. One of the things that's not working is the option texts (column my_attribute_value that's indexed in catalog_product_flat.

While the option IDs are correctly indexed, the label is pulled from the eav_attribute_option_value table, instead of my custom source table.

My custom source class extends Mage_Eav_Model_Entity_Attribute_Source_Table and I've rewritten the relevant methods to work with my custom source for option IDs and labels. I've having trouble locating the methods responsible for writing data to the flat tables.

Any ideas?

Update:

I'm having this problem because my custom-source option IDs don't have the correct labels indexed in eav_attribute_option_value.value. Instead of the labels from the custom table, it's getting the labels from the regular EAV tables at the time of indexing the attributes. I've actually had this issue before, and it required rewriting the attribute indexing process.


texts: Hide price from form of add product in BO Magento 2

texts:
I want to create all my configurable product without any price and I don't want to see the price information on the whole website.
How to proceed step by step, please?

Thanks in advance


texts: How to return Associative Array from API in Magento 2

texts:
I have created Custom Api which returns associativeArray.

If I use associativeArray it's giving error
If I use string[] it's working

But I want to return associativeArray.

  Error: Class "array" does not exist. Please note that namespace must
  be specified

Example Methods:

 /**
     * Create multi Customers
     *
     * @param \Magento\Customer\Api\Data\CustomerInterface $customer
     * @return string[]
     */
    public function save(\Magento\Customer\Api\Data\CustomerInterface $customer);

save method working fine.

 /**
     * Create multi Customers
     *
     * @param \Magento\Customer\Api\Data\CustomerInterface $customer
     * @return array()|associativeArray()
     */
    public function save1(\Magento\Customer\Api\Data\CustomerInterface $customer);

save1 method returning error.

  Error: Class "array()" does not exist. Please note that namespace must
  be specified

So how can I return associativeArray?

Thanks in advance.


texts: Is impossible to remove(not delete) an attribute from attribute set programmatically?

texts:
Has anyone tried to remove(not delete) unnecessary attributes from the Magento default set?
By default, Magento create an attribute set called "default" and it has a lot of unnecessary attributes. But we can not remove an attribute from the set if it is a system attribute.

I can retrieve all attribute in set by:

\Magento\Eav\Model\AttributeManagement::getAttributes($entityType, $attributeSetId)

after that, I don't have any ideal to check if it is a system attribute. Please help.


texts: Add customer attribute to shopping cart rule condition

texts: How complicated will it be to add a customer attribute in shopping cart rule condition in action section just like it shows product attribute list which are set as yes for using in promotional rule condition, Any ideas to start with will be much appreciated!


texts: How to disable catalog image scrolling in details page magento 2.3

texts:
Actually in my case for details page base images scrolling is
  available with mouse.we can scroll it but by looking wise it wont show
  slider is available there.

  so i want to disable image scrolling which is coming using mouse hand
  symbol if we over on image.


texts: Magento2 : How can use ajax in custom module html file

texts:
I have added a template file .html on checkout page in order summary below Totals, In this file I want to add ajax to call my custom module controller and load some content on page.

How can I achieve this?


texts: Magento 2: How to display custom attribute in product page?

texts: How can i display an attribute under the title in magento 2.2.5


texts: Magento 2: Server side validation not showing filled up data while error [SOLVED]

texts:
I have below code

app\code\Custom\Module\Controller\MyModule\PostForm.php

namespace Custom\Module\Controller\MyModule;

use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\Filesystem\DirectoryList;

class PostForm extends \Magento\Framework\App\Action\Action {

    /**
     * @var DataPersistorInterface
     */
    private $dataPersistor;

    /** @var  \Magento\Framework\View\Result\Page */
    protected $resultPageFactory;

    /**
     * @var \Magento\Framework\Translate\Inline\StateInterface
     */
    protected $inlineTranslation;

    /**
     * @var \Magento\Framework\Data\Form\FormKey\Validator
     */
    protected $_formKeyValidator;

    /**     * @param \Magento\Framework\App\Action\Context $context      */
    public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator, \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation) {
        $this->resultPageFactory = $resultPageFactory;
        $this->_formKeyValidator = $formKeyValidator;
        $this->inlineTranslation = $inlineTranslation;
        parent::__construct($context);
    }

    /**
     * Post user post
     *
     * @return void
     * @throws \Exception
     */
    public function execute() {

        $resultPage = $this->resultPageFactory->create();
        $resultRedirect = $this->resultRedirectFactory->create();

        $post = $this->getRequest()->getPostValue();

        if (!$post) {
            $this->_redirect('*/*/');
            return;
        }

        if (!$this->_formKeyValidator->validate($this->getRequest())) {
            return $resultRedirect->setPath('*/*/');
        }

        $this->inlineTranslation->suspend();

        $postObject = new \Magento\Framework\DataObject();
        $postObject->setData($post);

        $error = false;
        $errors = [];
        if (!\Zend_Validate::is(trim($post['title']), 'NotEmpty')) {
            $errors[] = __('Please enter title.');
            $error = true;
        }
        if (!\Zend_Validate::is(trim($post['description']), 'NotEmpty')) {
            $errors[] = __('Please enter description.');
            $error = true;
        }

        if ($error) {
            foreach ($errors as $error) {
                $this->messageManager->addErrorMessage($error);
            }
            $this->getDataPersistor()->set('mymodule_post', $post);
            return $resultRedirect->setPath('module/mymodule/new/');
        }
    }

       /**
     * Get Data Persistor
     *
     * @return DataPersistorInterface
     */
    public function getDataPersistor() {
        if ($this->dataPersistor === null) {
            $this->dataPersistor = ObjectManager::getInstance()
                    ->get(DataPersistorInterface::class);
        }

        return $this->dataPersistor;
    }
}

What is purpose of dataPersistor & when i got error my data are not filled up in Form.  I have filled up Title, but Description is blank.
So when error message display, it should display my filled up Title.