texts: Build Magento module from the command line

texts:
looking at the output of mage shell script it seems that it is possible to build a module via the command line. Does anyone have and idea how i can do it?

Connect commands available:
===========================
.....

package              Build Package
package-dependencies Show package dependencies
package-prepare      Show installation information of package

......

Thanks in advance.


texts: Magento - Get Products from Specific Category

texts:
I am currently using the following code to display four products in a random order. It works, but I'd like to limit the results to a particular category or an array of categories. How would I go about implementing this change?

Thanks!

<?php $products = Mage::getModel('catalog/product')->getCollection();
  $products->addAttributeToSelect(array('name', 'thumbnail', 'price')); //feel free to add any other attribues you need.
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
  Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
  $products->getSelect()->order('RAND()');
  $products->getSelect()->limit(4);
  foreach ($products as $product)  : ?>

<a href="<?php echo $product->getProductUrl()?>"><?php echo $product->getName()?>

        <a href="<?php echo $product->getProductUrl()?>"><img class="thumbnail" src="<?php echo Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(93, 100)?>" alt=" ">

$199.99

          Free Shipping Free Stove

<a href="<?php echo Mage::helper('checkout/cart')->getAddUrl($product); ?>">ADD TO CART

<?php endforeach; ?>


texts: Authorize.net Direct Post Sometimes Fails in Chrome

texts:
We are finally in the middle of launching authorize.net DPM as a payment method in magento and are having some strange issues.

Basically in some rare, unpredictable (to me) circumstances the customers browser fails to communicate with authorize.net and the order gets stuck in the ‘payment pending’ status.  No record of the attempt shows up in the authorize.net control panel and (according to chrome://net-internals and fiddler) the browser doesn't even attempt to communicate with authnet.  There are no errors in the javascript console, or any of the Magento logs.

The customer is just dumped back on the checkout page after hitting the order button.

It doesn't happen with every order.  And we can see that when it does happen, the customers usually try to hit the submit button several minutes later and the order goes through fine.

As far as we can tell, this only happens in chrome 34.

Have you seen anything like this happen before?  Any tips on where to start looking?


texts:
I know there are bunch of articles for this, but it actually does not work for this client.
Specifically now I need 2 websites to run

http://BASE_DOMAIN/store
http://BASE_DOMAIN/wholesale

Here is my setup:

.htaccess

...

SetEnv MAGE_RUN_TYPE website
SetEnv MAGE_RUN_CODE base

SetEnvIf Host .*wholesale.* MAGE_RUN_CODE=wholesale
SetEnvIf Request_URI "(wholesale)" MAGE_RUN_CODE=wholesale

...

<IfModule mod_rewrite.c>

...

RewriteCond %{HTTP_HOST} .*wholesale\.* [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:wholesale]
RewriteCond %{REQUEST_URI} ^/wholesale
RewriteRule .* - [E=MAGE_RUN_CODE:wholesale]

RewriteCond %{ENV:REDIRECT_MAGE_RUN_CODE} (.+)
RewriteRule .* - [E=MAGE_RUN_CODE:%1]

...

No modifications to index.php (update: I won't do any changes to index.php file as it's not needed, the file itself may be overwritten by one of updates from Magento Core team and actually it won't help)
Directory structure on doc root:

root@xxx [/home/devserver/public_html]# ls -la
drwxr-x---  9 devserver nobody      4096 Dec  8 09:25 ./
drwxr-xr-x 14 devserver devserver   4096 Nov 26 23:07 ../
...
drwxr-xr-x 14 devserver devserver   4096 Nov 22 03:25 store/
lrwxrwxrwx  1 devserver devserver     25 Nov 26 23:10 wholesale -> /home/devserver/www/store/
...

Backend settings are:

Whenever I open the homepage the content is shown, but the secure pages like:
https://DOMAIN_NAME/wholesale/customer/account/login/ leads to 404

After investigation I found that MAGE_RUN_CODE and MAGE_RUN_TYPE are good, but there is a problem in getting the controller  app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:121), basically the method setBaseUrl is getting $_SERVER['SCRIPT_NAME'] and generates Base Url out of it, which is "/store/" for both symbolyc link and base directory our of doc root.

Is there something wrong with my setup or should I go this way https://stackoverflow.com/questions/9199854/how-do-i-override-mage-core-controller-request-http?

UPDATE:

A separate directory which stores the same data helps. Is there a way to say apache to overwrite SCRIPT_NAME for specific website/store/storeview ?


texts: Getting "oauth_problem=Consumer+key+has+expired" Error in Magento 2 Auth 1.0

texts:
I am getting "oauth_problem=Consumer+key+has+expired" auth 1.0 in Magento2.

Please see below screenshot:

Anyone solved this, please help!


texts:
I have a store with 3 languages (fr, nl, uk).
When I create or edit a product I have to switch from store view if I want to edit the description in each language. Each time I get the popup window with the question "Do you want to switch"?
Is it possible to put the 3 descriptions (nl, fr and uk) in 1 tab page?
thx
gp


texts:
I am upgrading magento website from 1.6.2 to 1.9.3.1 and  it seemed to have went successfully but website was not properly displayed.

I found this error and I don't know what to do to solve it.

a:5:{i:0;s:94:"Invalid method Mage_Catalog_Block_Layer_Filter_Category::shouldDisplayProductCount(Array
(
)
)";i:1;s:3719:"#0 /home/mystore/public_html/app/design/frontend/base/default/template/catalog/layer/filter.phtml(42): Varien_Object->__call('shouldDisplayPr...', Array)


texts:
I have order

When I click on one of the records

I got this

How can I solve this problem

Is this due to php version or other problem.

I am using php 5.3 and magento 1.9.

Please help.


texts:
i'm creating a module for magento admin and it has so many fields, but as seen in image attached, i want field of price 2 to be on next right to price 1 field. can you anyone please suggest the solution for this.

Thanks


texts: Emails not being sent in Magento 1.9.3.6 - CRON Running

texts:
Im having an issue on my site where no emails are being sent. Everything has been working fine and a few days ago emails stopped being sent.

Cron looks to be fine and running and being successful

anyone got any ideas on what i can try?


texts: LocalizedException: "An item needs to be selected. Select and try again."

texts:
I am trying to customize extension by adding it to newsletter subscribers, and when I select/check subscribers and send email, I get error as the title suggests.
Error:
1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): An item needs to be selected. Select and try again.

Exception #0 (Magento\Framework\Exception\LocalizedException): An item needs to be selected. Select and try again.
<pre>#1 MageVision\MassEmailCustomers\Controller\Adminhtml\Email\MassSend->execute() called at [vendor/magento/framework/App/Action/Action.php:108]

I have added necessary classes to the PHP i think, my code is below
https://github.com/nix0x00/newsletter_subscribers/blob/master/massSend.php
I assume its being thrown from line :119 $this->send($item);.
Can anyone please suggest me whats wrong here?
My XML file is:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="adminhtml.newslettrer.subscriber.grid.massaction">
            <arguments>
                <argument name="options" xsi:type="array">
                    <item name="mass_email_customer" xsi:type="array">
                        <item name="label" xsi:type="string" translate="true">Email to Customers</item>
                        <item name="url" xsi:type="string">massemailcustomers/email/massSend</item>
                        <item name="confirm" xsi:type="string" translate="true">Are you sure you want to send an email to the selected subscriber(s)?</item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>


texts: Create sale in magento using pos application

texts: I am working on web-services of Magento. I need to show a sold product by the pos application in Magento backend.


texts: We setup the multilanguage websites. I'm trying to setup the website for Mongolian Country. In default magento missing the mongolian Locale language. How to add this language in locale.


texts: M 1.9.0.1 - SQL - Set manage stock 1 for all simple products

texts: I would like to update all my simple products in database by direct sql to set "manage stock" to 1 but don't know how to start.


texts: Reindex status stuck on "Reindex Required"

texts:
As you can see above, when I reindex I am shown a message stating that the reindex was successful. However the status of the index does not change from "Reindex Required".

Efforts:

Removed files within ./var/locks/
Truncated index tables
Tried shell command. Despite success messages I still see "Reindex Required"

$ php ./shell/indexer.php --reindexall
Product Attributes index was rebuilt successfully in 00:00:02
Product Prices index was rebuilt successfully in 00:00:01
Catalog Search Index index was rebuilt successfully in 00:00:05
Stock Status index was rebuilt successfully in 00:00:00
Tag Aggregation Data index was rebuilt successfully in 00:00:00
Catalog URL Rewrites index was rebuilt successfully in 00:00:41
Product Flat Data index was rebuilt successfully in 00:00:03
Category Flat Data index was rebuilt successfully in 00:00:00
Category Products index was rebuilt successfully in 00:00:00


texts: Extending Admin Grid Using Foreach and Variables

texts:
I'm trying to modify the Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid (where products are searched for in Magento Admin Order Create) in an attempt to add some custom inventory fields.

The inventory is stored as a product attribute against each individual product dependant on a warehouse location. The available locations are then defined in the config and called to fetch all locations and display stock. Below is the code I have in the grid.php

    $warehouseCodes = Mage::getStoreConfig('salesman/general/warehouse_code');
    $warehouses = explode(',',$warehouseCodes);
    foreach ($warehouses as $warehouse) {
        $this->addColumn($warehouse . "_stock", array(
        'header'=> Mage::helper('catalog')->__($warehouse . " Stock"),
        'width' => '30px',
        'type'  => 'number',
        'index' => Mage::helper('catalog')->__($warehouse . "_stock"),
    ));
    }

The good news is that the code works, however the stock figures do not show up against the products until the column is sorted in the grid. Whereas adding a column explicitly rather than using variables works as expected (code below).

    $this->addColumn('far_stock', array(
        'header'=> Mage::helper('catalog')->__('Far Stock'),
        'width' => '30px',
        'type'  => 'number',
        'index' => 'far_stock',
    ));


texts: Error log in "Manage Categories" page ver. 1.9.1.0

texts:
I installed an extension and somehow it hits me with this serious problem. Even though I uninstall it, the error is still on. Please help me. I cannot access it manage the categories now.

  There has been an error processing your request
  Exception printing is disabled by default for security reasons.
  Error log record number: 535828022979


texts: Subselect as main_table on magento collection

texts:
I'm trying to do a query with subselect in magento collection.

Example

The original query:

$collection = Mage::getModel('salesrule/rule')
    ->getCollection()
    ->addFieldToFilter('rule_type', 2)
    ->addWebsiteFilter($customer->getWebsiteId())
;

$collection->getSelect()
    ->joinInner(
        array('special' => $collection->getTable('company_salesrule/special')),
        'special.salesrule_id=main_table.rule_id'
    )
    ->where('special.from where('special.to > ?', $weight)
    //->order('main_table.sort_order ASC')
    ->group('special.group')
;

With the  result;

SELECT
    `main_table` . *, `rule_coupons`.`code`, `special` . *
FROM
    `salesrule` AS `main_table`
        LEFT JOIN
    `salesrule_coupon` AS `rule_coupons` ON main_table.rule_id = rule_coupons.rule_id
        AND rule_coupons.is_primary = 1
        INNER JOIN
    `company_salesrule_special` AS `special` ON special.salesrule_id = main_table.rule_id
WHERE
    (rule_type = '2')
        AND (EXISTS( SELECT
            1
        FROM
            `salesrule_website` AS `website`
        WHERE
            (website.website_id IN ('6'))
                AND (main_table.rule_id = website.rule_id)))
        AND (special.from  100)
GROUP BY special.group

But, I need this result (Line 4):

SELECT
    `main_table` . *, `rule_coupons`.`code`, `special` . *
FROM
    (SELECT * FROM salesrule ORDER BY sort_order ASC) AS `main_table`
        LEFT JOIN
    `salesrule_coupon` AS `rule_coupons` ON main_table.rule_id = rule_coupons.rule_id
        AND rule_coupons.is_primary = 1
        INNER JOIN
    `company_salesrule_special` AS `special` ON special.salesrule_id = main_table.rule_id
WHERE
    (rule_type = '2')
        AND (EXISTS( SELECT
            1
        FROM
            `salesrule_website` AS `website`
        WHERE
            (website.website_id IN ('6'))
                AND (main_table.rule_id = website.rule_id)))
        AND (special.from  100)
GROUP BY special.group


texts: WYSIWYG editor in static block is deleting HTML code

texts:
I've noticed that the WYSIWYG editor, in the static block configuration, randomly deletes the HTML code inside, in my case is the image slider.

I'm not sure about the reason: image size, code size, ilegal characters, code identation, spaces, etc, for what I know the code is not actually deleted at all, if I look for it on the cms_block I found it the content column, exactly how I coded it, but the WYSIWYG editor just a few HTML lines (deleting the UL element with everything inside), and the image slider doesn't display the images in the frontend. Sometimes accepts the code and works, sometimes it doesn't.

The images altogether has just 1MB size, and 850px x 310px... not deal I think.

This is exactly the HTML code inside the static block of the image slider:

&nbsp;

        &nbsp;
        &nbsp;

After saving it, and going back to edit it, this is the code I see:

&nbsp;

        &nbsp;
        &nbsp;

And once again, I can see the whole HTML code in the content field of the cms_block MySQL table.

Anybody can explain me what's happening here?


texts: Past deleted order details being used by new orders

texts:
So in the past we made the mistake of deleting orders from our Magento store.

We had an order today where a UK customer purchased a book.  They paid and received all the correct notification via email.

We then logged in to the admin to review the order.  It was completely different from the email notification.  It had a US address, a different payment method, products were added which no longer exist.  These details were from past test orders.

Another thing we noticed is that the confirmation email was also sent to other users, not in any way connected with this order.

I know we made a mistake in deleting past orders and that is undoubtedly the cause of our problem, but does anybody have any advice on how to reset things, without starting afresh.


texts: Admin menus not working in magento 2.0.4

texts: After successful installation of magento 2.0.4 when I login in admin panel and clicking on left menus sales,products & other it is again redirecting me on dashboard. Any one can suggest something so that the other menus functionality can work in my local environment?


texts:
Is it possible to enable system/exception logging in Magento through local.xml, instead of doing it by DB saved settings?

Or at least via code (but changing the setting only for one particular execution, without changing the configuration in the DB)?

What I'm after is to be able to have a different configuration for dev/production, one with log enable and the other without logging). And even if I'm not using the same DBs, every time we download the production DB to continue testing we have to reset settings.


texts:
I’ve got an attribute that is a text field with numbers in it, such as the number of days it takes to produce the product. the product sort, but it shows products in order of 10,11,12,1, 2,3,4,5,6,7,8,9.

I’m assuming this is due to a stricter sort rather than a natural sort.

Does anyone know how to switch the sorting method used for the product grid’s sort by or what file i should be looking in? I know i have to sure natsort but i do not know where to put this?

Thank you


texts: Allow Customers to Add and Delete Products/Images/Categories from Frontend

texts:
In an existing magento store - I have been asked to integrate the ability for the stores trade clients to create products, categories and images themselves. In effect it would become a kind of portfolio or showcase needing the ability to:

add new products and delete
add new categories and delete
add new images and delete

I know i can do all these things programmatically at times but my question is whether magento is built or can be adapted for this purpose safely?

By the sounds of it eventually the majority of the site would become this meaning everything for products, categories and images would all be controlled by the clients themselves not an admin

Is magento and the database structure built to handle all these actions being done on the front end? I worry that giving this amount of control could cause issues for the rest of the site and database tables?


texts:
I currently have an issue placing orders with saved cards using Vault for Braintree. With a bit of debugging, I can see the following error:

  Public hash should be defined in /vendor/magento/module-vault/Model/Method/Vault.php:498

I can see when looking at the Request Payload for 'payment-information', public_hash is blank and returns a 400 error. This is on Magento 2.2.2, and just to state, placing orders with new card details works fine, but when using the same card again as a saved card, it fails.

Any help would be greatly appreciated.


texts: Display alt attributes of thumbnail images on product detail page

texts:
On the product detail page of the template I'm using I've noticed the thumbnail images don't include an alt attribute. The code is implemented as alt="".

Looking at the product image proper (the one marked default in the admin for the product) I can see the alt attribute is determined by alt="'.$this->htmlEscape($this->getImageLabel()).'"

What's interesting is it seems this is pulled off the product (from app/code/core/Mage/Catalog/Block/Product/Abstract.php)

public function getImageLabel($product = null, $mediaAttributeCode = 'image')
{
    if (is_null($product)) {
        $product = $this->getProduct();
    }

    $label = $product->getData($mediaAttributeCode . '_label');
    if (empty($label)) {
        $label = $product->getName();
    }

    return $label;
}

I know the label for each image is in the system, because if I change the default image of the product, the alt attribute of the main product image is now reflective of the newly assigned image. I just need to understand how to fetch the attribute off the image object rather than the product object.


texts: Issue in saving custom customer attributes after upgrading from 1.4.2 to 1.7

texts:
I have upgraded by website from magento ce 1.4.2 to magento ce 1.7.2, everything works fine but custom customer attributes in account edit page are not getting saved, I have added these attributes using my custom module.
What can be the probable issue.
I have done a little debugging that shows I am not getting my custom attributes in $this->_attributes; in getAttributes() method.
Please let me know if anybody have any idea or someone faced any similar issue and what he/she have to fix it.


texts:
Has anyone noticed this in Query.php?

Found in app/code/core/Mage/CatalogSearch/Model

There are a few references to 'MinQueryLenght' instead of 'MinQueryLength'. I'm assuming it's a typo so have changed it but surely this could have quite severe effects on the search functionality?


texts: How to add confirm modal popup on clear shopping cart magento2

texts:
How to add pop up modal confirm on click of clear shopping cart in cart page.

I tried with below code but its showing confirm pop up but its clear cart if I confirm or not.

    <script type="text/javascript">
    require(['jquery','Magento_Ui/js/modal/confirm'], function ($, confirm) {
    $('.update').on("click",function(event){
        event.stopPropagation();
        getId = $(this).attr('data-order');
        confirm({
            content: 'Are you sure you would like to remove these item from the shopping cart?',
            actions: {
                confirm: function () {
                     return true;

                },
                cancel: function (event) {
                   return false;
                }
            }
        });
    });
 function _removeItem(orderId){
           return false;
    },
 });
</script>


texts: Change shipping address column format in Sales Order Grid (Magento 2.4.2)

texts:
Where do I change the column shipping address format in the Sales => Order => Grid in Magento 2.4.2?
I need to have the post code/zip code in front of the city. "Stan" and "99999" should swap position and be on a new line.
Also, I want to remove the order grid linking, we only want to use the "View" link.
Thank you very much,
Update!
Image describing the sales grid row linking issue. Is it possible to remove the row linking in sales => orders in Magento 2, and only use the action "View" link instead?
Update!
Image Grid Row Linking Issue

Address Formatting Issue

Update #2 @Prince
Should i remove the following whole part ...
<settings>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">sales_order_grid.sales_order_grid.sales_order_columns.actions</item>
<item name="target" xsi:type="string">applyAction</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">view</item>
<item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
</item>
</param>
</childDefaults>
</settings>

... and replace with:
<settings>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">false</item>
</param>
</childDefaults>
</settings>

... to remove sales order grid linking?


texts: Magento 1 module backend not found and error has not been whitelisted

texts:
Module backend not found also appear error in the log:
DEBUG (7): Security problem: megamenu/list has not been whitelisted.

The screenshot below with description in  detail :
http://prntscr.com/pa37z3

Although have set config System -> Permission -> Blocks
http://prntscr.com/pa390n

Anyone can help me?
Thanks!


texts: How can I move "AMAZON PAY" button from shipping address to Payment Methods In one step checkout magento2

texts: I want amazon pay button inside my payment method block where all the payments shows, How can i do that is anyone have an idea ???


texts: Magento 1 smartship pickup point for posti module not working

texts:
I have Magento 1.9.4.5 using smartship module, I have trouble with the pickup post module
the insert postcode field & Button & pick up available place all disabled
the value of the escapeHtml($carrierCode); ?> === smartpostPickup_error
and when I move the disabled values by inspect them and force the function
i got empty option with s_method_smartpostPickup_error id .
I will be thankful if someone suggests some help here


texts:
I have used the sales_quote_collect_totals_after event in magento2, I am able to set the custom price in the mini-cart after add to cart. but my subtotal showing mismatch.

di.xml

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

SalesQuoteCollectTotalsPrice.php

<?php
  namespace Demo\Customprice\Observer;
  use Magento\Framework\Event\ObserverInterface;
  use Magento\Framework\App\RequestInterface;
  class SalesQuoteCollectTotalsPrice implements ObserverInterface
  {

public function execute(\Magento\Framework\Event\Observer $observer)
{
   $quote = $observer->getQuote();
   $cartItems=$quote->getAllVisibleItems();
   foreach($cartItems as $item )
   {
      $finalCustomprice="163.47";//Customized price want to set here
      $item->setCustomPrice($finalCustomprice);
      $item->setOriginalCustomPrice($finalCustomprice);
      $item->getProduct()->setIsSuperMode(true);

   }

}   }

this is my code could you please check and give me suggestions.

whether I can able to set the subtotal for single and multiple items?

Thanks


texts: Magento 2 - Import custom product attributes through csv, can I import them using individual columns?

texts:
I was able to export the custom filterable product attributes into individual columns in CSV file using BSSCommerce export extension. Now I have a large amount of data need to update.I have searched around the forum and found different answers. I would like to confirm the definite answer if Magento 2 (i'm using 2.2.6) default import allow us to import custom product attributes through csv with individual columns(using custom attribute names), or everything need to go under "additional_attributes" column?

For example: Can I import it like below:

SKU   | custom-attr1 | custom-attr2 | custom-attr3
shirt |  blue        | xl           | men

or does it has to be like:

SKU   | additional_attributes
shirt | custom-attr1=blue,custom-attr2=xl,custom-attr3=men

some related questions i found, but can't find the definitely answer for import.

  Do you have to use additional_attributes in Magento 2 product import or can you still create a separate field?

  custom attributes in separate coloumn while export? - Magento 2.0.8


texts: magento 2 robots.txt file is not creating in root directory after enabling settings

texts:
Recently we have deployed the website to live and after when SEO ask to put the robots.txt file in root directory for search engine crawl.
We have checked setting in Content > Design > Configuration and edit the design and found the option search engine robots and already set but why Magento 2 is not creating robots.txt file?

Is there any specific settings to allow this or do we need to put the file manually.

Please let me know if any one have idea for this section.


texts: Run controller in background Magento 2.3

texts:
How can I run controller in background? I read about Message Queues and Deferred Actions, but it is hard for me to understand how it works and which should I use.
For now it is implemented like this:
Mass Action Button on Product Listing -> Controller -> Model -> Success (or Error) message.
I would like the information to be displayed after pressing the button that the synchronization is in progress, and when it is over - that it has finished (a message on screen or in the logs).


texts: Set Meta Titles in Admin with Variable - Magento 1

texts: We have an e-commerce site with many products and to write a title for each one would be very time consuming. Is there a way in the Admin to set the title as Buy {Product Name} Online where {Product Name} is a variable ?


texts: I would like to hide sections of the magento admin for some users. I've seen this option for hiding things all together but am wondering if there is a way to conditionally hide sections of the admin for some users.


texts: Add script after head tag end  in magento

texts: I want to add script after  tag. How can I add this?


texts: Usage of {{block type="bla/blubb"}} in WYSIWYG backend forms

texts:
I want to implement a {{block type="bla/blubb"}} in a newly generated Magento Category Attribute, which is configured as a WYSIWYG field.

However, if I put my code into that attribute in the backend, it doesn't get rendered, instead I get the output {{block type="bla/blubb"}}.

The same code is working fine when I place it into a CMS Page in Magento, {{block type="bla/blubb"}} will get rendered there fine.

I installed the attribute this way:

$entityTypeId = $installer->getEntityTypeId('catalog_category');
$attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$fieldName = 'my_attribute_name';

if (!$installer->getAttributeId($entityTypeId, $fieldName)) {
    $installer->addAttribute("catalog_category", $fieldName, array(
        "type" => "text",
        "backend" => "",
        "frontend" => "",
        "label" => "Attribute Label",
        "input" => "textarea",
        "class" => "",
        "source" => "",
        "global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
        "visible" => true,
        "required" => false,
        "user_defined" => false,
        "default" => "",
        "searchable" => false,
        "filterable" => false,
        "comparable" => false,
        "wysiwyg_enabled" => 1,
        "is_html_allowed_on_front" => true,
        "visible_on_front" => true,
        "unique" => false,
        "note" => "Description"
    ));

    $installer->addAttributeToGroup(
        $entityTypeId,
        $attributeSetId,
        $attributeGroupId,
        $fieldName,
        '10'
    );
}

What would I need to do in order to get {{ }} tags working? I've added the block already to be whitelisted in Blocks output and activated the dynamic media output, which does something else (as Marius suggested).

I'm using Magento 1.9.3.4


texts:
I am courious if this can be done from backend.

European countries shipping: VAT code need to be added;
Other countries: No VAT required.

I also need to hide VAT from invoice.

Magento: 1.9


texts: removing newsletter & paypal layouts in home page

texts: How can I remove blocks (newsletter,compare) in home page only ?


texts: Anyone had a problem with Redis suddenly spiking and then crashing the server?  we have had a recurring problem with Magento2.  Redis suddenly gets hit with masses of data which makes it unavailable and it eventually crashes.


texts:
Magento 2.3 Multi source inventory module - Does it work for Bundled products?

MSI roadmap says it is in Milestone 3. So if I implement the MSI Module as of today into a catalogue of simple and bundled products, will it not allow the bundled products to work alongside? Seem to be having trouble getting it shipped.
https://github.com/magento-engcom/msi/wiki/MSI-Roadmap#mls3


texts: How to use LOAD DATA INFILE mysql syntax in magento?

texts:
$write = $resource->getConnection('core_write');
$write->beginTransaction();
 $query = "LOAD DATA LOCAL INFILE '" . $partCsvPath . "' "
          . "INTO TABLE " . $resource->getTableName('csv')
          . " FIELDS TERMINATED BY ','"
          . " LINES TERMINATED BY '\r'"
          . " (col1, col2, col3, col4, col5, col6)";
$write->exec($query);
$write->commit();

This gives me the following error:

SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version

I can execute this query in MySQL just fine but not through Magento.

Is there any solution to this? without local this gives me permission denied error.


texts: Product Image Animated Gif - Reduce image size on Frontend (Magento 1.9.2.4 )

texts:
I was able to get Animated Gif images to show for products by doing this: Though your caching functionality will not work for animated gif image.

Copy file from

  path : app/code/core/Mage/Catalog/Model/Product/Image.php

to

  path : app/code/local/Mage/Catalog/Model/Product/Image.php

(create folders if necessary)
 Find the line public function getUrl() and replace the function with:

public function getUrl()
{
$baseDir = Mage::getBaseDir('media');
$file = ('gif' == strtolower(pathinfo($this->_baseFile, PATHINFO_EXTENSION))) ? $this->_baseFile : $this->_newFile;
$path = str_replace($baseDir . DS, "", $file);
return Mage::getBaseUrl('media') . str_replace(DS, '/', $path);
}

This works great - except the now animated gifs that appear on the frontend are slightly bigger then the standard .jpg etc.... images that are already up in the product grid (and my recently added products area).

How can I get these to resize to match the appearance of the others?

I have searched and not been able to find an answer. I believe I see earlier on in the code where the image is resized but I am not sure how to get the animated Gif working and have it resize properly to match the other images appearance.

Any help would be appreciated!

Section of a screenshot - Top 6 Images are the Gifs:


texts:
I have a question and it is if Magento2 cleans the cache after reindexing data, is it like this?
For example, if the stock in a product is changed and re-indexed. Magento2 clears the cache so that the changes are visible in the fontend?
It is for optimization reasons since the cron schedules for indexing are generated every minute.


texts: How to cancel or close an order that has been invoiced through the API

texts:
I know in previous older versions (still 2.0) that I could cancel an order in processing with an invoice but recently that seems to have stopped working for a few of my clients.  ie:
/V1/orders/{id}/cancel

So I have to change the order cancelation process somehow.  Leaving the order closed may also work.

What is the process for cancelling an order that has been invoiced through the API?

What endpoints do I use?

What information do I need?


texts: Magento 2: Get child product name in bundle options along with SKU and ID in API Response

texts:
I am working on a headless magento approach.

On hitting : /V1/products/:sku

I get the details of the product as the following response:

...
        "bundle_product_options": [
            {
                "option_id": 70,
                "title": "Product title",
                "required": true,
                "type": "select",
                "position": 1,
                "sku": ":sku",
                "product_links": [
                    {
                        "id": "1059",
                        "sku": ":sku",
                        "option_id": 70,
                        "qty": 1,
                        "position": 1,
                        "is_default": false,
                        "price": 0,
                        "price_type": 0,
                        "can_change_quantity": 0
                    },

           .....

I want to add the option's title in the products_links section.

I also need this for configurable products as well.

Any suggestions?

EDIT: I think I have to add a method to getTitle in the

  vendor/magento/module-bundle/Api/Data/LinkInterface.php

But I don't know how to do that.


texts: How to lock customer account after a certain date

texts:
Is there any extension or solution available to lock a customer account after a certain date on Magento 2.2.2, I.E the customer will not be able to login after this date

I have searched and could only find lock customer after x amount of wrong passwords


texts: Providing the option of choosing any special products after doing add to cart in magento 1.7

texts:
I want to give new feature to my site,that when user selects any product and do "add to cart" ,after this he should get a window of special products which he wants to purchase with that product and if he dont want then he will not choose any product and do "proceed to checkout"
like in www.fnp.com.

Can I impliment this fuctionality in magento

If yes please provide me some links.I will be thankful to you.


texts:
I am getting this error on our website

  5.7.1 : Sender address rejected: not owned by user Email

Just to make you aware email 1 is different to email 2

Any advice on resolving this would be great.


texts: Minimum Qty Allowed in Shopping Cart different management

texts:
why Magento manages 'Minimum Qty Allowed in Shopping Cart' in a different way for the simple products and the sons of configurable products?

In particular: in the first case, the product page shows the 'Minimum Qty Allowed in Shopping Cart' in the product counter of 'Add to cart' and in the next page, the checkout page. In the second case, the counter of products in the product page shows '1' and if you try to go to Checkout page, an alert message appears and stops the navigation.

Considering that these situations are embedded in the Core (Catalog Inventory), how can I conform the different behaviors?


texts: how to display more related products in magento 1.9.3

texts:
As a beginner i dont know much about custom .my query is On my product page it shows  3 related product only. i want to add one more related product here. how to do this.
Thanks for any advice


texts: I'm using Magento 2.2.4 and I'm having some issues with email.  I posted a whole long thing about all my issues here, but I've since narrowed down the scope of this.  I can't use SMTP extensions, such as Magepal's SMTP, GoDaddy blocks it.  I thought that was the reason why my transactional emails appear to come from my-cpanel-user@bla-bla.secureserver.net, and not our site domain.  However, if I use the Contact Us form (all Stock Magento), it shows as coming from Customer Service and has the right reply-to address.  So this works, but why are transactional emails not obeying the configuration of who to use as the sender?


texts: How to enable HTML minification without breaking images

texts:
Recently, whenever we try to enable Minifying HTML within the Magento admin panel (Stores > Configuration > Advanced > Developer > Template Settings), our product images on the individual product pages fail to load.

A network request just like the one in the screenshot will go out, and immediately fail. Have tried deploying static content and reindexing with no luck.

Anybody else experienced this issue?


texts: I want to show the admin user on, change order status in bulk or single order

texts:
I want to show the admin user name on change order status in order comment history in bulk or single order, using a single event or plugin
Magento 2.3.5p1 Community edition

Any help highly appreciated
Thanks


texts: Deprecated save and load methods in Abstract Model

texts:
I see that in the develop branch of the Magento 2 repo the methods load and save from Magento\Framework\Model\AbstractModel class are deprecated.
But there are a gazillion classes in the core that extend this class and use save and load.
When creating my own module for the CRUD part of my entities I follow the same guidelines as a core module does.
But since these methods are deprecated I would rather be prepared for the future.
What should I use instead of them? Or I should extend something else?


texts: Need help for package magento connect extensions

texts:
I was reading this below article to create package from magento connect.

http://www.magentocommerce.com/wiki/7_-_modules_and_development/creating_magento_connect_extension_package

But I am confused at two points in this article.

First how can I find Dependencies for magento extention.

Second is that, one look on this image
http://www.magentocommerce.com/wiki/detail/general/contents2.jpg?id=7-_modules_and_development%3Acreating_magento_connect_extension_package&cache=cache

According to this article

Magento Community module file - ./app/code/community

And in the image they have used

Magento Community module file - Bloghome

"Bloghome" seems to be module directory than it is okay.

Magento User Interface (layouts, templates) - ./app/design

In the image they have used..

Magento User Interface (layouts, templates) - adminhtml/default/default/layout/bloghome_blog.xml

this also seems okay because this is layout xml file which is in /app/design directory

 Magento Local module file - ./app/code/local

But in the image they have used

Magento Local module file - frontend/base/default/layout/bloghome_blog.xml

Here 'Magento Local module file' is consider to be '/app/code/local' but here path is for '/app/design'. That is the point where I am confused.

Please guide why they have used 'Magento Local module file' for app/design layout xml file.

thank


texts:
I am working on one custom module where i imported products from csv successfully.But i am doing like first field must be sku and second should be name.But the issue is if someone change the sequence then it creates issues.Is there any way i can map csv fields so that i can adjust fields with that.I am getting csv fields like this :

$file = $path."/".$_FILES['file_uplod']['name'];
      $csv = new Varien_File_Csv();
      $data = $csv->getData($file);
for($i=1; $i<count($data); $i++){
  $name = $data[$i][1];

}

I want to code some generic so fields map with DB fields name.


texts: Create customer programatically using setData

texts:
i have a dynamic data array which contain customer data, the data inside the array will be variative, thats why i'm using setData function to insert the customer data to customer model like this:

 $data0['website_id'] = '0';
 $data0['group_id'] = '1';
 $data0['firstname'] = 'Bruce';
 $data0['lastname'] = 'Wayne';
 $data0['email'] = 'batman@cave.com';
 $data0['password'] = 'BecauseIAmBatman';
 $data1['website_id'] = '0';
 $data1['group_id'] = '1';
 $data1['firstname'] = 'Clark';
 $data1['lastname'] = 'Kent';
 $data1['email'] = 'super@man.com';
 $data1['gender'] = '1';
 $data1['taxvat'] = '12345';
 $data1['password'] = 'SupermanIsDead';
 $data[] = $data0;
 $data[] = $data1;

 foreach ($data as $dat) {
   $dat = array($dat);
   $customer = Mage::getModel("customer/customer");
   $customer->setData($dat);
   $customer->save();
 }

if i run the above code, i got an error like this:

  There has been an error processing your request
  Customer email is required


texts: Apply a jQuery whitespace trim to an adminhtml filter input

texts:
My goal is to load a simple jQuery function to trim any whitespace in an admin backend filter input. The use case involves a scanner inputting codes with spaces that will turn up no results.

I have tried a couple methods involving loading the script through an XML layout update as a phtml block, or because the filter is under adminhtml/ui_component, updating the column to load in my script as a component. The methods I have attempted have failed for one reason or another, whether because the load order is failing because I've failed to properly use requirejs in this case, or because the script cannot access the element.

The script is:

define([

    'jquery'

],
$(function () {
    $("input[name='code']").bind('input', function(){
      $(this).val(function(_, v){
        return v.replace(/\s+/g, '');
      });
    });
  })

In essence, what is the best/recommended way to load this script so that it will strip whitespace out of an adminhtml filter?


texts: How can get image of items in checkout cart

texts:
I  need to get all data in checkout cart and with below code I can get all data instead of image, I want to get image of items in checkout like in checkout cart that when click on image go to page of product. How can I do it?

<?php
    $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
    foreach($items as $item) {
            echo 'Product Name: '.$item->getName().'
';
            echo 'Product Image: '.$item->getImageUrl().'
';
            if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()):
            $_incl = $this->helper('checkout')->getPriceInclTax($item);
            echo 'Product Price: '. $this->helper('checkout')->formatPrice($_incl- $item->getWeeeTaxDisposition());
            else:
                echo 'Product Price: '. $magento_style_price = Mage::helper('core')->currency($item->getPrice());
            endif;
                echo "
";
                 }
                // Total items added in cart
                $totalItems = Mage::getModel('checkout/cart')->getQuote()->getItemsCount();
                // Total Quantity added in cart
                        $totalQuantity = Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
                // Sub Total for item added in cart
                        $subTotal = Mage::getModel('checkout/cart')->getQuote()->getSubtotal();
                //grand total for for item added in cart
                $grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();
?>


texts: Email Attachment not working in Magento 2.2.6

texts:
I am using Magento version 2.2.6 and trying to send custom email with attachment, but I am getting 500 error.
I tried transportbuilder addattachment which is working in Magento 2.3.x and onwards.
But facing issue in this version.
I am trying this code:
  $this->message->createAttachment(
            $pdfString,
            'application/pdf',
            \Zend_Mime::DISPOSITION_ATTACHMENT,
            \Zend_Mime::ENCODING_BASE64,
            'attatched.pdf'
        );

And getting this error [1]: https://i.stack.imgur.com/civfS.png
Kindly let me know how I can send email with attachment in Magento version 2.2.6.
Any help will be apperciated.


texts: How to call php if/else statement if value empty

texts:
Hopefully a nice simple question to start the day...

In success.phtml, I would like to achieve the following using PHP:

$_commissionGroupCode = [If $_voucher is empty, echo "DEFAULT". Else echo "VOUCHER"]

Below is a snippet of my code so far:

$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$_products = $order->getAllItems();

$_totalData = $order->getData();
$_discount = $_totalData['discount_amount'];
$_voucher = $_totalData['coupon_code'];
$_commissionGroupCode = ANSWER GOES HERE

You will notice I already have $_voucher to call the voucher code


texts: How to call a PHTML file within a CMS page Magento 2?

texts:
Magento 2
I have installed a sample Bannerslider module downloaded from Magestore.
When I call bannerslider.phtml into CMS Home Page, it's showing unreliable error on the home page.
{{block class="Magento\Bannerslider\Block\Slideshow" template="bannerslider.phtml"}}

The error message is We're sorry, an error has occurred while generating this email.
I changed the block class as well, still, it shows the same error.
Can you please suggest me a proper way?
If you need furthermore code detail, Please mentioned me in a comment. I am really stuck here.
After uncomment SetEnv MAGE_MODE developer in .htaccess file error message being the change and showing
Error filtering template: Invalid block type: Magento\Bannerslider\Block\Slideshow

By the way, the admin section of this module is working fine.
Block class
namespace Magento\Bannerslider\Block;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Magento\Framework\Filesystem;
use Magento\Framework\App\Filesystem\DirectoryList;
class Slideshow extends Template
{
    public function __construct(
        Context $context,
        \Magento\Bannerslider\Model\BannerFactory $bannerFactory,
        \Magento\Framework\Filesystem $fileSystem,
        \Magento\Framework\StoreManagerInterface $storeManager,
        array $data = array()
    ) {
        $this->_fileSystem = $fileSystem;
        $this->_bannerFactory = $bannerFactory;
        $this->_storeManager = $storeManager;
        parent::__construct($context, $data);
    }
    public function _prepareLayout()
    {
        return parent::_prepareLayout();
    }
    public function getBaseJs($fileName){

        return $this->_storeManager->getStore()->getBaseUrl(
                \Magento\Framework\UrlInterface::URL_TYPE_MEDIA
            ).'bannerslider/js/'.$fileName;
    }
    public function getBannerData(){
        $banners = $this->_bannerFactory->create()
                        ->getCollection()
                        ->addFieldToFilter('status',1);
        foreach ($banners as $banner){
                $result['banners'][] = $banner->getData();
        }
        return $result;
    }
    public function getBannerImage($imageName) {

        $mediaDirectory = $this->_storeManager->getStore()->getBaseUrl(
                \Magento\Framework\UrlInterface::URL_TYPE_MEDIA
            );
        return $mediaDirectory.'bannerslider/images'.$imageName;
    }
}

Module.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Magento_Bannerslider" setup_version="1.0.0"/>
</config>


texts: while saving admin cms pages getting 404 not found only for files in magento 2

texts:
while saving admin cms pages
getting 404 not found page

in magento 2
already permission for
pub/media 777
var  777

how i can solve this
i'm using magento 2.1.11
Edit1:

I created new cms page when i add text and i saved that  it's working
if i add any files(image) then i save that i'm getting 404 page error not found

pub/media permissions


texts: Add CC to all transactional emails in Magento 2

texts:
I wanna add custom CC email to all transactional emails in Magento 2. But, I can't find any decent event to catch email sending process and add CC to email. Any ideas?

UPDATE

As Keyur Shah suggests, I've created di.xml

<config>
<type name="\Magento\Framework\Mail\Template\TransportBuilder">
  <plugin name="test_custompayment_plugin" type="Test\Custompayment\Plugin\TransportBuilder" sortOrder="1" />
</type>

And /Test/Custompayment/Plugin/TransportBuilder.php

<?php
namespace Test\Custompayment\Plugin;

class TransportBuilder
{
public function beforeGetTransport()
{
    $this->prepareMessage();
    $this->addCc('sevkafaya@gmail.com','');
    $mailTransport = $this->mailTransportFactory->create(['message' => clone $this->message]);
    $this->reset();
    return $mailTransport;
   }
}

But I face with error:

  Fatal Error: 'Uncaught Error: Call to undefined method
  Test\Custompayment\Plugin\TransportBuilder::prepareMessage()

So do I need copy all content from \Magento\Framework\Mail\Template\TransportBuilder and just replace getTransport() with beforeGetTransport?


texts: How to get estimated shipping address before placing order magento 2

texts: I want to get estimated shipping adddress for a custom controle of country so how to prodceed please and thanks in advance


texts: How to create More then one table in magento?

texts: How to create More then one table in magento with installer script ?


texts: Which method is used in Magento Enterprise 1.14.2.1 to send new order emails

texts:
I am using

    $order = Mage::getModel('sales/order');
    $order->loadByIncrementId($orderId);
    $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');

    $order->sendNewOrderEmail();
    $order->setEmailSent(true);

in my success method, but in Enterprise store the method is not working.
I am not receiving mail for new order.

Can anyone please guide me for this. I am stucked debugging the issue from last two days. Any help will be appreciated.


texts: Invalid response line returned from server: HTTP/2 401 | Error

texts:
Trying to upgrade from Magento 2.3 -> Magento 2.3.1 and have the following error ...Invalid response line returned from server: HTTP/2 401 when submitting my access keys.

Found a solution on here which suggests to alter a line on file with the path

lib/internal/Magento/Framework/HTTP/Client/Curl.php or vendor/magento/framework/HTTP/Client/Curl.php

I don't have this path on my system, mine is lib/internal{GnuFreeFont / LinLibertineFont}


texts: Configuration of Related products magento 2

texts:
Does Magento2 not have Related products/ Cross sell products configuration in admin by default?

Should we have to install the 3rd party extension?


texts: async rest api product can't set `enable_qty_increments`

texts:
I would set up enable_qty_increments in my store. I've edit store settings cart options to manage this but when I try to use rest api to update my product always this request can't set options relate to this configuration.

This is an example request

curl -X PUT \
  https://xxx.xxxx.xxx/rest/all/async/V1/products/sku_prod \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxx' \
  -d '{"product":{"sku":"sku_prod","name":"name","extension_attributes":{"stock_item":{"qty":100,"is_in_stock":true,"is_qty_decimal":false,"min_sale_qty":2,"qty_increments":2,"enable_qty_increments":true}}}}'

Actual result contains this value for stock_item field

"stock_item": {
            "item_id": 109545,
            "product_id": 109591,
            "stock_id": 1,
            "qty": 100,
            "is_in_stock": true,
            "is_qty_decimal": false,
            "show_default_notification_message": false,
            "use_config_min_qty": true,
            "min_qty": 0,
            "use_config_min_sale_qty": 0,
            "min_sale_qty": 1,
            "use_config_max_sale_qty": true,
            "max_sale_qty": 10000,
            "use_config_backorders": true,
            "backorders": 1,
            "use_config_notify_stock_qty": true,
            "notify_stock_qty": 0,
            "use_config_qty_increments": false,
            "qty_increments": 1,
            "use_config_enable_qty_inc": false,
            "enable_qty_increments": true,
            "use_config_manage_stock": true,
            "manage_stock": true,
            "low_stock_date": null,
            "is_decimal_divided": false,
            "stock_status_changed_auto": 0
        }

"min_sale_qty": 1 and "qty_increments": 1 have a different values in response w.r.t. values provided by request. Is it a bug or have I a miss configuration in my store?

Please let's me know and thanks in advance


texts:
I am trying to get table prefix by using the function getTableName(), But couldn't get the result, Below is my code,

$sum = new \Zend_Db_Expr('(SUM(`main_table`.`product_id`)/`main_table`.`product_id`)');
    $collection = $this->orderItem->getCollection()
        ->addFieldToSelect(['product_id', 'frequency' => $sum])
        ->removeFieldFromSelect('item_id');
    $select = $collection->getSelect();
    $connection = $collection->getConnection();
    $orderItemTable = $connection->getTableName('sales_order_item');

    $select->joinLeft(
        ['sub_table' => $orderItemTable],
        '`main_table`.`order_id` = `sub_table`.`order_id` AND `main_table`.`product_id` != `sub_table`.`product_id`',
        ['product_id']
    );
    $collection
        ->addFieldToFilter('main_table.product_id', ['eq' => $productId])
        ->addFieldToFilter('sub_table.product_type', ['nin' => $restrictedProductTypes])
        ->addFieldToFilter('sub_table.parent_item_id', ['null' => true])
        ->setOrder('frequency');
    $select->group('sub_table.product_id');
    $result = $connection->fetchAll($select);

I just tried the below code, but it forced me to set area code

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$deploymentConfig = $obj->get('Magento\Framework\App\DeploymentConfig');
var_dump($deploymentConfig->get('db/table_prefix'));


texts: How to add custom payment method with form only for admin

texts:
I am using Magento CE 1.8.1.0.

I have successfully added a custom payment method with a simple form with one field: custom fee in the admin area. I am storing the value in the info instance additional_data field. I can see this value being saved in the database. However, I want this value to be added to the Totals block at the same time because I will add a new row called "Custom Fee" in this block.

Unfortunately I don't know how to pass the captured value "custom fee" to my Mage_Sales_Model_Quote_Address_Total_Abstract subclass. The fetch() method is not able to get the custom fee value from the Mage_Sales_Model_Quote_Address object:

public function fetch(Mage_Sales_Model_Quote_Address $address) {

  $info = $address->getQuote()->getPayment()->getInfoInstance();
  // $info is null because custom fee has not been persisted
  ...
}

What is the best approach to pass the custom fee value from the form to fetch() in my Mage_Sales_Model_Quote_Address_Total_Abstract subclass?


texts: Group magento admin grid column headings

texts:
I have a requirement to group/categorize column headings of a grid layout which will result in 2-level column heading.

For example,let we have 5 columns in a grid named as : First Name,Last Name,Email,Company,Designation .....Now,I want to group/categorize them in "Personal Info" and "Professional Info" by adding these two top level headings.

So,Under "Personal Info" heading I will have 3 columns with headings - First Name,Last Name,Email and under "Professional Info" heading I will have Company and Designation headings....Can I achieve this ??If yes,then can anybody help me to find out how can I do this???


texts:
Going forward with my customization I would like to get CMS blocks using a filter:

My code to get the collection:

    $today = Mage::getModel( 'core/date' )->date( "Y-m-d" );
    $collection = Mage::getModel( 'cms/block' )->getCollection()
      ->addFieldToFilter( 'is_slider', true )
      ->addFieldToFilter( 'start_time', array( 'lteq' => $today ))
      ->addFieldToFilter( 'end_time', array( 'gteq' => $today ))
      ->getAllIds()
      ;

is it possible to do it better ?

in further steps I'm looping trough to get blocks identifiers and put into array then return array:

    foreach($collection as $id){
        $slides[] = Mage::getModel('cms/block')->load($id)->getData('identifier');
    }
    $this->_slides = $slides;
    return $this->_slides;

I would like to add also a sort by "order_slide" so I can decide which slide is first and which one will be last.

Edit:

Final version of the function:

public function getSlideIds()
{
    $today = Mage::getModel( 'core/date' )->date( "Y-m-d" );
    $collection = Mage::getModel( 'cms/block' )->getCollection()
      ->addFieldToSelect('identifier')
      ->addFieldToFilter( 'is_slider', true )
      ->addFieldToFilter( 'start_time', array( 'lteq' => $today ))
      ->addFieldToFilter( 'end_time', array( 'gteq' => $today ))
      ;
    foreach($collection as $id){
        $slides[] = $id->getData('identifier');
    }
    $this->_slides = $slides;
    return $this->_slides;
}

works properly.
Thank you Douglas.
Actually I should change now function name to getSlideIdentifiers() :P


texts:
What table does Magento on the frontend to locate the relationship between a category and its products?
catalog_category_product

catalog_category_product_index

catalog_category_product_relationship

catalog_product_parent


texts:
How i can disable the wishlist in magento only for guest users and show to logged in users?

which files I need to change?

Many thanks

[update]
i have a file in /app/design/frontend/base/default/mytheme/layout/customer.xml with this code: `

<customer_logged_out>
    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer">Log In<url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position>
        <liParams/><aParams>class="flat_top_icon icon-login-1"</aParams>
        </action>
    </reference>
    <remove name="reorder"></remove>
</customer_logged_out>`

Added the code inside, but not work:

<customer_logged_out>

    <reference name="top.links">
        <reference name="top.links">
            <remove name="wishlist_link"/>
        </reference>
        <reference name="right">
            <remove name="wishlist_sidebar"/>
        </reference>
        <reference name="left">
            <remove name="wishlist_sidebar"/>
        </reference>
        <action method="addLink" translate="label title" module="customer">Log In<url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position>
        <liParams/><aParams>class="flat_top_icon icon-login-1"</aParams>
        </action>
    </reference>
    <remove name="reorder"></remove>
</customer_logged_out>


texts: How to print order details for event observer sales_order_save_after

texts:
want to print order details and product details (variants) which are ordered.

  My xml file

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

    </config>

  My observer file

<?php namespace Vendorname\Modulename\Observer;
        use Magento\Framework\Event\ObserverInterface;
             public function __construct(
            \Magento\Sales\Model\Order $order
        )
        {
            $this->order = $order;
        }
           public function execute(\Magento\Framework\Event\Observer
          $observer)
         {
            $order = $observer->getEvent()->getOrder();
           $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/nitesh.log');
            $logger = new \Zend\Log\Logger();
            $logger->addWriter($writer);
           $logger->info($order->getOrderId());

         foreach( $order->getAllVisibleItems() as $item ) {

         $logger->info( $item->getHana());  //" HANA is new attribute name"
          $logger->info( $item->getProductId());
         }

but getHana not print


texts:
I have a complex SQL Select query that I want to convert to Magento query. It is for index of Bestseller.  But I am not able to convert the SQL Select into Magento's Query. Please Help!

SELECT SUM( qty_ordered ) AS ordered_qty, store_id AS order_items_name, IF( parent_id IS NOT NULL
AND visibility !=4, parent_id, product_id ) AS final_product_id
FROM (
SELECT order_items.qty_ordered, order_items.name, order_items.product_id, cpr.parent_id, order_items.store_id, cat_index.visibility, cat_index.category_id
FROM  sales_flat_order_item AS  order_items
INNER JOIN  sales_flat_order AS  order ON  order.entity_id = order_items.order_id
AND  order.state !=  'canceled'
LEFT JOIN catalog_product_relation AS cpr ON cpr.child_id = order_items.product_id
LEFT JOIN catalog_category_product_index AS cat_index ON cat_index.product_id = order_items.product_id
WHERE parent_item_id IS NULL
AND cat_index.store_id =1
AND category_id =2
) AS T1
GROUP BY final_product_id, store_id
ORDER BY final_product_id;


texts: Where to place Google Webmaster verification file

texts:
I'm in the process of uploading the Google Webmaster verification file via FTP, and I just want to check with you guys that I'm putting it in the right place.

Below is a screenshot of what I can see. Do I upload it here or do I need to go into one of the folders and upload it there?

Thanks as always! :)


texts: Shipping Options not showing in Magento CE 1.9.0.1

texts:
I upgraded from Magento CE 1.8.1 to 1.9.0.1 and now the FedEx and USPS shipping modules I had set up do NOT work, as in they do not show in the shipping step at checkout.

At first I thought it might be a Theme / Template issue since I am finding that virtually ALL of the Themes that I have tried, that worked fine with 1.8.1 have problems somewhere with 1.9.0.1 so I set it to the RWD Default theme that was part of the 1.9.0.1 Magento CE install, but it did not fix the shipping problems.

I was using the following in 1.8.1 with no problems:

Free Shipping
FedEx
USPS
UPS

Now the only two I can get to work are UPS and Free Shipping.  The UPS module is really not that great as it does not factor return accurate shipping values.

Any help would be appreciated.  ( I have cleared the cache and have tried enabling / disabling the shipping options to no avail.)


texts:
What do you guys suggest to modify in Magento core to speed it up, without breaking anything?

Like disabling modules via xml files or modifying checkout to remove observers.


texts: Getting issue while importing product data in Magento 2.4.1

texts:
We are looking for solution in Magento 2.4.1 which can resolve our issue in data import
In our case the category name are like
Available Brands Migrated/Kitchen, Storage & Furniture/Cookware/Baking & Roasting Trays
So in this case Kitchen, Storage & Furniture is a single category but Magento taking it a comma separate making kitchen and Storage & Furniture as separate category. So does anybody have faced similar issue. The problem is that in CSV everything is comma separated but if category name have comma then how can we resolve this case.


texts: M2 Search Result Not Displaying Correct Result/Products

texts:
I've a multi-store setup using multi-website approach.

For some products, when I run a search query, I am not getting correct results, instead completely unrelated products are getting displayed.

The site is using the default MySQL Search.


texts: Inventory Management solution integrated with Magento

texts:
What solution do you guys use/recommend for Inventory Management:

Purchase Orders
Receive Goods (GRN)
Track Stock movements (multiple locations, transfers, consumption)
Ship Goods (Delivery Note)
Reports (stock available on-hand, reserved, stock value, etc)
integrated with Magento

So far, some customers use the ERP system (Microsoft Dynamics AX/NAV, SAP, Netsuite, local ERP systems, etc) for Inventory Management, but I am looking for a solution that handles only the inventory part and updates Inventory field in Magento, allowing traceability for stock items.
I have so far on the list boostmyshop  but I'm not happy with what they have in there and how they developed that as a magento "module".


texts: Prevent Disabled Extension From Breaking Frontend

texts:
I am having an issue where I am receiving this error on the frontend:
Fatal error: Uncaught Error: Class 'Mage_Core_Helper_Data' not found in /domains/mysite.co.uk/http/app/Mage.php:547 Stack trace: #0 /domains/mysite.co.uk/http/app/code/local/MageWorx/StoreSwitcher/Model/PageCache/Processor/Abstract.php(38): Mage::helper('core') #1 /domains/mysite.co.uk/http/lib/Varien/Autoload.php(94): include('/domains/mysit...') #2 [internal function]: Varien_Autoload->autoload('MageWorx_StoreS...') #3 /domains/mysite.co.uk/http/app/code/local/MageWorx/StoreSwitcher/Model/PageCache/Processor.php(38): spl_autoload_call('MageWorx_StoreS...') #4 /domains/mysite.co.uk/http/lib/Varien/Autoload.php(94): include('/domains/mysit...') #5 [internal function]: Varien_Autoload->autoload('MageWorx_StoreS...') #6 /domains/mysite.co.uk/http/app/code/core/Mage/Core/Model/Cache.php(703): spl_autoload_call('MageWorx_StoreS...') #7 /domains/mysite.co.uk/http/app/code/core/Mage/Core/Model/Cache.php(685): Mage_Core_Model_Cache->_getProcessor('MageWorx_StoreS...') #8 /domains/mysite.co.uk/http/app/c in /domains/mysite.co.uk/http/app/Mage.php on line 547

The MageWorx StoreSwitcher mentioned in the error is disabled.
Any ideas why this extension is causing issues if it's not enabled? Removing the extension files from app/code/local doesn't help either.
Magento ver. 1.9.2.4.


texts: Magento 2 : How to check multiple if config in layout?

texts:
Here is my code to add toplinks in my custom module

<referenceBlock name="header.links">
    <block class="Magento\Framework\View\Element\Html\Link" ifconfig="hello/general/enable" name="hello" >
        <arguments>
            <argument name="label" xsi:type="string">hello</argument>
            <argument name="path" xsi:type="string" translate="false">hello/index/index</argument>
        </arguments>
    </block>
</referenceBlock>

I want to add toplinks only if both option are true.

How to add one more condition for ifconfig="hello/general/toplinkenable" with this block or is there any alternate solution to check both conditions to add toplinks?


texts: Change date of birth date format in Magento 2.3

texts:
I want to change the validation for DOB field on create account page.

Currently the validation is in the format mm/dd/yyyy , I want to change the validation for that field to dd/mm/yyyy.

Can anybody tell me where is the validation code located. how to modify the validation rule for DOB field.


texts: Sign in link is not showing up in the header magento 2

texts:
I am trying to get the menu, logo and all the links in the header to appear in the same line. So far, I've managed to get the logo and menu in the same line, but for some reason, the sign-in link is not showing up.

This is default.xml from my custom theme's Megento_Theme-

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="header.panel">
        <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
            <arguments>
                <argument name="css_class" xsi:type="string">header links</argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_img_width" xsi:type="number">148</argument>
            <argument name="logo_img_height" xsi:type="number">43</argument>
        </arguments>
    </referenceBlock>
    <move element="navigation.sections" destination="header-wrapper" after="logo" />
    <referenceContainer name="footer">
        <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="Magento_Store::switch/stores.phtml"/>
    </referenceContainer>
    <referenceBlock name="report.bugs" remove="true"/>
    <move element="copyright" destination="before.body.end"/>
</body>

What could be the reason for the sign-in link not showing up?


texts: Magento Featured products one the homepage disappered suddenly!

texts:
I made a new category as "Stock Clearance" and after completing it, when I refreshed my home page my featured products were not showing anymore, Just the title was there, rest blank. Anyone know any fix ? Please check the screenshot below.

In the above screenshot, that is my homepage, where featured products use to display in each section like new arrivals, new with tag, etc. But suddenly it disappeared. Please if anyone knows any solution, let me know.


texts:
I have noticed that the latest SUPEE 11219 is not available for Magento 1.9.2.x via Magento you can only download for 1.9.3 and up, even thought the affected versions are Magento Open Source prior to 1.9.4.3

Do I see this incorrectly or what should be done in this case?

Thanks for your help!


texts: Magento 2.3.5: Link product page attribute to category page

texts:
How can I link (href) a product page attribute to it's category page?
For example:
I have a visible attribute on the product page called "Artist" and the product is in 3 categories "Artist" "Style" "Type" and I want the attribute "Artist" to link to the category "Artist".
Is this possible? I can't seem to figure out how to do this.
Any help is much appreciated.


texts: How convert the new code to an extension including a new database table

texts:
I have customised the Magento application to include COD & expected date of delivery.

That is I have included a new DB table and change in /app/design/themeFolder.

Now how can I convert this to extensions and include it to Magento connect?

Thanks in advanced!


texts: Magento 1.9.2 Cannot place order and update order data in Paypal Express checkout method

texts:
Hi Magento StackExchange,

I have an issue in Magento 1.9.2, after I activated "PayPal Payments Advanced (Includes Express Checkout)" in System - Configuration - Payment Methods.

I test to buy some items, go to check out page, and choose PayPal Express. The site redirect me to PayPal to login. After insert my email and password, PayPal redirects me back to Review Order page in my Magento Site. I get stuck in Review Order, "Place Order" and "Update Order data" button is clickable but no response.

I have already activated the Log feature from Magento Admin, but there is no error or warning in system.log.

I also tried to "Skip Review Order", but after I get redirected back to my Magento site from PayPal Page, the Review Order Page keeps loading until connection time out.

Is there anyone can give me so advise to fix this issue?


texts: Is Google Content API for Shopping compatible with CE 1.9?

texts:
I'm looking to export a basic data feed from Magento CE 1.9. I understand that there is a free extension called Google Content API for Shopping. However, the product description only says it is compatible with 1.6 and 1.7.
Is there a version compatiable with 1.9?


texts: How to disable shipping method from checkout page in magento 2

texts: I want to remove the complete shipping method from the frontend.Even free shipping also we don't need.If we disable all the shipping methods from backend the next button will not come on the checkout page.Can anyone please suggest how to remove shipping method.


texts: How many recievers per cycle in mail queue?

texts:
Before pushing the send button, I would like to know, how many mailrecievers the queue handles per cycle? Does it send to everybody on the list at one time, or does it go more gently with, lets say, 50 per batch? And, is so, are there any ways to configure the number.

I'm a bit worried if the server has to handle thousands of mails in one go ...


texts:
I'm trying to create a new cron tab on the fly, and running into problems with the times created by the cron model. Here is an example:

So first let's use config.xml to create some cron tabs:

<crontab>
    <jobs>
        <erp_cron_tab>
            <schedule><cron_expr>* * * * *</cron_expr></schedule>
            <run>
                <model>erp/observer::cronTab</model>
            </run>
        </erp_cron_tab>
    </jobs>
</crontab>

As soon as I hit cron.php Magento creates 20 new rows in the cron_schedule table. At the time of writing this, the created_at time is 2014-07-24 19:17:16

I now try to create my own cron tab "manually" through the model, like so:

Mage::getModel('cron/schedule')
    ->setJobCode('erp_cron_tab')
    ->setScheduledAt(date('Y-m-d H:i:00', Mage::getModel('core/date')->timestamp(time())))
    ->save();

Now all of a sudden the created_at time is 2014-07-24 12:17:16 a whole 7 hours earlier.

Shouldn't I be avoiding timezone issues by using Mage::getModel('core/date')->timestamp(time())? Why do these times not line up?


texts: Magento 2.2 : How to enable the 'city' field on cart shipping estimator

texts:
I can see the city field on the file

  => checkout_cart_index.xml:

<item name="city" xsi:type="array">
    <item name="sortOrder" xsi:type="string">115</item>
    <item name="dataScope" xsi:type="string">shippingAddress.city</item>
    <item name="provider" xsi:type="string">checkoutProvider</item>
</item>

but it does not display on the shipping estimator on the cart page.

Does anyone know how I can get the City field on here?

Thanks in advance!


texts: How to Get Product Current Category Name in Magento 2 in Product View Page

texts: How to Get Product current category Name in Product View Page above the Product Name. And give me file path Location to get Current Product Category Name in Magento 2.


texts: I want to change the order status when the shipment is occurred in magento 2.3

texts:
I want to change the order status
(custom_status) during the shipping, how to implement this as functionality in magento 2.3


texts: How to get selected shipping method in the checkout page magento 2?

texts:
I would like to get the selected shipping method from the checkout page it looks like this one :

I just want to get the selected shipping method like above image shown : Shipping Table Rates so that I can get the shipping code method.

I have some clue to get it using \Magento\Checkout\Api\Data\ShippingInformationInterfaceFactory but when I add this to my block class I got this error :

  Fatal error: Uncaught TypeError: Argument 3 passed to
  Fabelio\Checkout\Block\ExpectedDelivery::__construct() must be an
  instance of
  Magento\Checkout\Api\Data\ShippingInformationInterfaceFactory

Is this the correct way to getting the shipping method from checkout page ?


texts: Magento 2 : Error 503 first byte timeout

texts:
Getting this error when i'm update product from product grid using update attributes.

Error Page:


texts: Empty row in dropdown admin panel magento 2

texts: I had empty row in drop down for attribute in adminpanel. Although there is no empy value while creating attribute.How to remove it.


texts:
I have got myself into a bit of a pickle managing a magento site for a new business venture. I am pretty out of my depth and am very much a beginner in command line and server management. I have a cloud centos 6 server, with a magento 2 site.

The site was came installed as part of the initial set up (under user root)
I have subsequently used command line as user root (bad I know, but not sure of exactly what the correct thing is) to run cron, clear cache, run indexes, run any upgrades

I now have a few issues that occur intermittently
- I get an SQL error and have to restart SQL, it takes the entire site down, front and backend
- I get a permissions error on varying files which brings down the front and backend of the sites
- The cron stops working due to permissions issues (and could potentially then cause the SQL error?)

In order to get around the issue with permissions I have been doing something terrible setting all files to 777, just because I don't know what the right thing to do is.

I have been reading loads of resources online to try to know exactly what the right thing to do is, but I believe none are entirely suited to my requirements. I think what I need to do is the following:

Log in as root user (I have no other)
Set up a new user 'magento_user'
Assign to nginx group
Restart nginx
Set owner of files in magento root and on to be the magento_user (not sure how to do this)
Reset permissions on the all the files and folders to follow correct privileges (as the magento user or root?)
Set cron for Magento to run (as root or magento_user?)

Does this sound correct, if anyone can . offer me some guidance I would really appreciate it.

Also when I have had issues previous I have had to run magento upgrade (among other commands to refresh things and clear errors). I should do this as magento_user not root I am guessing?

Is there any other glaring poor choice things you can tell me I shouldn't be doing as root? I am fairly sure I have been doing all the wrong things!

Thanks in advance,

Ella


texts: How to enable Error Messages $this->_messageManager->addError(__('Error')); in Custom Checkout Module Magento 2?

texts:
app\design\frontend\Vendor\theme\Magento_Theme\templates\messages.phtml

  app\code\Vendor\Module\view\frontend\layout\checkout_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">

        <title>Multi Step Checkout</title>

        <referenceContainer name="columns.top">
            <referenceBlock name="messages">
                <action method="setTemplate">
                    <argument xsi:type="string" name="template">Magento_Theme::messages.phtml</argument>
                </action>
            </referenceBlock>
        </referenceContainer>

        <container name="sidebar.additional" label="Sidebar Additional" htmlTag="div">
            <referenceBlock name="wishlist_sidebar" remove="true"/>
            <referenceBlock name="sale.reorder.sidebar" remove="true"/>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
        </container>

        <referenceBlock name="content">

        </referenceBlock>

</page>

  In Controller Code

$errorMsg = "Something";
$this->_messageManager->addError(__($errorMsg));
$this->_redirect('checkout', ['_fragment' => 'cart']);

  But Even after all It's not triggering Error Messages.


texts:
Magento2 I use below code to restore cart items, it works for login & not for guest customer
$corder = $this->_checkoutSession->getLastRealOrder();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $customerSession = $objectManager->create('Magento\Customer\Model\Session');
        $customerSession->setMyOrder($corder);
        $this->_checkoutSession->restoreQuote();

How can I restore for guest customer


texts: Magento Theme Broke after Upgrading to 2.2.5

texts:
We recently had to update our Magento to allow support for a crucial plugin on our website, however on updating to 2.2.5 the frontend shows lots of errors.
What would of caused this and how can it be fixed?

Errors:
https://pastebin.com/Dd5tmGnK


texts: My website home is showing blank. How to fix it?


texts: Magento 2.4 Customer Login - Refresh page

texts:
I'm running into an issue on a Magento 2.4 website with 2 websites ( the one is on a seperate subdomain ).
Some customers cant login using their credentials, the page just reloads without any errors.
Deleting the PHPSESSID cookie of the one domain ( not the one their trying to login ) seems to works, but i dont understand why this is happening.
Is there a way to avoid this issue ? maybe somehow make magento store cookies "globaly" like *.domain.com ?
*UPDATE
The problem IS the two cookies, deleting either one makes the login pass, i think there is something happening with the domain path
1).site.com
2).subdomain.site.com
Is this a valid pattern for multi website Magento sites?


texts: How to add custom button under the phone number field in one page checkout in Magento 2?

texts: I need to add a button under the phone number filed in the shipping address section in a one-page checkout and the button should be visible only when the user enters the phone number. Based on the entered number, I need to check the condition whether the button is visible or not. How to achieve this?. I already followed this link  https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_edit_form.html but I did not know how to add button under the phone number.


texts: Magento products not showing up after import, but show up after making a null edit

texts:
I have imported 122 products using Dataflow profiles. All of them should show up in the frontend, but they don't. However, when I click edit any of the products that don't show up, make no change, and save the product, the Blocks HTML output cache will invalidate. Refreshing it will cause the edited product to show up.

Of course, by my luck, this does not work when you mass-edit the products, or change its status to disabled and then back to enabled from the product list.

How do I make them show up all at once?


texts: Magento2 how to display shipping methods in Dropdown field in checkout page instead of radio button

texts: How can I display shipping methods in the dropdown field in checkout page?


texts: I need to create more then 50+ category. I Tried manually it take a too much of time so how to create category programatically?


texts: Layered Navigation not showing the right options after overriding product list block

texts:
I've successfully override productList block to show my custom filtered product collection like this:

  di.xml

<preference for="\Magento\Catalog\Block\Product\ListProduct" type="\Vendor\Module\Block\Product\ListProduct"/>

  Vendor\Module\Block\Product\ListProduct

protected function _getProductCollection()
{
    $productCollection = parent::_getProductCollection();
    if(isset($_GET['custom_input'])){
      if(!empty($_GET['custom_input']){
        $customInput = $_GET['custom_input'];
        $productCollection = $this->myModuleHelper->filterProduct(customInput, productCollection);
      }
    }
    $this->_productCollection = $productCollection;
    $this->_productCollection->getSize();
    return $proCollection;
}

but the layered navigation options not showing the right option and product count like the image below:


texts: Magento 2.4.1 - Frontend product pages not showing all content

texts:
I am running Magento 2.4.1 with Porto theme and when accessing any frontend product page, most of the time (not always), not all content is displayed. To see all content I have to manually refresh the individual product page up to 5 times before everything is displayed/loaded.
EDIT: I have also noticed other issues that require refreshing before sometimes working.
On the category pages, the Sort By, Show (12, 24, 36) and view by List/Grid functions are failing most of the time also.
I am at a loss. Any ideas?
Thanks,
Rob


texts: Magento Product Collection less then the Original price

texts:
How to get Special price less or not

  <?php

$categoryIds = array(469);//category id

$todayDate = date('m/d/y');
        $tomorrow = mktime(0, 0, 0, date('m'), date('d'), date('y'));
        $tomorrowDate = date('m/d/y', $tomorrow);

$collection = Mage::getModel('catalog/product')
                             ->getCollection()
                             ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
                             ->addMinimalPrice()->addFinalPrice()
                             ->addAttributeToSelect('*')
                             ->addAttributeToFilter('category_id', array('in' => $categoryIds))
                             ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))

                             ->addFinalPrice()

                   ->getSelect()
                   ->where('price_index.final_price < price_index.price')

                             ->addAttributeToFilter('special_to_date', array('or'=> array(
                                0 => array('date' => true, 'from' => $tomorrowDate))
                                ), 'left')

?>

I want to display if special price less then the original price how to get that ?


texts: How to filter product by stock quantity?

texts:
I am trying to get results of products by stock quantity filter

i use this inside the constructor of my helper class.

 \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $product_lib

The question is how do i add stock quantity from and to in this?

$this->product_lib->create()->addAttributeToSelect('*')->
addCategoriesFilter(array('in' => array(1,2,3))->
addFieldToFilter('price', ['from' => $min_price, 'to' => $max_price])
->load();

When i try to additional addFieldToFilter with quantity it says not found. What i am looking for is to achieve the same results as in catalog->products filter.

Any suggestion is helpful.
Also if possible can you suggest where to do i look for these kinds of information? Is there any book that would be helpful?


texts: Bulk add products in Magento using SOAP API V2

texts:
Is there an way such that i can add 100 items in a go through a single API call.Am a .Net developer new to Magento API.Am using Magento SOAP V2.

i am able to create single items.I check the method "catalogProductCreate" and can see that it accepts only one element of "catalogProductCreateEntity" at a time.Can some one please help.


texts: Resolved - Uploading Product Images From Custom Module Admin Form

texts:
I have a custom grid. Need to upload product images from admin form of the custom module.

Here is the grid Edit file at

  app\code\local\Cpstest\ProductComment\Block\Adminhtml\Cps\Edit\Form.php

<?php
class Cpstest_ProductComment_Block_Adminhtml_Cps_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
    public function __construct()
    {
        parent::__construct();

        $this->setId('cpstest_productcomment_cps_form');
        $this->setTitle($this->__('Product Comments Information'));
    }

    protected function _prepareForm()
    {
        $model = Mage::registry('cpstest_productcomment');

        $form = new Varien_Data_Form(array(
            'id'        => 'edit_form',
            'action'    => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
            'method'    => 'post'
        ));

        $fieldset = $form->addFieldset('base_fieldset', array(
            'legend'    => Mage::helper('adminhtml')->__('Product Comments Information'),
            'class'     => 'fieldset-wide',
        ));

        if ($model->getId()) {
            $fieldset->addField('id', 'hidden', array(
                'name' => 'id',
            ));
        }

        $fieldset->addField('name', 'text', array(
            'name'      => 'name',
            'label'     => Mage::helper('adminhtml')->__('Customer Name'),
            'title'     => Mage::helper('adminhtml')->__('Customer Name'),
            'required'  => true,
            'class'     =>'input-text required-entry validate-no-html-tags',
        ));

        ...

        $form->setValues($model->getData());
        $form->setUseContainer(true);
        $this->setForm($form);
        return parent::_prepareForm();
    }
}

  Here is the controller SaveAction:

public function saveAction()
{
    if ($postData = $this->getRequest()->getPost()) {
        $model = Mage::getSingleton('cpstest_productcomment/cps');
        $model->setData($postData);

        try {
            $model->save();
            Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The comment has been saved.'));
            $this->_redirect('*/*/');
            return;
        } catch (Mage_Core_Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
        } catch (Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while saving this comment.'));
        }
        Mage::getSingleton('adminhtml/session')->setCpsData($postData);
        $this->_redirectReferer();
    }
}


texts: i want to make some custom design tool using fabric.js , my code also uses jquery but problem it that when i include jquery.js i get lost of error dues to js conflict how can i fix it


texts: Magento 2: How to open form in modal popup in your custom UI component

texts:
Below is my custom UI Component. Here in i want to open form on modal popup with custom field and want to save them.

define([
    'uiComponent',
    'Magento_Ui/js/modal/modal',
    'Magento_Ui/js/modal/confirm',
    'mage/translate'
], function (Component,modal, confirm, $t) {
    'use strict';

     return Component.extend({

        myFunction: function () {
            modal({
                'title': 'Test Title',
                'autoOpen':true,
                'content':'how to pass Dynamic content'
            });
        }

    });

});


texts: How to set and get values in multiselect in admin form. Magento 1.9

texts:
I want to create one multi-selector on the form to select multiple categories.

I have created a field set for that but how can I display values into that to select multiple categories.

this is my fieldset

   $fieldset->addField("visible_in", "multiselect", array(
            "label" => Mage::helper("slider")->__("Visible In"),
            "name" => "visible-in",
            'values'    => 'hello',
            'required' => true,
        ));

Currently multiselector showing blank

how to add values into it and where to create the function for it?


texts:
I have a running project on my server, when i try to copy it to my local env i got the following error:

  Warning: include(Mage/Core/Model/Resource/Helper/Mysql5.php): failed
  to open stream

i already setup the app/etc/local.xml and delete the var/cache folder


texts:
I need to override the 'loadArea' and 'loadAreaResponseHandler' magento core js functions in the file module-sales/view/adminhtml/web/order/create/scripts.js.

I tried to use mixin property. Following is my mixin js file.

define(["jquery"], function () {
'use strict';

return function (target) {
    console.log("Called this Hook.");
    var loadArea = target.loadArea;
    target.loadArea = function (area, indicator, params) {
        var deferred = new jQuery.Deferred();
        var url = this.loadBaseUrl;
        if (area) {
            area = this.prepareArea(area);
            url += 'block/' + area;
        }
        if (indicator === true)
            indicator = 'html-body';
        params = this.prepareParams(params);
        params.json = true;
        if (!this.loadingAreas)
            this.loadingAreas = [];
        if (indicator) {
            this.loadingAreas = area;
            new Ajax.Request(url, {
                parameters: params,
                loaderArea: indicator,
                onSuccess: function (transport) {
                    var response = transport.responseText.evalJSON();
                    this.loadAreaResponseHandler(response);
                    deferred.resolve();
                    var orderHead = /Word_to_be_replaced/g;
                    var matchRes = response.header.match(orderHead);
                    if (matchRes) {
                        var newHead = response.header.replace(/Word_to_be_replaced/g, "new_word");
                        jQuery('#order-header').html(newHead);
                    }
                }.bind(this)
            });
        } else {
            new Ajax.Request(url, {
                parameters: params,
                loaderArea: indicator,
                onSuccess: function (transport) {
                    deferred.resolve();
                }
            });
        }
        if (typeof productConfigure != 'undefined' && area instanceof Array && area.indexOf('items') != -1) {
            productConfigure.clean('quote_items');
        }
        return deferred.promise();
    };

    var loadAreaResponseHandler = target.loadAreaResponseHandler;
    target.loadAreaResponseHandler = function (response) {
        if (response.error) {
            alert({
                content: response.message
            });
        }
        if (response.ajaxExpired && response.ajaxRedirect) {
            setLocation(response.ajaxRedirect);
        }
        if (!this.loadingAreas) {
            this.loadingAreas = [];
        }
        if (typeof this.loadingAreas == 'string') {
            this.loadingAreas = [this.loadingAreas];
        }
        if (this.loadingAreas.indexOf('message') == -1) {
            this.loadingAreas.push('message');
        }
        if (response.header) {
            var orderHead = /Order/;
            var matchRes = response.header.match(orderHead);
            if (matchRes) {
                var newHead = response.header.replace(/Word_to_replace/g, "New_Word");
                jQuery('.page-actions-inner').attr('data-title', newHead);
                jQuery('#id').html(newHead);
            } else {
                jQuery('.page-actions-inner').attr('data-title', response.header);
            }
        }

        for (var i = 0; i < this.loadingAreas.length; i++) {
            var id = this.loadingAreas[i];
            if ($(this.getAreaId(id))) {
                if ('message' != id || response[id]) {
                    $(this.getAreaId(id)).update(response[id]);
                    console.log(response[id]);
                }
                if ($(this.getAreaId(id)).callback) {
                    this[$(this.getAreaId(id)).callback]();
                }
            }
        }
    }
  };
});

I'm getting the following error

  scripts-mixin.js:13 Uncaught TypeError: Cannot read property 'loadArea' of undefined

Kindly help me to point out my mistake.


texts: Magento 2 - many attribute set, bad admin catalog perfomace

texts:
I'm using Magento 2.1.3. Everything had worked ok till I've imported bunch of attributes and attribute sets. Now I have 74 attribute set, and 705 attributes.
I've imported these via Store Manager.

After that, if I want to open Product->Catalog admin page, it's need 5 min to load all products (there are only 5 product). Can be root cause for these bad import of attribute sets via Store Manager or it's something else?

How I can debug this page to see which take this much time. I can go vie xdebug, but I don't know where to put breakpoint. Any hint will be helpful. Which function is responsible to load products on Product->Catalog page?

Thank you.