texts: How to hide the product collateral tab in details page without displaying any broken imageof multiselect attribute?

texts:
I have created a multiselect attribute named feature and have associated an image for every option created for that attribute. And I have displayed this attribute value inside the product collateral tab. As far in the product collateral tab, If the attribute displayed inside it don't have any value, that particular tab will be hidden. But with this feature attribute, even when no option is selected it is displaying broken image.

The code to fetch an image for each option of the feature attribute is :

    <?php
   $_prodID = Mage::registry('current_product')->getId();
   $_product = Mage::getModel('catalog/product')->load($_prodID );

?>

    <?php
    $Feature = explode(",",$_product->getResource()
    ->getAttribute('featuredetail')->getFrontend()
    ->getValue($_product));
        foreach($Feature as $key => $value): ?>
           <a class="feature-label" "href="<?php echo $_product->getProductUrl() ?>" ?>
            <?php echo ""; ?>

           <?php echo $value; ?>
        <?php endforeach; ?>

I think this feature.phtml is reponsible for that broken image to get displayed even when no value is selected. What should be done to fix this issue.Please kindly help me.


texts: Using repositories on frontend with paging

texts:
I've created a CRUD module in the proper way, with service contracts (SC).
I'm using these SC in the backend with ui-components and everything.
This works nicely, but I want to use the repository's getList method in the frontend with paging and everything.
Basically I want to have a page that lists my custom entity instances and have them paginated.
My repository interface contains (among others) the method

public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);

It looks very similar to the block repository interface and the implementation of the interface looks like the block repository.
I didn't find any example in the core that uses the repositories for frontend listing including paging. That would be enough to get me started.


texts: Magento 2 get customer attribute value issue

texts:
I am trying to get customer attribute value i have created text attribute and storing json data.

{"cloud":["
sfsdfsf<\/strong><\/span><\/u><\/span><\/div>\r\n",{"56":{"sku":"M816C","qty":"1","dosage_amount":"1-3","mesure":"tablets","dosage_frequency":"daily","dosage_options":"","remarks":""}}],"cloud1":["
adad<\/strong><\/span><\/u><\/span><\/div>\r\n",{"110":{"sku":"M108","qty":"1","dosage_amount":"","mesure":"","dosage_frequency":" ","dosage_options":"","remarks":""}}]}

When i am getting data entire data not coming.
It coming like below:

  {"cloud1":["
  adad
\r\n",{"110":{"sku":"M108","qty":"1","dosage_amount":"","mesure":"","dosage_frequency":"
  ","dosage_optiotest


texts:
I am trying to create custom URL rewrite from category to CMS page.

I have page url like this about-us.html as category page and about as CMS page.

Now when i create custom url it works but after the indexing it is not working, it again shows about-us.html.


texts:
I am using a custom theme with blank as parent. Everything works well but I noticed that on responsive screens the hamburger menu seems broken. When I click on it nothing happens while I expect the navigation menu to show up.

The version of the Magento installation is 2.2.5
I tried inheriting the menu.js and extended only the toggle function but still it does not work

Is there anyone who has experienced the same issue and can give some advice?

!UPDATE!
event handler is not attached to the element! It is though attached only on login screen and there the button works properly


texts: Want to add lump-sum amount in TAX in magento

texts:
I want to add some amount in TAX in magento. How this can be done?

Like in cart when we calculate shipping & handling at that time, shipping & handling comes but below that....TAX coming. I want to know the location from where the Tax is returned....something like this - return $tax; so that I can add an amount there & that will be used in whole site. I do not want a phtml file. I want a core file from which the tax is returned & I can add some amount & that will be used in whole site.

I checked the files inside Tax module built-in coming in magento but very hard to determine from where the final tax is returned :(

Another thing is I searched for it & got some solutions like add custom modules & through it add the custom fee but I do not want a separate module for it.

Any Help Please?

Thanks.


texts:
I have installed magento 2 successfully but frontend side and admin side style is not loading. Even after login to admin it gives not found(404) page

Base url in core_config_data:http://localhost.com/magento2/


texts: Change customer attribute required value issue

texts:
On my previous upgrade the required value for my customer attribute was set to false. This was set in this file upgrade-1.0.0-1.10.php. Now i need to set it to be true. So I created my file: upgrade-1.1.0-1.1.1.phpand put this code:

$installer = new Mage_Customer_Model_Resource_Setup('core_setup');
$installer->startSetup();
$installer->updateAttribute('customer', 'medical_location', 'required', true);
$installer->endSetup();

Then I went to my config xml and I changed the value from 1.1.0 -> 1.1.1. I checked in the core_resource and it was updated to my current version. But the required value for my customer attribute is still false. Did I do smth wrong ?

Thx


texts: Magento 2 how to set custom customer attribute select values

texts:
I am successfully able to create custom customer dropdown attribute but how to set select default values ?

I am using that code -

<?php
namespace XXX\Customerstatus\Setup;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Customer\Model\Customer;
use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{

/**
 * @var CustomerSetupFactory
 */
protected $customerSetupFactory;

/**
 * @var AttributeSetFactory
 */
private $attributeSetFactory;

/**
 * @param CustomerSetupFactory $customerSetupFactory
 * @param AttributeSetFactory $attributeSetFactory
 */
public function __construct(
    CustomerSetupFactory $customerSetupFactory,
    AttributeSetFactory $attributeSetFactory
) {
    $this->customerSetupFactory = $customerSetupFactory;
    $this->attributeSetFactory = $attributeSetFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    /** @var CustomerSetup $customerSetup */
    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
    $attributeSetId = $customerEntity->getDefaultAttributeSetId();

    /** @var $attributeSet AttributeSet */
    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

    $customerSetup->addAttribute(Customer::ENTITY, 'custom_customer_status_custom', [
                'type'          => 'int',
                'label'         => 'Custom Customer Status',
                'input'         => 'select',
                'source'        => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
                'required'      => false,
                'user_defined'  => true,
                'sort_order'    => 11,
                'position'      => 11,
                'system'        => false,
                'option'        => ['values' => ['Awaiting Reply', 'Yes', 'No']],
                'is_used_in_grid'       => true,
                'is_visible_in_grid'    => true,
            ]);

    $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'custom_customer_status_custom')
    ->addData([
        'attribute_set_id' => $attributeSetId,
        'attribute_group_id' => $attributeGroupId,
        'used_in_forms' => ['adminhtml_customer'],
    ]);

    $attribute->save();
}
}

I want "Awaiting Reply" by default it will be selected.


texts: What values should be passed in $this->_fileFactory->create()

texts:
I'm not able to download PDF on click of a button,but I'm able to generate the xlsx file.
How can I get the downloadable PDF on click of button in Magento 2?


texts: how to pass multiple values to fieldtofilter

texts:
I am passing attribute color value in URL as rest/V1/filterattribute/81?color=32,5.
By using getparams

$bodyParams = $this->request->getParams();
foreach($bodyParams as $key=>$value)
{
$this->collection->addFieldToFilter($key,['in' => array($value)]);

}

$this->collection->addFieldToFilter($key,['in' => 32,5]);

By giving value directly it works. But giving value by variable it did not work.
What I am doing wrong? How to pass multiple values in addFieldToFilter?
Thanks.


texts: I am using Magento 2.2 a purchased theme. I want to edit the main xml layout. which file shall i get to edit? Like I want to edit the homa page main layout structure so where shall i edit the structure from?


texts:
I have one domain with one store and store views for each language.

I would like to set up an over branding system on the site but without duplicating all the products.

Is there a way to set up several themes on each store view so that based on cookie information, the appropriate theme can be selected by Magento.

If this is possible I would also like some advise as to the maximum number of themes that could be applied if you have experience regarding this.

Thanks.


texts: I need to set an activity if the customer is created or updated but it is not working in magento 2.3

texts:
events.xml (path : app/code/vendor/module/etc/frontend)
<?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="customer_register_success">
        <observer name="customer_save_die" instance="vendor\module\Observer\AfterCustomer" />
    </event>
</config>

AfterCustomer.php (path : app/code/vendor/module/Observer/)
<?php
namespace vendor\module\Observer;

use Magento\Framework\Event\ObserverInterface;

class AfterCustomer implements ObserverInterface
{
    /**
     * @var ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_objectManager = $objectManager;
    }

    /**
     * customer register event handler
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $file = fopen("var/test/test.txt", "w") or die ("die")
        fwrite($file, "test");
        fclose($file);

    }
}


texts: I have a catalogue of over 10,000 products, and would like to replace the images for the products with compressed versions, is there an extension that will allow me to do this, or an easy way besides doing it product-by-product?


texts: hide only some categories from layered navigation in magento

texts:
we are using custom theme and 1.9 version

we have lot of categories in magento site. we have to hide some categories from "layererd navigation".

for some categories we put "NO" for "Include in Navigation Menu " in admin panel.

but still those categories are displaying under "shop by" in layered navigation.

how to hide only some categories from layered navigation.

please help me to find solution....

thanks in advance.


texts: How to get the order_id from an observer

texts:
I tried to get the order_id from an observer

here is my observer

 public function adminhtmlWidgetContainerHtmlBefore($observer) {
        if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
            var_dump($this->getOrderId());
            $block->addButton('do_something_crazy', array(
                'label'     => Mage::helper('sales')->__('Print Sticker'),
                    'onclick'   => 'setLocation(\'' . $this->getPrintStickerUrl() . '\')',
                    'class'     => 'go'
            ));
        }
    }

I got this error:

Call to undefined method Company_extention_Model_Observer::getOrderId().
I tried too $order = $observer->getEvent()->getObject();

but nothing,

Could you help me?

thanks


texts: Magento 2 How to upload csv in admin and update data in custom admin-grid/table?

texts: I am trying to upload csv that I have exported from existing admin grid. Adding additional data as perticular columnwise in same csv. Howcan I upload/import that new .csv in admin and update data in already created custom admin-grid/table ?


texts:
By default magento customer address, when we selected Country USA, State/Province will show drop down with all state list,

but other country showing just normal text field.

In case i want to insert State/Province for my country as dropdown option, how can I do ?

or it require custom code/ extension ?


texts: Stock = 0, out of stock - then I process a credit note. Stock = 1, but still out of stock

texts:
Situation:
Stock = 0, in_stock = no
Then I process a credit note.
Stock = 1, in_stock = no

I would expect the in_stock to be set back to yes. The effect of this is that we have many T-shirts in 1 size of 1 SKU that apparently were returned some day - and now not seen in the store (so not sold). So they are in stock with qty 1, but their flag in_stock is still NO

Question: Is there a solution for this?


texts: Magento 2 - Upsell configurable product shows out of stock - How to loop through simple products and return whether these are in stock?

texts:
I have a related products section on my product page where I display my upsell products.

The issue I have is where it displays a configurable product, it shows the product as out of stock since it is getting the stock status from the configurable product rather than checking the simple products that the configurable product holds.

The code that gets the stock status is:

<?php if($item->is_in_stock): ?>
   In Stock

<?php else: ?>
    Out Of Stock

<?php endif; ?>

The $item is populated by the following function:

public function prepareItem($item, $productId=null){

    $productId = is_null($productId) ? $item->getId() : $productId;

    $product = $this->objectManager->create('\Magento\Catalog\Model\ProductFactory')->create()->load($productId);

    $this->reviewFactory->getEntitySummary($product, $this->_storeManager->getStore()->getId());
    $specialPrice = ($product->getPrice() > $product->getFinalPrice()) ? true:false;

    $stockStatus =  $this->stockStateInterface->getStockQty($product->getEntityId()) > 0 ? true:false;

    $tmp = [
        'name'=>$product->getName(),
        'is_in_stock' => $stockStatus,
        'price'=>$this->priceHelper->currency(number_format($product->getPrice(), 2), true, false),
        'final_price'=>$this->priceHelper->currency(number_format($product->getFinalPrice(), 2), true, false),
        'has_special_price' =>$specialPrice,
        'url'=>$this->_storeManager->getStore()->getUrl($product->getProductUrl()),
        'rating_summary' => $product->getRatingSummary()->getRatingSummary(),
        'images' => $this->getImageCollection($product),
        'type_id' => $product->getData('type_id')

    ];

    if($product->getData('type_id') == 'grouped' ){
       $tmp['grouped_price'] = 'Starting at '.$this->getGroupedPrice($product);
    }

    return (object)$tmp;
}

I want to update where the $stockStatus variable so that it checks whether the product is a configurable product and if so, check to see whether any of the simple products for the configurable product are in stock and return true or false.

I would like to create another function that would loop through the configurable product simple products and check whether these are in stock by updating where the $stockStatus is set to the following:

if ($product->getData('type_id') == 'configurable') {
    $stockStatus = $this->getConfigurableStockStatus($product);
} else {
    $stockStatus =  $this->stockStateInterface->getStockQty($product->getEntityId()) > 0 ? true:false;
}

New function:

public function getConfigurableStockStatus($product){

}

I am unsure how I can loop through simple products and if all these are all out of stock return false otherwise return true within the getConfigurableStockStatus function?

Any help would be appreciated.


texts:
I need to get the Order Id from Tracking Id

In below image, this is tracking id : 371610055926


texts: WebAPI gives error: Class “array” does not exist

texts:
I want to send a list of statuses to my API. I send an array because it may be a lot of statuses. So my JSON looks like:

{
   "statuses":[
      "status_ok",
      "status_failed",
      "status_error",
      ....
    ]
}

My method for webapi looks like:

public function getProductsByStatuses($statuses)
    { ... code here ... }

but i got an error that "Class array does not exist". If in my json there is only a string not an array everything works fine. How can I fix it? Even if I add annotation array to my interface i still get this kind of error.


texts: Magento Can't Make Product Changes Unless Manually Change Data And Save

texts:
I can only update products when I manually go into the product page, change something and then save it. It won't update through magmi or bulk import or sql query.

I accidently changed the product name to the image url. I have changed it back through an upload and on the front-end it shows the product name but on the admin page it still shows the product url as the 'name' so it's hard to search for items.

The actual database shows 'name' (attribute_id = 71) as the correct name. So where is the back-end taking the data from?

If I manually go into a product and add 'test' to the end of 'name' and click save, the back-end (admin) will update, but I can't do this manually for every product.

Something seems to be happening when you click save that you cannot do via an upload?

And I have re-indexed all of it many times, through SSH aswell.
Cleared cache, deleted var/cache folder.

Any thoughts?


texts: how to modify order/items.phtml file in magento 2

texts:
I copied file from Following Location:

vendor\magento\module_sales\view\frontend\templates\order\items.phtml
and paste in

app\code\vendorname\Madule\view\frontend\templates\order\items.phtml

2.Copied   sales_order_view.xml from

vendor\magento\module_sales\view\frontend\layout and paste it in custom module

at

app\code\vendorname\Madule\view\frontend\layout

did changes in template path

<block class="Magento\Sales\Block\Order\Items" name="order_items" template="vendorname_Madule::order/items.phtml">

still it show vendor files


texts: Explanation of app/code vs vendor directories please

texts:
I'm looking for an explanation of the app/code/[vendor] and vendor/[vendor] directories?  (For M2.1)

Some online sources (such as  inchoo) say to put a new module in app/code/[vendor], yet in 2.1 there is no such directory, and modules are conspicuously in vendor/[vendor].  Meanwhile the official doc page on the Magento file system say "information will be added later".

Which is correct? What's the history -- did this change at some point?  Can I read docs that refer to app/code and just do the same thing in vendor/?


texts: Reviews Grid Listing, Reviews Edit Form and Reviews New Form are not showing in admin Magento2.2.2

texts:
After logged in admin I can't see reviews listing. Also in product edit page in admin review listing not showing. Any one know what is the solution?

Log File Showing Error Below

  [2018-07-24 06:25:27] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http://localhost/magento2/admin/review/product/index/key/33716591056fa74ee620fcd6424973062b37f27da9b6fe33cc1bcab69a9e5ba0/","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []

  [2018-07-24 06:30:49] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []


texts: Magento 2 change default store view programmatically

texts: i have console command that is creating store views and setting different languages for them. I want to have second console command that can change the default store view of the store. How can i do this ?


texts: Custom Currency validation - Magento using validate.js

texts:
I am looking for a way to all for custom currency validation using native magento validate.js

I have a form which allows users to add custom prices to a text field. I am using the following classes to validate the inputs:

validate-digits-range

digits-range-1-10

The problem is the text field is pre-populated with the currency sign £ so will not pass validation.

I have tried to adapt the validate-currency-dollar class but the test still fails

Validation.add('validate-currency-dollar', 'Please enter a valid $ amount. For example $100.00.', function(v) {
    // [$]1[##][,###]+[.##]
    // [$]1###+[.##]
    // [$]0.##
    // [$].##
    return Validation.get('IsEmpty').test(v) ||  /^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(v)
});

Has anyone done this before can share some advice please?


texts:
I am using this below code for check customer exist in database or not. it's working fine but it reload the page. can anyone suggest some ajax for reloading

<?php //print_r($_POST['email']);

 echo $email=$_POST['email'];
$con = mysql_connect("localhost","root","password");

   if (!$con)
  {
     die('Could not connect: ' . mysql_error());
  }
       mysql_select_db("magento", $con);

        $sql = "SELECT `email` FROM `customer_entity` WHERE `email`='".$email."'" or die(mysql_error());
       $select = mysql_query($sql,$con);

       $result=mysql_fetch_array($select);

      echo $row = mysql_num_rows($select);

            if ($row > 0)
          {
            echo 'This email Id is already exixst';
          }
             else
          {
             echo 'unavailable';
          }
?>
        <form id="myform" name ="myform" method="POST">
                <input STYLE="WIDTH: 68%;MARGIN-LEFT: 12%;background-color: white;" placeholder="Email Address" type="email" name="email" id= "email" class="input-text " required />

                <button class="button" onclick="emailcheck();"/> <?php echo $this->__('Submit') ?> </button>
        </form>


texts: Remove top menu from product and product display page?

texts:
I am trying to remove top menu from product and product display page. I created local.xml file and added below code.

<?xml version="1.0" ?>
<layout version = "0.1.0">
    <default>
        <catalog_category_default>
           <reference name="header">
              <remove name="top.menu" />
           </reference>
        </catalog_category_default>
    </default>
</layout>

But this is not working. How to remove? what is wrong in this code?


texts: Static block doesn't get cached correctly between SSL and non-SSL

texts:
I'm having an issue where I insert an image into a static block using the WYSIWYG editor. This results in an image tag like this:

<img src="{{media url="image.jpg"}}" />

The problem is that with block caching enabled the block doesn't get cached individually for SSL and non-SSL pages. I.e. if I visit a non-SSL page first and visit the same page again with SSL enabled the src attribute will contain a non-SSL link resulting in the respective warnings (and no green padlock).

This works perfectly fine when the block caching is disabled.

I dug into this and discovered that Magento doesn't seem to generate separate cache ids for SSL and non-SSL requests. I did the following change:

--- app/code/core/Mage/Cms/Block/Block.php      2016-10-12 13:55:55.823302409 -1000
+++ app/code/local/Mage/Cms/Block/Block.php     2016-10-13 08:39:48.307225894 -1000
@@ -86,6 +86,7 @@
                 'CMS_BLOCK',
                 $blockId,
                 Mage::app()->getStore()->getCode(),
+                (int)Mage::app()->getStore()->isCurrentlySecure(),
             );
         } else {
             $result = parent::getCacheKeyInfo();

That fixes the problem. I don't think that this is the correct solution though as this would mean that SSL would be broken for all existing Magento installs (checked 1.9.3 code). Does anybody have an idea what I'm missing here?

Currently running 1.9.2.1 fully patched.


texts: Magento2 save Custom shipment field by API

texts:
I have add field track_url in table sales_shipment_track.
I'm creating shipment with API

http://192.168.0.105/magento2/project/rest/V1/order/1292/ship

{
  "items": [
    {
      "order_item_id": 4473,
      "qty": 1
    }
  ],
  "notify": true,
  "tracks": [
    {
      "track_number": "3456789",
      "track_url": "http://192.168.0.105/demo/magento2?gf=13131",
      "title": "GEODIS",
      "carrier_code": "custom"
    }
  ]
}

everything was working fine before added new field track_url.

Now i'm getting error.
"message": "Property \"TrackUrl\" does not have corresponding setter in class \"Magento\\Sales\\Api\\Data\\ShipmentTrackCreationInterface\".",

How can i add extension attribute for it?
EDIT
I have add attribute in extension_attributes.xml.How can i save it with API?

    <config>
    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="dpd_relay_id" type="string"/>
        <attribute code="erp_exported" type="string"/>
    </extension_attributes>

    <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface">
        <attribute code="finalprice" type="string"/>
        <attribute code="brand" type="string"/>
    </extension_attributes>

     <extension_attributes for="Magento\Sales\Api\Data\ShipmentTrackCreationInterface">
        <attribute code="track_url" type="string"/>
    </extension_attributes>

</config>


texts: Remove "Add to Cart" Button For All Frontend Pages

texts:
How to Remove "Add to cart" Button On all Frontend Pages And also want to know when "Add to cart" Button is Removed then Buyer Can Checkout or not?

I am using Magento 1.9.2.3 version.


texts: Best place to store files such as pdfs to include on product pages?

texts: I want to store PDFs that can be opened up from product pages, where would the best location be to store them?


texts: Why is DI working in controller but not in Blocks?

texts:
I was trying my hand on Magento 2. I am able to get the checkout session data inside a controller by injecting \Magento\Checkout\Model\Session $checkoutSession, in controllers construct method.

But when I try to do the same in a Block class, Im unable to get any data from check out session.

<?php
namespace Company\Hello\Block;

class Main extends \Magento\Framework\View\Element\Template
{
    protected $_checkoutSession;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Company\Hello\Model\Test $model,
        \Magento\Framework\App\Request\Http $request,
        \Magento\Checkout\Model\Session $checkoutSession
    )
    {
        $this->_model   =   $model;
        $this->_request =   $request;
        $this->_checkoutSession = $checkoutSession;
        parent::__construct($context);
    }
    protected function _prepareLayout()
    {
        // print_r($this->_request->getParams());
        // exit;
        // $this->_model->getDbData();
        $this->setCntnt(__('Hello World 2.0'));
    }
    public function getAddedProduct()
    {
        foreach ($this->_checkoutSession->getQuote()->getAllVisibleItems() as $item) {
            echo $item->getName();
        }
        exit('block class');
    }
}

Whereas I am able to access the object ($this->_checkoutSession) but can't get any value.

  I call the method getAddedProduct() in the template file

can someone clarify this please?


texts: Editing and updating address in profile creates a new address

texts:
Steps to create:
1. Log in to account.
2. Go to profile and select edit existing address
3. deselect country and update.
4. Observer error message will be displayed and state, city field are blank.
5. change the pincode, check state and city fields takes values.
6. click on update.
7. Observe a new address is created

Is this is default feature? how to solve it?


texts:
I'm running Magento 1.9 and the site is fully setup and running, now I'm getting the following error.

  Error in file:
  "/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php" -
  SQLSTATE[42S01]: Base table or view already exists: 1050 Table
  'eav_entity_type' already exists

Trace:
#0 /app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.1')
#2 /app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.1')
#3 /app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /index.php(87): Mage::run('', 'store')
#8 {main}

After cache builds up the above error becomes

Fatal error: Cannot access property Mage_Core_Model_Resource_Website_Collection::$_model in /app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php on line 430

How can I fix this, it appears to be trying to re-install.


texts: My template file for a custom block isn't showing?

texts:
Edit: Slightly better understood

If I attempt to load my block from inside the module's default.xml it doesn't work, if I load it from Magento_Theme's default.xml layout file then it appears on the page?

Edit: I have it working but don't know why.

It depends on the container. If I reference a container and then add my block inside that it displays.

If I place my block just in  it does not display.

All of the following paths are in the app/code directory.

I simply want to display my template file on the page, and it isn't showing. The module is enabled, cache cleared, grunt clean... still nothing.

Template: Website/Product/view/frontend/templates/phtml/header.phtml
Template file content:

Testing, testing, testing

Layout file: Website/Product/view/frontend/layout/default.xml
Layout file content:

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

        <block class="Magento\Framework\View\Element\Template" name="webproduct" template="phtml/header.phtml"/>

</page>

Website/Product/etc/module.xml
Content:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Website_Product" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>

Website/Product/registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Website_Product',
    __DIR__
);

Things I've tried:

replacing template="phtml/header.phtml" with template="Website_Product::phtml/header.phtml" in layout.xml


texts: How to get current category using session, without using registry

texts:
I see that using the registry is being deprecated. There is not much documentation on an alternative but have seen one example from Atwix using Magento\Catalog\Model\Session - https://www.atwix.com/magento-2/alternatives-for-deprecated-registry-class-magento-2-3/. I have not been able to make this work and looking for some guidance. I do like the idea of using a service class.
My requirements is to add a block to a category page. The block will get the current category ID of the page and then look up its child categories. I would like to have a viewmodel that uses a service class to get the current category. I do realize I will also need a block class as well to set the cache key so caching is specific to the respected page.
Is Magento\Catalog\Model\Session the best method to get current page category? Please include code examples.


texts: Is there a way to make the price display in the same line with Magentos RWD theme?


texts: How to set magento order shipping method?

texts:
I am trying to set the shipping merthod in programatically created orders to a custom shipping method, here is a sample of my code...

setTelephone($shipping[Phone]);
// ->setFax($shipping->getFax());

$order->setShippingAddress($shippingAddress)->setShipping_method('flatrate_flatrate');

what am i doing wrong ?


texts: Magento2 - How to get current website id in Frontend?

texts: How to get current customer website id in Magento2.3 frontend, to precise in customer_register_success observer.


texts: left bar is not showing any content in it just showing the place of

texts:
Here is my local.xml file code:

<catalog_category_default>
    <remove name="catalog.leftnav"/>
</catalog_category_default>

<catalog_category_layered>
    <remove name="catalog.leftnav"/>
</catalog_category_layered>
<tag_product_list>
    <remove name="left.permanent.callout" />
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>
    <reference name="breadcrumbs">
        <action method="addCrumb" translate="crumbInfo.label crumbInfo.title">
            <crumbName>Home</crumbName>
            <crumbInfo>Home<title>Home</title><link>../../</link></crumbInfo>
        </action>
        <action method="addCrumb" translate="crumbInfo.label crumbInfo.title">
        <crumbName>Tags</crumbName>
            <crumbInfo>Tags<title>Tags</title><link></link></crumbInfo>
        </action>
    </reference>
</tag_product_list>

and it is sourcing the left bar from frontend/mgstheme/default/template/mgs/mpanel/template/layout/category/left.phtml But i have active theme frontend/mgstheme/luxury/.....

And this is my local.xml file:
https://drive.google.com/file/d/0ByQ1WRjkUEDudHhDel9Va0J4OGc/view?usp=sharing

Also see the attached screenshot, it is not showing any thing in left bar. i need to add layered navigation in left section.

Please advice.


texts: get customer details from observer event 'checkout_submit_all_after'

texts:
I am trying to get the customer object from the  checkout_submit_all_after

This is the observer event for when the customer registers as new customer while also making a purchase. i.e on the one page checkout

i am able to catch the event in my method.

my only issue now is how to get the customer object .

i tried this but  it came up with null.

$observer->getEvent()->getCustomer()


texts:
I want to show a popup phtml based on wether a cookie has been set or not in my block class.

The logic is roughly:

class Popup extends \Magento\Framework\View\Element\Template
{
    public function shouldShowPopup()
    {
        if ($this->cookie->get()) {
            return false;
        }
        return true;
    }
}

Then in the phtml:

if ($block->shouldShowPopup() ) {
    echo 'HTML Content here';
}

My issue is that shouldShowPopup() seems to be caching, so I'm getting inconsistent results.

Is there a way to mark this so as not to be cached? I have tried

<argument name="cache_lifetime" xsi:type="number">0</argument>

which doesn't have any effect and also:

<block class="Block\Class" name="blockname" cacheable="false" />

which removed the cache from the whole page.

If (like I have read elsewhere) this is not possible, should this logic be implemented somewhere more suitable outside of the block class?


texts: Magento 2 API - /default vs. /all vs. /{none}

texts:
I would like to understand what's the difference between those 3 endpoints

https://magento2.host/index.php/rest/V1/integration/admin/token
https://magento2.host/index.php/rest/default/V1/integration/admin/token
https://magento2.host/index.php/rest/all/V1/integration/admin/token

Thank you.


texts: Magento 2 sales_order_invoice_pay fired on order placed

texts:
I need sales_order_invoice_pay as observer for add some amount after first order invoiced.
But this observer fired when order placed. Did we have any Magento bug or am going wrong?

 <event name="sales_order_invoice_pay">
    <observer name="reagent_add_amount_wallet" instance="Company\Reagent\Observer\AddAmountToWallet"/>
</event>


texts:
What is the consensus on KeepAlive being on with a high traffic Magento site?  It seems most people recommend having it on but then Magento states to leave it off in their Maximizing Performance and Scalability
with Magento Enterprise Edition, they claim

"When a web server is under a heavy load, keeping
persistent connections becomes disadvantageous, thus
the KeepAlive directive should always be disabled"

Thoughts?


texts: How to change font size of a widget title in magento 2?

texts: I am rendering a Catalog Products List Widget to my Homepage. The title of the Widget is getting displayed over the product list, but it's far too small for my liking. How can I change the font-size or font-family of that title?


texts: Remove second price from frontend display

texts:
Ok so I have a few products that have tier pricing enabled for, the thing that is annoying me is that on the product catalog page when I click the category that it's in it has 2 prices displayed.

For example I have one product with 3 tiers of pricing.  Say $40 is the normal price, $35 if you buy 2 of them, and $25 if you buy 3.  On the category page it would show $40 on top and $25 underneath that.  How do I remove the $25 dollar price and just keep the main price?


texts: Simple Extension Creation One error a:4:{i:0;s:60:"Module "Magentostudy_News" requires module "Mage_adminhtml".";i:1;s:772:"#0

texts:
I Create a simple extension. It can Be Error.
a:4:{i:0;s:60:"Module "Magentostudy_News" requires module "Mage_adminhtml".";i:1;s:772:"#0

I Create Folder In local/Magentostudy and local/News

My app/etc/modules create Magentostudy_News.xml file  code here

    <?xml version="1.0" ?>
<!--
/**
* Module initial config
* @author Magento
-->
<config>
        <modules>
            <Magentostudy_News>
            <active>true</active>
            <codePool>community</codePool>
            <depends>
                <Mage_adminhtml/>
            </depends>
            </Magentostudy_News>

        </modules>
</config>


texts: Magento 2: Filter Product Collection using Category Id always return empty set

texts:
I have a parent category with subcateogry that contains a lot of product in it, when i tried to filter the product collection using this parent category id, it always return an empty collection:

public function __construct(
   \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
){
   $this->_productCollectionFactory = $productCollectionFactory;
}

public function execute(){
   $collections = $this->_productCollectionFactory->create();
   $collections->addAttributeToSelect('*');
   $collections->addCategoriesFilter(array('in' => array(1400)));
   die($collections->getSize()); // always return 0
}

then i tried to print the collection sql query using $collections->getSelect()->__toString(), and it prints:

SELECT 1 AS `status`,
       `e`.`entity_id`,
       `e`.`attribute_set_id`,
       ....
       `e`.`visibility`,
       `e`.`weight`,
       `e`.`weight_type`
FROM   `catalog_product_flat_1` AS `e`
WHERE  ( e.entity_id IN((SELECT `cat`.`product_id`
                         FROM   `catalog_category_product` AS `cat`
                         WHERE  ( cat.category_id IN( '1400' ) ))))

it uses the catalog_category_product table to relate the product and category, but when i check the table in DB, the table has 0 records

i already run php bin/magento indexer:reminded , but still getting the same result


texts: get error code of #10415 in paypal in magento

texts:
got following error massage in paypal of magento.

"PayPal gateway has rejected request.A successful transaction has already been completed for this token (#10415: Transaction refused because of an invalid argument. See additional error messages for details)."

can anyone help me to solution about it.

I checked paypal details its perfect.


texts: Magento 2.3 Bundle product - Display always the out of stock products

texts:
I have a bundle product with a dynamic price and I want to show always the price summary of the products that are part of the bundle.
Example:
Bundle Product
Options
product 1 = price 50 | in stock
product 2 = price 30 | in stock
product 3 = price 20 | in stock

Price of the final Bundle Product = 100
Now when a product is out of stock then the price changes from the products are in stock.
Example:
Bundle Product
Options
product 1 = price 50 | in stock
product 2 = price 30 | in stock
product 3 = price 20 | out of stock

Price of the final Bundle Product = 80
I want to show always the final price (100) but I can't remove the dynamic price option because we want each product to be invoiced in the tax rule that belongs.
Can you help me?


texts: I am having an issue with transactional emails on Magento 1.9. Order confirmation emails are not sending. Can anyone help?


texts: why load() is different from loadByIncrementId() for sales/order model

texts:
I am getting order details through sales/order by using load(order_id). But load does not give the data, but loadIncrementById() returns the order data.

What is the difference between these load() and loadIncrementById()?and which situation these are used?

Is all model can be extracted by using these methods?


texts: how to add weight for configurable product?

texts:
in code

$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'packsize');
 foreach ($attribute->getSource()->getAllOptions(true, true) as $instance)
 {
         $myArray[$instance['value']] = $instance['label'];

 }
 print_r($myArray = $instance['label']);

i want to show a packsize retrive from database.


texts: How to use p12 certificate to authenticate rest api using zend http client?

texts: How can I use p12 file/cert to authenticate to REST API using zend http client? I'm not sure how can I send request and attach that kind fo certificate.


texts: I have problem with entering admin page. Magento shows 404/not found error when I open backend. I have already tried Magento 404 on Admin Page. But no result. Help me pls.


texts: Magento Override Model Resource Category Tree file

texts:
Trying to override app\code\core\Mage\Catalog\Model\Resource\Category\tree.php with config.xml

<global>
  <models>
    <catalog_resource>
      <rewrite>
         <category>Namespce_Modulename_Model_Resource_Category_Tree</category>
      </rewrite>
    </catalog_resource>
 </models>
</global>

and my class is defined in folder   local\Namespce\Modulename\Model\Resource\Category\Tree.php

class Namespce_Modulename_Model_Resource_Category_Tree extends Mage_Catalog_Model_Resource_Category_Tree
{
  here is functions and code
}

it gives error  Call to undefined method

  Namespce_Modulename_Model_Resource_Category_Tree::checkId() in
  app\code\core\Mage\Catalog\Model\Category.php on line 671

While it is working fine if we put folder path in locally
app\code\local\Mage\Catalog\Model\Resource\Category

Please help me anybody.


texts: Magento 2 How to hide configuration field with a condition?

texts:
I have the following configuration field:

I'm using a backend_model and frontend_model for rendering this field with two options.

How can I disable it with a condition? What should I use?


texts: Dependency Injection? Do not understand it, can anyone help?

texts:
I started to use Magento 2.x and noticed that the Mage "API" is no longer a reality, and red about dependency injection and factory but I did not understand what it is, what it does or where I write its code (path).

Can anyone help?

Thanks in advance.


texts: Super product attributes sorting order in configurable products

texts:
I am using magento 1.9.2.3 version.

I have three (color, contrast and size) attributes for creating the products.

when i am going to create a new configurable product system load the attributes by id like (color, size and contrast) buy my client requirements is load the by default attribute by its position like (color, contrast and size).

Can anyone let me know how can i do this?

thank you so much.


texts:
I've created a custom Magento 2 Module and I am facing a problem of URL returning blank page If I am calling the block from template file using layout

Magento Version : 2.2.4

URL Trying to visit : 127.0.0.1/magento/whatsapp/index/display

It returns a blank page.

here is my files structure:

Mahran/Whatsapp/Block/Display.php

<?php
namespace Mahran\Whatsapp\Block;
class Display extends \Magento\Framework\View\Element\Template
{
    public function __construct(\Magento\Framework\View\Element\Template\Context $context)
    {
        parent::__construct($context);
    }

    public function sayHello()
    {
        return __('Hello World');
    }
}

Mahran\Whatsapp\Controller\Index\Display.php

<?php

namespace Mahran\Whatsapp\Controller\Index;

class Display extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory)
    {
        $this->_pageFactory = $pageFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
        return $this->_pageFactory->create();
    }
}

Mahran/Whatsapp/view/frontend/layout/whatsapp_index_display.php

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="content">
        <block class="Mahran\Whatsapp\Block\Display" name="whatsapp_display" template="Mahran_Whatsapp::sayhello.phtml" />
    </referenceContainer>
</page>

Mahran/Whatsapp/templates/frontend/templates/sayhello.phtml

<?php

/**
 * @var \Mahran\Whatsapp\Block\Display $block
 */

echo $block->sayHello();


texts:
As per the Magento documentation, we can create custom directive like {{var}} {{if}} {{depends}}
using this documentation https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/templates/template-email-migration.html#abstraction-example.
We are using filters like nl2br, escape, raw So, Is it possible to extend the filters also? for eg. strtoupper to convert all things In upper case.
UPDATE

etc/di.xml

 <type name="Magento\Framework\Filter\DirectiveProcessor\Filter\FilterPool">
     <arguments>
         <argument name="filters" xsi:type="array">
             <item name="capitalize" xsi:type="object">Vendor\Module\Model\CapitalizeWord</item>
         </argument>
     </arguments>
 </type>

CapitalizeWord.php

 <?php
 namespace Vendor\Module\Model;
 use Magento\Framework\Filter\DirectiveProcessor\FilterInterface;
 class CapitalizeWord implements FilterInterface
 {
     public function getName(): string
     {
         return 'capitalize';
     }
     /**
     * @inheritDoc
     */
     public function filterValue($value, array $params): string
     {
        return ucwords($value);

     }
 }


texts:
Duplicate

Context: I've read all the similar questions (tried all the chmod stuff) and tried looking at magento logs, but there isn't anything that gets rid of this.

Seems like there is a error somewhere that is stopping us from creating the uploaded image.

Error Message:

A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

Magento Logs:

Nothing

Apache Logs:

AH01630: client denied by server configuration: /var/www/html/app/etc/config.php


texts: add custom tab to magento product detail page

texts:
i want to add custom tab in frontend product detail pages, just next to short desc and want to show some content there, can i do this via

like detail, product tags, review, mycustom tab here

1: admin catalog > catagory custom design

2: via any module ?

i tried below code in custom layout update:

<action method="addTab" module="catalog" translate="title">
    <alias>info</alias>
    <title>Info</title>
    <block>catalog/product_view_attributes</block>
    <template>catalog/product/view/a.phtml</template>
</action>


texts: How to set value to taxvat in the Magento SOAP API?

texts:
I need to set value to the taxvat field, the value needs to be the value from another field from my request.

For example:

When the client make request, all fields about taxvat needs to display the value from 'customer_cpf'.

I try this:

Function getAllowedAttributes from Mage_Customer_Model_Api_Resource

public function getAllowedAttributes($entity, array $filter = null)
{
    $attributes = $entity->getResource()
                    ->loadAllAttributes($entity)
                    ->getAttributesByCode();
    $result = array();
    foreach ($attributes as $attribute) {
        if ($this->_isAllowedAttribute($attribute, $filter)) {
            $result[$attribute->getAttributeCode()] = $attribute;
            $result['taxvat'] = '080.443.119-33';
        }
    }

    return $result;
}

I try to set taxvat with '080.443.119-33', but not works. Any idea?


texts: Disable cart sharing for different Stores

texts: I'm running a Magento 1.9 CE shop with two different stores (each store has two StoreViews) and I'd like to disable the cart sharing feature. So when I switch from one store to the other store, the product in my cart shouldn't be valid or deleted. How should I solve this situation?


texts: Connecting Module to External Database fails to execute Resource

texts:
I have followed http://www.solvingmagento.com/accessing-an-external-database-from-your-magento-module/ and articles by Alan Storm and am stuck on connecting a Magento Module to an external database. [Mage/Core version in 1.6 on this project].

I think the configuration appears correct, but I can't get data to the screen. Instead, actual php code is being displayed. Specifically, the whole Resource class is being displayed.

Here is the relevant controller, model, model resource, and config snippet.
I am not sure of the Resource model which should be extended, that may be the problem, but maybe there is something else too?

My Controller

public function indexAction()
{
    echo "
 Connecting Magento to Developer Store!
";

    $externalDataRead = Mage::getModel('developer_integration/customer');
    $externalDataRead->load(1, 'user_id');

    echo '
';
    print_r($externalDataRead->getData());
    echo '
';
 }

My Model

class Developer_Integration_Model_Customer extends Mage_Core_Model_Abstract
{
     protected function _construct()
     {
         $this->_init('developer_integration/customer');
     }
 }

My Model Resource

class Developer_Integration_Model_Resource_Customer extends Mage_Core_Model_Resource_Type_Db_Pdo_Mysql
{
        protected function _construct()
    {
        $this->_init('developer_integration/customer', 'user_id');
    }
}

My config.xml (this may not appear well-formatted here, but is in file)

 <models>
   <developer_integration>
      <class>Developer_Integration_Model</class>
      <resourceModel>developer_integration_resource</resourceModel>
   </developer_integration>
  <developer_integration_resource>
    <class>Developer_Integration_Model_Resource</class>
    <entities>
      <customer>

dev_customer

      </customer>
    </entities>
  </developer_integration_resource>
</models>
<resources>
   <developer_integration_setup>
     <connection>
       <host><![CDATA[localhost]]></host>
       <username><![CDATA[devuser]]></username>
       <dbname><![CDATA[dev_store]]></dbname>
       <type><![CDATA[pdo_mysql]]></type>
       <active>1</active>
     </connection>
   </developer_integration_setup>
   <developer_integration_write>
     <connection>
       <use>developer_integration_setup</use>
     </connection>
   </developer_integration_write>
   <developer_integration_read>
     <connection>
       <use>developer_integration_setup</use>
     </connection>
   </developer_integration_read>
 </resources>


texts: How to change Order-Status with custom-order-status(Ready To Dispatch) using rest API in magento 2.1?

texts: I have one custom order status(Ready To Dispatch).I want to change order-status of order using rest api.Please help me i don't know what api is used?


texts: Elasticsearch not returning all matched products

texts:
I have enabled Elasticsearch for my store in Magento 2.2.4.

When searching for a particular product with Elasticsearch enabled, 20 products are returned. When I turn off Elasticsearch and switch back to the standard MySQL search, 55 results are returned. This pattern is mirrored throughout the entire product catalog, regardless of the particular product in question.

Furthermore my live installation also returns different results to my local installation even though the same database is being used.

I wonder if anyone has experienced this kind of pattern when using Elasticsearch and has any idea what could be possible cause of this.


texts: Adding custom method to product collection

texts:
What is the best way to add some method to for example product collection?

I would like to add method which can be called on loaded collection (in fact it will be a filtering one for products that doesn't have any category assigned). The best will be situation if I want to use it I still inject Magento collection class, not mine - I guess it is possible with use of dependency injection.
I have \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory and also \Magento\Catalog\Model\ResourceModel\Product\Collection - which one I should extend?


texts:
I'm having troubles in defining a new custom url in admin area.

Here is my routes.xml file, saved in /app/code/Vendor/Module/

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="unlock">
            <module name="Vendor_Module" />
        </route>
    </router>
</config>

Then I've created a custom button in the cart rule edit page

namespace Vendor\Module\Block\Adminhtml\SalesRule\Edit\Button;
use Magento\Catalog\Block\Adminhtml\Product\Edit\Button\Generic;
class Unlock extends Generic
{
    protected $request;
    protected $urlBuilder;

    public function __construct(
        \Magento\Framework\App\Request\Http $request,
        \Magento\Framework\UrlInterface $urlBuilder
    ) {
       $this->request = $request;
       $this->urlBuilder = $urlBuilder;
       }

    public function getUnlockUrl($id)
    {
        return $this->urlBuilder->getUrl('*/*/unlock', ['id' => $id]);
    }

    public function getButtonData()
    {
        $id = (int)$this->request->getParam('id');
        if ($id) {
            return [
                'label' => __('Unlock'),
                'on_click' =>  'deleteConfirm(' . json_encode(__('Are you sure you want to Unlock?'))
                    . ','
                    . json_encode($this->getUnlockUrl($id))
                    . ')',
                'sort_order' => 100
            ];
        }
    }
}

Button works, but when I click it Magento redirects to a 404 page. What is the correct url, giving the above code?
Do I making mistakes in using the getUrl() method?


texts: Determine MySQL Database used by Magento Installation

texts:
This question is probably fairly stupid but I installed a couple instances of Magento (for various reasons) and I made the MySQL database names very similar. In fact they only vary by some arbitrary numbering system I made up (and have since forgotten). All the installations have very few accounts, items, etc that were setup.

I'm wanting to do some house cleaning and get rid of the databases associated with installations I no longer use. Is there an easy way to figure out which is which or should I just back them all up and play roulette with the delete button?


texts:
Is there any debugging method for method magento 2 ? where we can find in which file there is actually problem occure, because making a simple spell mistake in xml file and its hard to find where is actually problem is.

Can we get file name or set break point for debugging ?

Any one have idea for this ?

Thanks


texts: How to set hidden field value in magento 2

texts:
I want to set hidden field value in my form UI component. Also, I want to pass that value from the data provider and set it in form UI component as that value would be dynamic.

I have set hidden field with data scope.

Now the question is I'm getting the value in data provider and passing it to form component but while submitting the form I'm getting nothing in request.

Please help for the same. Thanks in advance.


texts: Blank website after applying patches. What can i have done wrong?

texts:
I applied patches 5344 and 5994 though terminal (mac) and i got the response that they were successfully applied.

Than i went to my sites admin panel and i cleared all caches. After that the site was a blank page.

What could i have done wrong?


texts: Display Configurable Product from Simple/Virtual Product : Magento 2

texts:
Here, I'm Display Custom Product Collection Filter By Type => 'virtual'
I need Configurable Product With Selection of Attribute On Click Of That relavant Configurable Product Is Open With Selection of Particular Selected Attribute.


texts:
Please I did not understand this in documentation.

Running this command with the -f argument can fix issues regarding deployment of static content, but removes all symlinks and deploys the actual static content files.

It means about
bin/magento setup:static-content:deploy command

What does it means?

Thanks in advance


texts: wysiwyg edior giving error on image upload

texts:
I am New with the Magento and I am facing some problem when I try to upload Image through wysiwyg editor in admin panel then image is not uploaded and when
I press save button following error message appears

error: error in [unknown object].fireEvent():

event name: formSubmit

error message: tinyMCE.get is not a function

so please help me in this problem


texts:
Was there any solution to this? - Magento 2.2.2 Security Patch Issue

I have the same issue with PRODSECBUG-2233 on Magento 2.2.5 - Installed via composer and using composer version of patch.

When I install it says it can't find:

vendor/magento/module-sales/Helper/Admin.php
vendor/magento/module-sales/Test/Unit/Helper/AdminTest.php

Files are there in those directories. When I specify the files I get:

File to patch: vendor/magento/module-sales/Helper/Admin.php
patching file vendor/magento/module-sales/Helper/Admin.php
Hunk #1 FAILED at 6.
Hunk #2 succeeded at 27 (offset -4 lines).
Hunk #3 FAILED at 158.
Hunk #4 FAILED at 195.
3 out of 4 hunks FAILED

File to patch: vendor/magento/module-sales/Test/Unit/Helper/AdminTest.php
patching file vendor/magento/module-sales/Test/Unit/Helper/AdminTest.php
Hunk #2 succeeded at 324 (offset -6 lines).

The line ends on the patch and Admin.php match and Admin.php has not been altered from the original file in the 2.2.5 release. All other security patches have been applied so don't believe it's a missing patch that has previously altered admin.php unless someone can point me in the direction of a patch that's required?

I've been trying to match up the hunks to work out if it doesn't have enough context to know where to insert the code but I get a bit lost with how it's specified.

Patch hunk 1:

    @@ -6,6 +6,8 @@

 namespace Magento\Sales\Helper;

+use Magento\Framework\App\ObjectManager;
+
 /**
  * Sales admin helper.
  */

And admin.php line 6 to 11 as specified:

namespace Magento\Sales\Helper;

class Admin extends \Magento\Framework\App\Helper\AbstractHelper
{
    /**
     * @var \Magento\Sales\Model\Config

I'm guessing its the class Admin extends throwing it off?

There's meant to be 3 lines of context above and below right? if so then neither the top or the bottom of the hunk matches the original file so is this a bugged patch or am I going way of base?


texts: Magento2 Enterprise: Can we add Special Price From Date and Special Price To Date in Enterprise Edition

texts: i want to add Special Price From Date and Special Price To Date in Enterprise Edition.By default this feature is not available in E.E but available in C.E


texts:
In Magento 1.9.2.4, when I go to System > Configuration > Web > Secure and set Use Secure URLs in Frontend to Yes, when I click Save, the field is set back to No.

Before clicking save:

After clicking save:

My goal is to make the whole site use https. All Secure Base * URLs are set correctly:

There are no entries in the logs when this happens and there are no relevant script errors. I note that it says "Store View" next to the settings, however I've looked at the store views and website settings and they all say use the Default.

I also see the same problem with Use Secure URLs in Admin.


texts: Customize Madison Island(RWD) to use it for production

texts:
First of all I'd like to say that I'm new to Magento so be I may ask something that might not be wise!

I've been reading and following tutorials about Magento for two weeks now. Here are some of my questions that are specific, so please give me tips on how to go ahead.

Can I use the base theme of 1.9.2.1 RWD Madison Island for my production site and customize it?
I've followed this documentation , but I still can't figure out if I can edit the SASS files because of this notation on them.

// DISCLAIMER
//
// Do not edit or add to this file if you wish to upgrade Magento to newer
// versions in the future. If you wish to customize Magento for your
// needs please refer to magento for more information.

So how to go further with customizing RWD theme?

I just want to change some very basic things in this theme and use it for my production website. I don't want it to be more functional and beautiful than what this theme already is.

thank you in advance.


texts: How to add template in Custom Variable HTML Value in magento

texts:
I have created a custom variable in magento. But I want to call a template file for this variable value.

For this I am using

{{block type="core/template" template="custom/my.phtml"}}

in Variable HTML Value field.

But when adding this variable in any email template like {{customVar code=my_var}} then print

{{block type="core/template" template="custom/my.phtml"}}

as it is.

How to add a template file in custom variable HTML value?


texts:
I have a problem, one of our categories is showing a wrong number of products. When I go to categories in the backend the number stands on 164 products. When I look at the products tab, there are only 22 products selected.
This wouldn’t have bothered me if the frontend showed me the 22 selected products, but it shows 128 products.

Has anybody heard of this problem before and (how) were you able to fix it?

Thanks in advance.


texts:
In Magento 1, as a module developer it's possible to change a block's template using layout XML code something like this

<reference name="block_to_change">
    <action method="setTemplate">
        <param>/path/to/template.phtml</param>
    </action>
</reference>

and then adding your template to the base theme.

app/design/frontend/base/default/template/path/to/template.phtml

Is it possible, as a module developer, to do something similar in Magento 2? Or would I need to use layout XML or PHP code to remove the block I'm interested in, and insert a new block with a different template (whose class extends the original block class's)

I know I could create a custom theme that replaces a template, but I'm interested in creating a module that changes the default template, but still allows a custom theme to then replace that template.


texts:
Ciao a tutti,

dopo l'installazione di magento, il mio sito mi restituisce l'errore sotto:

Fatal error: Class name must be a valid object or a string in /var/www/vhosts/nomedominio.it/httpdocs/app/code/core/Mage/Core/Model/Resource.php on line 215

E' capitato a qualcuno?
Di cosa puo' trattarsi?

Grazie 1000 :)

English translation (somewhat):
Hello all,

After installation of magento, my website gives the following error:

Fatal error: Class name must be a valid object or a string in /var/www/vhosts/nomedominio.it/httpdocs/app/code/core/Mage/Core/Model/Resource.php on line 215

Has anyone seen this before? What causes this?

Thanks a million.


texts:
I'm getting the following error after paypal payment

  PayPal gateway has rejected request. A successful transaction has
  already been completed for this token (#10415: Transaction refused
  because of an invalid argument. See additional error messages for
  details).

Checkout: onepage

The error occurs only if the cart contains virtual product (services and downloadable). If I add a "physical" product all works fine.
When I get the error, Paypal complete the payment but Magento did not create the order.


texts: How to create autocomplete on click on textbox in magento2.3.5

texts:
I want to create a dynamic textbox and using the id attribute to use autocomplete functionality in this. I have Developed a dynamic id for each textbox on click of add Item button and my id is provided like this "textbox" + counter and I want to marge text box counter as textbox1. So can anyone having an idea about this then please share it with me.
'textbox' + counter as textbox1

Thank you in Advance.


texts: how to set group by and order by for custom model collection query in magento 2.3.4

texts:
$Custommodel=$this->mycustommodelFactory->create();

$collection = $Custommodel->getCollection()->addFieldToFilter("customer_id",$customerid);

$collection->getSelect()->group('product_id')->order("viewed_date DESC");

while implement this way i getting wrong ordered records

what mistake there??

  here this query runing magento SELECT main_table.* FROM wac_viewed_products AS main_table WHERE (customer_id = '4') GROUP BY product_id ORDER BY viewed_date DESC


texts:
How can I do a currency converter in Magento Community edition 1.8? Does Magento has this functionality by default or do I have to developed it?

I need to show a second currency in on each of my product page (in parentheses) when you select a currency option from the converter's dropdown.

it is like this store in Euro currency and I can get it converted to Pound,

Is it possible?


texts: Redirecting to different URL's after restoring the site on local

texts:
We have a development server to test our code changes before pushing them to live. Recently, we have restored the development server to local (xampp) for testing and also done the necessary changes to the core_config_data in database.

Though we have done the changes in core_config_data, most of the products still redirecting to the development server instead of showing them as a localhost URL. Hope you got my point.

I can understand that I have missed something but I don't know what it is.

Can anyone please help me to resolve this issue?


texts: Magento SEO Pagination like /page/2 instead of ?p=2

texts:
i am trying to play around with pager.phtml, basicaly i do not like the ?p=2 etc that magento use.
I have come through this code that will change the pagination to what i want but this brings of course 404 pages as there is no /page/2 etc.
Should i use a rewrite rule?Can somebody point me on this?

    <?php
    $url=   ($this->getCurrentPage()==1)?
    $this->getPagerUrl(array($this->getOrderVarName()=>$order,  $this->getDirectionVarName()=>$direction,$this->getPageVarName()=>null )).'/':
    $this->getPagerUrl(array($this->getOrderVarName()=>$order,  $this->getDirectionVarName()=>$direction,$this->getPageVarName()=>null )).'/';
     echo $this->__('Page:') ?>

    <?php if (!$this->isFirstPage()): ?>

            <a class="previous<?php if(!$this->getAnchorTextForPrevious()): ?> i-previous<?php endif;?>"
            href="<?php echo $url.'p='.($this->getCurrentPage()-1);?>" title="<?php echo $this->__('Previous') ?>">
                <?php if(!$this->getAnchorTextForPrevious()): ?>
                    <img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.png') ?>" alt="<?php echo $this->__('Previous') ?>" class="v-middle" />
                <?php else: ?>
                    <?php echo $this->getAnchorTextForPrevious() ?>
                <?php endif;?>

    <?php endif;?>
    <?php
    $pages_Num= ($this->getTotalNum()%$this->getLimit())?(($this->getTotalNum()/$this->getLimit())+1):$this->getTotalNum()/$this->getLimit();
    for($_page=1;$_page<=$pages_Num;$_page++){
        if($this->getCurrentPage()==$_page) echo '
'.$_page.'
';
        else    echo '
'.$_page.'
';
    }
    ?>
    <?php if (($this->getCurrentPage()+1)<$pages_Num): ?>

<a class="next<?php if(!$this->getAnchorTextForNext()): ?> i-next<?php endif; ?>"
        href="<?php echo $url.'p='.($this->getCurrentPage()+1);?>" title="<?php echo $this->__('Next') ?>">
                <?php if(!$this->getAnchorTextForNext()): ?>
                    <img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.png') ?>" alt="<?php echo $this->__('Next') ?>" class="v-middle" />
                <?php else: ?>
                    <?php echo $this->getAnchorTextForNext() ?>
                <?php endif;?>

    <?php endif;?>


texts:
I am new to magento and following tutorials, but i am stuck while trying to use layout.xml, it seems like it is not removing items which i mentioned.

<?xml version="1.0"?>
<layout>
    <default>
            <remove name="page_content_heading" />
            <remove name="global_notices" />
    </default>
</layout>

My file structure is as following,

app
--frontend
----boot (theme name)
------layout (local.xml reside here)
------templates

skin
--frontend
----boot (theme name)
------css
------js

Not even my <action> tag would work while i add js or css. Am i doing something wrong?

Edit: I cleared the cache, disable it and even delete my browser cache.


texts: Any event available for backend to run a function in every page- Magento 2?

texts: In Magento2,is there an event-observer available for the backend to run a function on every page?


texts: What is the difference between Sales Tax and Tax in Orders Report?

texts:
Do you guys know what is the difference between Sales Tax and Tax columns in Orders report in Magento? This is confusing since both are different values. (attached screenshot)

Maybe the same applies to Sales Shipping and Shipping?

Also do the refunded column also include VAT?


texts: Magento 2.3 wrong image cache generation

texts:
I have upgraded my Magento EE store from 2.2.7 to 2.3.2. An issue occurred of images not showing on product pages.

I debugged a bit and ran the command "catalog:image:resize" and images appeared. But when I flush catalog images cache from admin, the issue appeared again.

I think the images cache is not generating. The permission for pub/media are also 777.

Also the product images are appearing on category page but not on product page.


texts: Delete custom EAV attributes from the database

texts: I want to remove unused EAV attributes directly from the database before I move my store live. Attributes can be found in eav_attribute table, can I delete attributes from this table? Is it safe? Or do I also need to edit other EAV tables?


texts: Remove JS files from beeing loaded through require-js

texts:
I am optimizing the page speed of my Magento 2 frontend.
Everything is logically so far... CSS files can be removed through XML, everything should be minified, lazy loaded and so on.
BUT:
The size of all javascript files that are loaded is 12 MB (!!!).
That is insane, sorry.
There is so much unused crap loaded, like:

datepicker.js, timepicker.js, spectrum.js, tinycolor.js and so on... are just a few examples.
I know, the Magento 2 ui component / model structure is complicated, but how can i prevent all this JS files from beeing loaded?
They are not used and i have no idea, how to prevent this unneccesary bytes from destroying my complete page speed.
I just want to remove this JS-files or complete modules like removing CSS-files. Can anyone help me with an example?
Thank you.


texts: Is it right or wrong to create tables in the magento 2 database?

texts: Guys I'm new to magento development and I'm trying to learn how to create basic modules and I'm trying to create a module that registers some customer information and then returns it to the administrator on the panel. But a question arose, is it wrong for me to simply go to the database and create a new table for this? or is there another safer and more practical way?


texts: Magento 2: How can I use two blocks in my homepage?

texts:
How can I use two different blocks in my homepage?

this code doesn't work:

    <referenceContainer name="content">
     <block class="Magento\Cms\Block\Block" name="test1">
        <arguments>
            <argument name="block_id_1" xsi:type="string">slider-block</argument>
        </arguments>
    </block>
   <block class="Magento\Cms\Block\Block" name="test2">
        <arguments>
            <argument name="block_id_2" xsi:type="string">footer_col_1</argument>
        </arguments>
    </block>
</referenceContainer >


texts: SearchCriteriaBuilder->addFilters() using multiple filters

texts:
As per title.

This what I've done:

    $filterCode = new Filter();
    $filterCode->setField('SpecialCode')
        ->setValue('')
        ->setConditionType('null');
    $filterItemId = new Filter();
    $filterItemId->setField('ItemId')
        ->setValue('')
        ->setConditionType('null');

    $searchCriteria = $this->searchCriteriaBuilder
        ->addFilters([$filterCode, $filterItemId])
        ->create();
    $customItems = $this->customItemRepository->getList($searchCriteria)->getItems();

What I'm getting is a collection of items with NULL ItemID or NULL SpecialCode (or I have no idea what I'm getting), when what I want is more like this:

select * from ItemRepository where ItemId is null and SpecialCode is null;  //I'm pretty sure what I would get from this

How do I create multiple filters and set conditional ANDfor those filters?


texts: apply free shipping over $230 and discount over $100 on coupon code

texts:
Currently  I am offering free shipping over $130
Now I would like to give new offer. that was it apply free shipping over $230  and discount 14% over  $100 on coupon code

. But now problem is I don't want to give 1 offer to him who use 2 offer


texts: Website down: main.CRITICAL: SQLSTATE[28000] [1045] Access denied for user '(removed)'@'localhost' (using password: YES)

texts:
The following is the complete error in the log:

main.CRITICAL: SQLSTATE[28000] [1045] Access denied for user '(removed)'@'localhost' (using password: YES) {"exception":"[object] (Zend_Db_Adapter_Exception(code: 1045): SQLSTATE[28000] [1045] Access denied for user '(removed)'@'localhost' (using password: YES) at /home/(removed)/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144, PDOException(code: 1045): SQLSTATE[28000] [1045] Access denied for user '(removed)'@'localhost' (using password: YES) at /home/(removed)/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"} []

I have tried many solutions but nothing worked, can anyone help me with this?


texts: How to call controller method from another controller?

texts:
Created a model in which the form validation on the beck

  public function validation_form()
{
    $error = false;
    if (!Zend_Validate::is($name, 'NotEmpty')) {
        $error = Mage::getSingleton('core/session')->addError('Name is required');
    }
    if (!Zend_Validate::is($message, 'NotEmpty')) {
        $error = Mage::getSingleton('core/session')->addError('Message is required');
    }
    if (!Zend_Validate::is($subject, 'NotEmpty')) {
        $error = Mage::getSingleton('core/session')->addError('Subject is required');
    }
    if (!Zend_Validate::is($email, 'EmailAddress')) {
        $error = Mage::getSingleton('core/session')->addError('Email is required');
    }
    if ($error) {
        throw new Exception();
    }
}

And there is a method in the controller that adds data to the database.

 public function postAction()
        {
    $post = $this->getRequest()->getPost();
            if ($post) {

                $name = $this->getRequest()->getPost('name');
                $email = (string)$this->getRequest()->getPost('email');
                $phone = $this->getRequest()->getPost('phone');
                $user_agent = Mage::helper('core/http')->getHttpUserAgent();
                $remote_ip = Mage::helper('core/http')->getRemoteAddr();
                $subject = $this->getRequest()->getPost('subject');
                $other_subject = $this->getRequest()->getPost('other');
                $message = $this->getRequest()->getPost('message');
                $created_at = Mage::getModel('core/date')->date('Y-m-d H:i:s');
etc...

How to connect function postAction() to validation so that the variables "$name, $email, etc..." are available in the validation model.

Path to the controller mymodul/feedback/controllers/IndexController.php

Path to the validation mymodul/feedback/model/Validation.php


texts: Magento 2: How to get All the active shipping methods and shipping rate by ordered item in admin

texts: I have created a custom orderbycustomer module to get all order lists then open any order and select order item and click  Get shipping methods and rates button to get all active shipping methods with rate.


texts: Magento2 remove maintanace.html and maintenance.php from pub

texts:
I have Magento 2.3.1 instance and it is working perfectly for all inner pages instead of the home page.

when I trying to access the website with URL it is showing the maintenance page. but when I access my website followed by index.php it is working correctly.

In pub folder there are two files available "maintenance.html" and "maintenance.php". I tried with deleting both files it is showing now "404 not found" for the home page only. other pages working perfectly.

How can I solve this issue?

Thanks in advance!


texts: Magento 2.1: Is it possible to hide the drop down for store view change?

texts:
I just added one more store view in order to create set up a custom theme for a special URL. After I set everything up and view the home page, I realize that there is now a drop down that would let a user switch the view regardless of what URL I mapped to. Is there a button on the admin config to hide that drop down option or do I need to create a custom theme that override the block to hide it?

Thank you,


texts: I need to filter product collection by category id and color attribute

texts:
I need to get product collection by category id and color attribute. But It's not working.

Here is my code:

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$categoryFactory = $objectManager->get('\Magento\Catalog\Model\CategoryFactory');
$category = $categoryFactory->create()->load($cat_ids);
$categoryProducts = $category->getProductCollection();
$categoryProducts->addAttributeToSelect('*')->addAttributeToSort('position', 'ASC');
$categoryProducts->addAttributeToFilter('color', array('in',29));

Here my Sql query:

SELECT 1 AS `status`, `e`.`entity_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`created_at`, `e`.`updated_at`, `e`.`sku`, `cat_index`.`position` AS `cat_index_position`, `e`.`entity_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`area`, `e`.`cost`, `e`.`created_at`, `e`.`description`, `e`.`gift_message_available`, `e`.`has_options`, `e`.`image`, `e`.`image_label`, `e`.`is_facebook`, `e`.`is_facebook_value`, `e`.`links_exist`, `e`.`links_purchased_separately`, `e`.`links_title`, `e`.`msrp`, `e`.`msrp_display_actual_price_type`, `e`.`name`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`price`, `e`.`price_type`, `e`.`price_view`, `e`.`product_brand`, `e`.`product_items`, `e`.`required_options`, `e`.`select_delivery_time`, `e`.`select_delivery_time_value`, `e`.`select_price_label`, `e`.`select_price_label_value`, `e`.`select_units`, `e`.`select_units_value`, `e`.`short_description`, `e`.`sku`, `e`.`sku_type`, `e`.`small_image`, `e`.`small_image_label`, `e`.`special_from_date`, `e`.`special_price`, `e`.`special_to_date`, `e`.`swatch_image`, `e`.`tax_class_id`, `e`.`thumbnail`, `e`.`thumbnail_label`, `e`.`ts_dimensions_height`, `e`.`ts_dimensions_length`, `e`.`ts_dimensions_width`, `e`.`updated_at`, `e`.`url_key`, `e`.`url_path`, `e`.`visibility`, `e`.`weight`, `e`.`weight_type` FROM `catalog_product_flat_1` AS `e` INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.category_id='12' ORDER BY `cat_index_position` ASC, `cat_index`.`position` ASC


texts:
I am trying to create an Inner join between two tables but am running into a problem with the second table. There is a one to many relationship with the mageuserid in Main table and the entity_id in CCP. I need to only return the store state value in ccp where ccp.attribute_id = x. How would I accomplish that?

$collectionfetch=Mage::getModel('marketplace/userprofile')->getCollection()
                        ->addFieldToFilter('wantpartner',array('eq'=>1))
                        ->addFieldToFilter('partnerstatus',array('eq'=>'Seller'))
                        ->addFieldToFilter('logopic',array('neq'=>''));
        $prefix = Mage::getConfig()->getTablePrefix();
        $collectionfetch->getSelect()
        ->join(array("ccp" => $prefix."customer_entity_varchar"),"ccp.entity_id = main_table.mageuserid",array("store_state" => "value"));


texts: Magento: How to save in database a new column in the shopping cart

texts: I've created a new field in database and adding a new column in shopping cart items grid. But I don't know how to save the value in the data base. If I write some value and click the update cart button that value desapears.


texts: Can't override Sales Shipping model file

texts:
I try to change the shipping total title in the checkout review table. I have found where the label text is constructed,Mage_Sales_Model_Quote_Address_Total_Shipping::fetch() method is where I want to override the text, the method looks like this:

public function fetch(Mage_Sales_Model_Quote_Address $address)
{
    $amount = $address->getShippingAmount();
    if ($amount != 0 || $address->getShippingDescription()) {
        $title = Mage::helper('sales')->__('Shipping & Handling');

        /** the following if block is what I want to remove as I don't want
         *  extra text in the parenthesis
         */
        if ($address->getShippingDescription()) {
            $title .= ' (' . $address->getShippingDescription() . ')';
        }

        $address->addTotal(array(
            'code' => $this->getCode(),
            'title' => $title,
            'value' => $address->getShippingAmount()
        ));
    }
    return $this;
}

Please notice my comment in above code, I try to do it by overriding the class in my local directory, I have done it many times to other model classes, never had a problem, but I am stuck at this one...

My module config.xml (app/code/local/MyCompany/Sales/etc/config.xml)

<?xml version="1.0"?>
<config>
  <modules>
    <MyCompany_Sales>
      <version>0.1</version>
    </MyCompany_Sales>
  </modules>
  <global>
    <models>
      <sales>
        <rewrite>
           <quote_address_total_shipping>MyCompany_Sales_Model_Quote_Address_Total_Shipping</quote_address_total_shipping>
        </rewrite>
      </sales>
    </models>
  </global>
</config>

app/etc/modules/MyCompany_Sales.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MyCompany_Sales>
            <active>true</active>
            <codepool>local</codepool>
        </MyCompany_Sales>
    </modules>
</config>

My own model class file: (app/code/local/MyCompany/Sales/Model/Quote/Address/Total/Shipping.php)

class MyCompany_Sales_Model_Quote_Address_Total_Shipping extends Mage_Sales_Model_Quote_Address_Total_Shipping
{
  /**
   * Override to get rid of text between parenthesis
   */
  public function fetch(Mage_Sales_Model_Quote_Address $address)
  {
      $amount = $address->getShippingAmount();
      if ($amount != 0 || $address->getShippingDescription()) {
          $title = Mage::helper('sales')->__('Shipping & Handling');

          $address->addTotal(array(
              'code' => $this->getCode(),
              'title' => $title,
              'value' => $address->getShippingAmount()
          ));
      }
      return $this;
  }
}

Please help! I am running out of ideas. I reaaaly don't want to make changes to core files.

Many thanks!


texts: Magento 2 Stripe SCA (3d secure) rest api integration

texts:
I'm creating a pwa based on magento 2 rest api.
I have installed stripe/stripe-payments official module to integrate stripe payments.
Everything works fine without SCA payments.
i have tried to replicate the same flow of magento's frontend looking at the request done during the payments.
this is what i do:
1)
POST /guest-carts/:cartId/payment-information
RESPONSE {"message":"Authentication Required: pi_**_secret_**"}

CALL stripe.handleCardAction("pi_**_secret_**");

with that the stripe's test modal appear.
3)
CLICK COMPLETE BUTTON ON MODAL

REPOST /guest-carts/:cartId/payment-information with same data of 1. (magento frontend make the same request)
RESPONSE {"message":"The provided PaymentMethod is already attached to another object. You cannot reuse PaymentMethods without attaching them to a Customer object first."}

on stripe dashboard i can see that this flow create two payments but with magento's frontend only one.
what is missing?
Help please :)


texts:
I have Magento 1.8.1.0 and I would like to add text just after the price.
Example:

Now I have:
1 764,81 CHF

I would like to have add the text HT example:
1 764,81 CHF HT

I've tried to follow this tutorial:http://www.collaboration133.com/add-text-before-price-in-magento-1-8-1/2746/ but it doesn't work. I've tried ET Currency Manager extension, it's work but in the cart description I didn't want it to appear.

note: HT is the abreviation of Excl. Tax in french


texts: How can I set continuous customer ids for guests and registered customers?

texts:
I have a client which uses a ERP System to handle all Magento orders. For this reason I have created a module which exports all orders as a csv file. In Addition the ERP System of my client expect a continuous customer id, but the problem is that only registered customers get a customer id, so guests don't have a customer id, but customers ids should be continuous like the following example:

40000,               40001, 40002, 40003
registered customer, guest, guest, registed customer

Is there a way in Magento to grab the last customer id and add the guest temporary as new customer, so that Magento get notice of the new last customer id and remove this temporary customer after this action again?

I am looking for something like the following pseudocode:

$lastCustomerId = $customerCollection->getLastId();
$newId = $lastCustomerId + 1;
$customer = Mage::getModel("customer/customer");
$customer->setId($newId);
$customer->save();

// write the id to the file

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


texts: cant make pdf invoice when in production mode

texts:
When in development mode I can create pdf invoices just fine but when in production mode I get an error.

Under sales > Invoices I'm clicking the "Print" button to get a pdf of a invoice (see link)

It now says:
There has been an error processing your request

  Warning: strspn() expects parameter 1 to be string, object given in /home/dragoni5/public_html/vendor/magento/zendframework1/library/Zend/Pdf/StringParser.php on line 162

I'd really appreciate any feedback on this.


texts: Magento 2- Show Discount percentage in product view page

texts:
I have set the discount in percentage but its showing only for the simple products.Also I want to show it in the configurable products.

For the Simple Products:
vendor\magento\module-catalog\view\frontend\templates\product\view\type\default.phtml


texts: How I can move a element in product description page?

texts:
I want to move a small div which html is like in console

I want to include this div in

product.info.main

like in my xml  move is

<move element="page.main.title" destination="product-view-wrapper" />

so how I can include this div in product info


texts: How can I tell Magento to use PayPalUK instead of PayPal?

texts:
I ran into a PayPal issue on a Magento Multistore (US, UK). Magento 1.7.0.2

The problem is that PayPal is rejecting the orders on the UK site. It is throwing following exception:

PayPal response hasn't required fields. files/html/app/code/local/Mage/Paypal/Model/Api/Nvp.php:1011

I figured out that the required fields are different in UK and US:

files/html/app/code/core/Mage/Paypal/Model/Api/Nvp.php
    protected $_requiredResponseParams = array(
        self::DO_DIRECT_PAYMENT => array('ACK', 'CORRELATIONID', 'AMT')
    );

files/html/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php
    protected $_requiredResponseParams = array(
        self::DO_DIRECT_PAYMENT => array('RESULT', 'PNREF', 'PPREF')
    );

I caught the PayPal response and found out that the PayPal response is different - depending on the store. The response in UK didn't contain the parameter 'ACK' and 'CORRELATIONID'.
So I assume the issue occurs because Magento is using the wrong Nvp.php (the standard one, not from the PayPalUk version). But how can I tell Magento to use the UK one?

Thank you!


texts:
Can anyone help me to show yotpo review into tabs at product details page?

I have try with this script in catalog_product_view.xml file, It's showing magento's review but i want to show yotpo review.

<block class="Magento\Catalog\Block\Product\View" name="review" template="Magento_Catalog::product/view/review.phtml" group="detailed_info">
                    <arguments>
                        <argument translate="true" name="title" xsi:type="string">Reviews</argument>
                        <argument name="sort_order" xsi:type="string">30</argument>
                    </arguments>
                </block>


texts:
I'm creating a template for a widget and would like to echo the widget title in my PHP code. What is the proper way of doing that?

The following does not work:

<?php echo $this->getTitle() ?>

Note: this is part of a custom PHTML file in my theme.


texts:
how can I upload SVG files(icons for example) to my cms Page.

If I try to upload them by using "insert image" and upload them to my media storage I always get "Disallowed file type"?

Is there any way to allow the upload of SVG files?


texts:
I tried to add a main.js to my Magento theme using the answer on How To add JS file in frontend for all pages, however, it caused issues so I removed this, however, I still get console error for this.

Uncaught SyntaxError: Unexpected token } in JSON at position 199
at JSON.parse (<anonymous>)
at getData (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/mage/apply/main.js:51:24)
at Array.map (native)
at HTMLDocument.apply (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/mage/apply/main.js:67:18)
at fire (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/jquery.js:3232:32)
at Object.add [as done] (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/jquery.js:3291:8)
at jQuery.fn.init.jQuery.fn.ready (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/jquery.js:3542:26)
at jQuery.fn.init (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/jquery.js:2967:11)
at jQuery.fn.init (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/jquery/jquery-migrate.js:225:17)
at jQuery (http://domain.dev/products/pub/static/version1497885161/frontend/aa/aa-theme/en_US/jquery.js:75:11)

I've tried to resolve this by removing the contents of pub/static and ran the PHP bin/magento setup:static-content: deploy but the console error still appears and is causing all javascript elements on my Magento site to not work.


texts: Unable to view Browse Files&Upload Files buttons to upload Product Images in Tablets(Android OS)

texts:
I am able to upload images when using a lappy or desktop. But when I try the same in an Android Tablet, I am unable to see the Browse Files and the Upload Files Buttons. It gives a message to install Flash Player. But it doesn't work.

Did anyone come across this issue? Or if there is any possible solution, please post it.

Thank you!


texts: Display customer attribute in promotions page

texts: Is it possible to bring the Customer attribute in the Shopping cart price rule section to make a conditions like catalog attributes are showing in the promotions page( use for Promo rule conditions).


texts: Custom redirect user to specific page after register Observer in Magento 2 will just redirect after the cms page to the login page

texts:
I have another problem with my custom observer module for account registration page redirect.

somehow it will successfully redirect to my custom cms thank you page after registration. but after that one, it will ask me to log in after registration. normally it should be automatically logged in instead of asking me to log in again.

Here's the codes:

  app/code/Vendor/Module/etc/frontend/events.xml

<event name="customer_register_success">
    <observer name="registerAfter" instance="Vendor\Module\Observer\RegisterAfter" />
</event>

  app/code/Vendor/Module/Observer/RegisterAfter.php

{
    protected $_responseFactory;

    protected $_redirect;

    protected $_url;

    public function __construct(
        \Magento\Framework\View\Element\BlockFactory $blockFactory,
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\UrlInterface $url,
        \Magento\Framework\App\Response\Http $redirect
    ) {
        $this->_responseFactory = $responseFactory;
        $this->_url = $url;
        $this->_redirect = $redirect;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customRedirectionUrl = $this->_url->getUrl('thank-you-account-creation');
        $this->_responseFactory->create()->setRedirect($customRedirectionUrl)->sendResponse();
        die();
    }
}


texts: Created node doesn't have attachEvent property

texts:
After updated magento from 2.1 to 2.3 I've got a require js error in console:

Uncaught Error: Script error for: ModuleName

I made an investigation and find out that require.js core file in the function req.load is trying to create node document.createElement('script') and then checks if this node has attachEvent property. In my case it's script node. And there is no attachEvent property. By this reason I've got an error.
Can somebody explain why it happens? Everything was good before and code seems was the same.


texts:
I am trying to figure out what is going wrong in my Magento 1.8.1 setup.

My Magento 1.8.1 installation is all working fine if I access it from the server IP (e.g. XXX.XXX.XXX.XXX/magento).

After I configured my domain (e.g. xxx.xxxxx.com), the index.php page and the index.php/admin seem to load ok. However I am not able to login in both of them using Chrome.

Actually I was able to login the first time, then after I logged out I am not able to login anymore. Even clearing cookies on the browser and emptying the var/session and var cache folder seems to change nothing (I am only able to login the first time).

I also tried to comment out some lines (87-104) on the Mage\Core\Model\Session\Abstract\Varien.php file, nothing changed (it only created a long list of warning in my system.log).

    // session cookie params
    // $cookieParams = array(
    //     'lifetime' => $cookie->getLifetime(),
    //     'path'     => $cookie->getPath(),
    //     'domain'   => $cookie->getConfigDomain(),
    //     'secure'   => $cookie->isSecure(),
    //     'httponly' => $cookie->getHttponly()
    // );

This problem seems related to Chrome, in Internet Explorer and Safari it seems to work fine.
In Chrome with Incognito mode all seems to work fine sometimes (sometimes it works also after loggin out, sometimes after loggin out I am not able to login again as without the incognito mode).


texts: Magento 2: Any one have the sample of products csv file for magmi?

texts:
I have tried to import product CSV file using a magmi but somehow it's not assigned Default stock value. For that, I need to re-save the product from admin then after it will add into the cart.

I have also tried to add quantity, is_in_stock column in CSV file but it's not working.

have any idea, please share.


texts: Magento 2.3.3 Missing content in admin panel

texts:
After updating to version 2.3.3 and set SSL URL
The content of several pages(cms pages/consumer/orders/cms blocks and more) is admin panel is missing
this is what I get:

After on  debug Error showing as:
"this is the error I get: Access to XMLHttpRequest at '332092-1019808-1-raikfcquaxqncofqfm.stackpathdns.com/pub/static/…' from origin 'url.co.il' has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response. and solved now by remove Base URL for Static View Files. "

Any help?

Thanks


texts: Getting this error "This page isn’t working HTTP ERROR 500"

texts:
Please help, how to find error log and fix

Magento 2.3.2

This page isn’t working
domainname.com is currently unable to handle this request.
HTTP ERROR 500